~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/ext/source/legacy/layout/BorderLayoutRegions.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Ext JS Library 2.0.2
 
3
 * Copyright(c) 2006-2008, Ext JS, LLC.
 
4
 * licensing@extjs.com
 
5
 * 
 
6
 * http://extjs.com/license
 
7
 */
 
8
 
 
9
/*
 
10
 * These classes are private internal classes
 
11
 */
 
12
Ext.CenterLayoutRegion = function(mgr, config){
 
13
    Ext.CenterLayoutRegion.superclass.constructor.call(this, mgr, config, "center");
 
14
    this.visible = true;
 
15
    this.minWidth = config.minWidth || 20;
 
16
    this.minHeight = config.minHeight || 20;
 
17
};
 
18
 
 
19
Ext.extend(Ext.CenterLayoutRegion, Ext.LayoutRegion, {
 
20
    hide : function(){
 
21
        // center panel can't be hidden
 
22
    },
 
23
    
 
24
    show : function(){
 
25
        // center panel can't be hidden
 
26
    },
 
27
    
 
28
    getMinWidth: function(){
 
29
        return this.minWidth;
 
30
    },
 
31
    
 
32
    getMinHeight: function(){
 
33
        return this.minHeight;
 
34
    }
 
35
});
 
36
 
 
37
 
 
38
Ext.NorthLayoutRegion = function(mgr, config){
 
39
    Ext.NorthLayoutRegion.superclass.constructor.call(this, mgr, config, "north", "n-resize");
 
40
    if(this.split){
 
41
        this.split.placement = Ext.SplitBar.TOP;
 
42
        this.split.orientation = Ext.SplitBar.VERTICAL;
 
43
        this.split.el.addClass("x-layout-split-v");
 
44
    }
 
45
    var size = config.initialSize || config.height;
 
46
    if(typeof size != "undefined"){
 
47
        this.el.setHeight(size);
 
48
    }
 
49
};
 
50
Ext.extend(Ext.NorthLayoutRegion, Ext.SplitLayoutRegion, {
 
51
    orientation: Ext.SplitBar.VERTICAL,
 
52
    getBox : function(){
 
53
        if(this.collapsed){
 
54
            return this.collapsedEl.getBox();
 
55
        }
 
56
        var box = this.el.getBox();
 
57
        if(this.split){
 
58
            box.height += this.split.el.getHeight();
 
59
        }
 
60
        return box;
 
61
    },
 
62
    
 
63
    updateBox : function(box){
 
64
        if(this.split && !this.collapsed){
 
65
            box.height -= this.split.el.getHeight();
 
66
            this.split.el.setLeft(box.x);
 
67
            this.split.el.setTop(box.y+box.height);
 
68
            this.split.el.setWidth(box.width);
 
69
        }
 
70
        if(this.collapsed){
 
71
            this.updateBody(box.width, null);
 
72
        }
 
73
        Ext.NorthLayoutRegion.superclass.updateBox.call(this, box);
 
74
    }
 
75
});
 
76
 
 
77
Ext.SouthLayoutRegion = function(mgr, config){
 
78
    Ext.SouthLayoutRegion.superclass.constructor.call(this, mgr, config, "south", "s-resize");
 
79
    if(this.split){
 
80
        this.split.placement = Ext.SplitBar.BOTTOM;
 
81
        this.split.orientation = Ext.SplitBar.VERTICAL;
 
82
        this.split.el.addClass("x-layout-split-v");
 
83
    }
 
84
    var size = config.initialSize || config.height;
 
85
    if(typeof size != "undefined"){
 
86
        this.el.setHeight(size);
 
87
    }
 
88
};
 
89
Ext.extend(Ext.SouthLayoutRegion, Ext.SplitLayoutRegion, {
 
90
    orientation: Ext.SplitBar.VERTICAL,
 
91
    getBox : function(){
 
92
        if(this.collapsed){
 
93
            return this.collapsedEl.getBox();
 
94
        }
 
95
        var box = this.el.getBox();
 
96
        if(this.split){
 
97
            var sh = this.split.el.getHeight();
 
98
            box.height += sh;
 
99
            box.y -= sh;
 
100
        }
 
101
        return box;
 
102
    },
 
103
    
 
104
    updateBox : function(box){
 
105
        if(this.split && !this.collapsed){
 
106
            var sh = this.split.el.getHeight();
 
107
            box.height -= sh;
 
108
            box.y += sh;
 
109
            this.split.el.setLeft(box.x);
 
110
            this.split.el.setTop(box.y-sh);
 
111
            this.split.el.setWidth(box.width);
 
112
        }
 
113
        if(this.collapsed){
 
114
            this.updateBody(box.width, null);
 
115
        }
 
116
        Ext.SouthLayoutRegion.superclass.updateBox.call(this, box);
 
117
    }
 
118
});
 
119
 
 
120
Ext.EastLayoutRegion = function(mgr, config){
 
121
    Ext.EastLayoutRegion.superclass.constructor.call(this, mgr, config, "east", "e-resize");
 
122
    if(this.split){
 
123
        this.split.placement = Ext.SplitBar.RIGHT;
 
124
        this.split.orientation = Ext.SplitBar.HORIZONTAL;
 
125
        this.split.el.addClass("x-layout-split-h");
 
126
    }
 
127
    var size = config.initialSize || config.width;
 
128
    if(typeof size != "undefined"){
 
129
        this.el.setWidth(size);
 
130
    }
 
131
};
 
132
Ext.extend(Ext.EastLayoutRegion, Ext.SplitLayoutRegion, {
 
133
    orientation: Ext.SplitBar.HORIZONTAL,
 
134
    getBox : function(){
 
135
        if(this.collapsed){
 
136
            return this.collapsedEl.getBox();
 
137
        }
 
138
        var box = this.el.getBox();
 
139
        if(this.split){
 
140
            var sw = this.split.el.getWidth();
 
141
            box.width += sw;
 
142
            box.x -= sw;
 
143
        }
 
144
        return box;
 
145
    },
 
146
 
 
147
    updateBox : function(box){
 
148
        if(this.split && !this.collapsed){
 
149
            var sw = this.split.el.getWidth();
 
150
            box.width -= sw;
 
151
            this.split.el.setLeft(box.x);
 
152
            this.split.el.setTop(box.y);
 
153
            this.split.el.setHeight(box.height);
 
154
            box.x += sw;
 
155
        }
 
156
        if(this.collapsed){
 
157
            this.updateBody(null, box.height);
 
158
        }
 
159
        Ext.EastLayoutRegion.superclass.updateBox.call(this, box);
 
160
    }
 
161
});
 
162
 
 
163
Ext.WestLayoutRegion = function(mgr, config){
 
164
    Ext.WestLayoutRegion.superclass.constructor.call(this, mgr, config, "west", "w-resize");
 
165
    if(this.split){
 
166
        this.split.placement = Ext.SplitBar.LEFT;
 
167
        this.split.orientation = Ext.SplitBar.HORIZONTAL;
 
168
        this.split.el.addClass("x-layout-split-h");
 
169
    }
 
170
    var size = config.initialSize || config.width;
 
171
    if(typeof size != "undefined"){
 
172
        this.el.setWidth(size);
 
173
    }
 
174
};
 
175
Ext.extend(Ext.WestLayoutRegion, Ext.SplitLayoutRegion, {
 
176
    orientation: Ext.SplitBar.HORIZONTAL,
 
177
    getBox : function(){
 
178
        if(this.collapsed){
 
179
            return this.collapsedEl.getBox();
 
180
        }
 
181
        var box = this.el.getBox();
 
182
        if(this.split){
 
183
            box.width += this.split.el.getWidth();
 
184
        }
 
185
        return box;
 
186
    },
 
187
    
 
188
    updateBox : function(box){
 
189
        if(this.split && !this.collapsed){
 
190
            var sw = this.split.el.getWidth();
 
191
            box.width -= sw;
 
192
            this.split.el.setLeft(box.x+box.width);
 
193
            this.split.el.setTop(box.y);
 
194
            this.split.el.setHeight(box.height);
 
195
        }
 
196
        if(this.collapsed){
 
197
            this.updateBody(null, box.height);
 
198
        }
 
199
        Ext.WestLayoutRegion.superclass.updateBox.call(this, box);
 
200
    }
 
201
});