author | Claus Gittinger <cg@exept.de> |
Thu, 23 Nov 1995 19:19:24 +0100 | |
changeset 205 | 6814c0bf8df8 |
parent 202 | 01f3cbb8e20e |
child 294 | 667773990289 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
VariableVerticalPanel subclass:#VariableHorizontalPanel |
|
59 | 14 |
instanceVariableNames:'' |
95 | 15 |
classVariableNames:'DefaultCursor' |
59 | 16 |
poolDictionaries:'' |
17 |
category:'Views-Layout' |
|
0 | 18 |
! |
19 |
||
38 | 20 |
!VariableHorizontalPanel class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
59 | 25 |
All Rights Reserved |
38 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
a View to separate its subviews horizontally by a movable bar |
|
39 |
to adjust the size-ratios. |
|
40 |
The bar-handle is either an exposed knob (knobStyle == #motif) |
|
41 |
or the forms defined in Scroller (knobStyle ~~ #motif) |
|
42 |
or nothing. |
|
43 |
||
44 |
The subvies dimensions MUST be given as relative sizes; |
|
45 |
typically creation is done as: |
|
0 | 46 |
|
59 | 47 |
p := VariableHorizontalPanel in:superView. |
48 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
|
49 |
corner:0.5 @ 1.0 |
|
50 |
in:p. |
|
51 |
v2 := <someViewClass> origin:0.5 @ 0.0 |
|
52 |
corner:0.8 @ 1.0 |
|
53 |
in:p. |
|
54 |
v3 := <someViewClass> origin:0.8 @ 0.0 |
|
55 |
corner:1.0 @ 1.0 |
|
56 |
in:p. |
|
38 | 57 |
|
63 | 58 |
" |
59 |
! |
|
60 |
||
61 |
examples |
|
62 |
" |
|
38 | 63 |
example: |
59 | 64 |
|top p v1 v2 v3| |
38 | 65 |
|
59 | 66 |
top := StandardSystemView new. |
67 |
top extent:300@200. |
|
0 | 68 |
|
59 | 69 |
p := VariableHorizontalPanel |
70 |
origin:0.0 @ 0.0 |
|
71 |
corner:1.0 @ 1.0 |
|
72 |
in:top. |
|
73 |
v1 := SelectionInListView |
|
74 |
origin:0.0 @ 0.0 |
|
75 |
corner:0.5 @ 1.0 |
|
76 |
in:p. |
|
77 |
v2 := EditTextView |
|
78 |
origin:0.5 @ 0.0 |
|
79 |
corner:0.8 @ 1.0 |
|
80 |
in:p. |
|
81 |
v3 := ScrollableView |
|
82 |
for:TextView |
|
83 |
in:p. |
|
84 |
v3 origin:0.8 @ 0.0 |
|
85 |
corner:1.0 @ 1.0. |
|
86 |
top open |
|
38 | 87 |
" |
202 | 88 |
! ! |
89 |
||
90 |
!VariableHorizontalPanel methodsFor:'drawing'! |
|
91 |
||
92 |
drawHandleAtX:hx y:hy |
|
93 |
|w x m| |
|
94 |
||
95 |
shadowForm notNil ifTrue:[ |
|
96 |
w := shadowForm width |
|
97 |
] ifFalse:[ |
|
98 |
w := barHeight - 4 |
|
99 |
]. |
|
100 |
||
101 |
self paint:viewBackground. |
|
102 |
self fillRectangleX:hx y:margin |
|
103 |
width:barHeight |
|
104 |
height:(height - margin - margin). |
|
105 |
||
106 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
|
107 |
m := (barHeight - w) // 2. |
|
108 |
shadowForm isNil ifTrue:[ |
|
109 |
x := hx + (barHeight // 2). |
|
110 |
separatingLine ifTrue:[ |
|
111 |
self paint:shadowColor. |
|
112 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
|
113 |
x := x + 1. |
|
114 |
self paint:lightColor. |
|
115 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
|
116 |
]. |
|
117 |
self paint:viewBackground. |
|
118 |
self fillRectangleX:hx y:(hy - barWidth) |
|
119 |
width:w |
|
120 |
height:(barWidth + barWidth). |
|
121 |
||
122 |
handleStyle == #line ifTrue:[ |
|
123 |
self paint:handleColor. |
|
124 |
self displayLineFromX:x y:hy - barWidth toX:x y:hy + barWidth. |
|
125 |
] ifFalse:[ |
|
126 |
x := hx. |
|
127 |
handleStyle == #st80 ifTrue:[ |
|
128 |
x := x - 1. |
|
129 |
]. |
|
130 |
self drawEdgesForX:(x + m) |
|
131 |
y:(hy - barWidth) |
|
132 |
width:w |
|
133 |
height:(barWidth + barWidth) |
|
134 |
level:handleLevel. |
|
135 |
handleStyle == #iris ifTrue:[ |
|
136 |
self paint:handleColor. |
|
137 |
self fillDeviceRectangleX:(x + m + 2) |
|
138 |
y:(hy - barWidth + 2) |
|
139 |
width:w - 4 |
|
140 |
height:(barWidth + barWidth - 4) |
|
141 |
]. |
|
142 |
] |
|
143 |
] ifFalse:[ |
|
144 |
x := hx. |
|
145 |
self drawHandleFormAtX:(x + m) y:hy |
|
146 |
]. |
|
147 |
handleStyle == #st80 ifTrue:[ |
|
148 |
x := hx - 1. |
|
149 |
self paint:lightColor. |
|
150 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
|
151 |
self displayLineFromX:hx y:0 toX:(hx + barHeight - 1) y:0. |
|
152 |
x := hx + barHeight - 2. |
|
153 |
self paint:shadowColor. |
|
154 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
|
155 |
"uncomment the -1 if you dont like the notch at the bottom end" |
|
156 |
" VVV" |
|
157 |
self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeight - 1) y:height-1. |
|
158 |
]. |
|
159 |
] ifFalse:[ |
|
160 |
x := hx + barHeight - 1. |
|
161 |
self paint:handleColor. |
|
162 |
separatingLine ifTrue:[ |
|
163 |
self displayLineFromX:hx+1 y:0 toX:hx+1 y:height. |
|
164 |
self displayLineFromX:x y:0 toX:x y:height. |
|
165 |
]. |
|
166 |
self fillRectangleX:hx y:hy width:barHeight height:barWidth |
|
167 |
] |
|
168 |
||
169 |
"Modified: 14.11.1995 / 20:30:12 / cg" |
|
170 |
! |
|
171 |
||
172 |
invertHandleBarAtX:hx y:hy |
|
173 |
self noClipByChildren. |
|
174 |
self xoring:[ |
|
175 |
|x| |
|
176 |
||
177 |
trackLine ifTrue:[ |
|
178 |
x := hx + (barHeight // 2). |
|
179 |
self displayLineFromX:x y:0 toX:x y:height. |
|
180 |
] ifFalse:[ |
|
181 |
self fillRectangleX:hx y:0 width:barHeight height:height |
|
182 |
] |
|
183 |
]. |
|
184 |
self clipByChildren. |
|
185 |
! ! |
|
186 |
||
187 |
!VariableHorizontalPanel methodsFor:'initializing'! |
|
188 |
||
189 |
defaultControllerClass |
|
190 |
^ VariableHorizontalPanelController |
|
191 |
! |
|
192 |
||
193 |
initCursor |
|
194 |
"set the cursor - a horizontal double arrow" |
|
195 |
||
196 |
DefaultCursor notNil ifTrue:[ |
|
197 |
cursor := DefaultCursor |
|
198 |
] ifFalse:[ |
|
199 |
cursor := Cursor sourceForm:(Form fromFile:'VHPanel.xbm') |
|
200 |
maskForm:(Form fromFile:'VHPanel_m.xbm') |
|
201 |
hotX:8 |
|
202 |
hotY:8. |
|
203 |
" |
|
204 |
if bitmaps are not available, use a standard cursor |
|
205 |
" |
|
206 |
cursor isNil ifTrue:[ |
|
207 |
"which one looks better ?" |
|
208 |
cursor := Cursor leftRightArrow |
|
209 |
"cursor := Cursor leftLimitArrow" |
|
210 |
]. |
|
211 |
DefaultCursor := cursor |
|
212 |
] |
|
38 | 213 |
! ! |
0 | 214 |
|
99 | 215 |
!VariableHorizontalPanel methodsFor:'private'! |
216 |
||
0 | 217 |
handleOriginsFrom:start to:stop do:aBlock |
218 |
"evaluate the argument block for some handle-origins" |
|
219 |
||
63 | 220 |
|y hh vDelta| |
0 | 221 |
|
222 |
subViews notNil ifTrue:[ |
|
59 | 223 |
shadowForm notNil ifTrue:[ |
224 |
hh := shadowForm height |
|
225 |
] ifFalse:[ |
|
63 | 226 |
hh := barWidth |
227 |
]. |
|
228 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
|
229 |
vDelta := barWidth // 2. |
|
230 |
] ifFalse:[ |
|
231 |
vDelta := 0 |
|
59 | 232 |
]. |
233 |
(handlePosition == #left) ifTrue:[ |
|
63 | 234 |
y := vDelta |
59 | 235 |
] ifFalse:[ |
236 |
(handlePosition == #right) ifTrue:[ |
|
63 | 237 |
y := height - hh - margin - vDelta |
59 | 238 |
] ifFalse:[ |
63 | 239 |
y := height - barWidth // 2 |
59 | 240 |
] |
241 |
]. |
|
242 |
(start + 1) to:stop do:[:index | |
|
243 |
|x view| |
|
0 | 244 |
|
59 | 245 |
view := subViews at:index. |
246 |
x := view origin x - barHeight + 1. |
|
247 |
aBlock value:(x @ y) |
|
248 |
] |
|
0 | 249 |
] |
250 |
! |
|
251 |
||
105 | 252 |
resizeSubviewsFrom:start to:stop |
253 |
"readjust size of some subviews" |
|
254 |
||
255 |
|step nSubviews| |
|
256 |
||
257 |
subViews notNil ifTrue:[ |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
258 |
(start <= stop) ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
259 |
step := 1 |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
260 |
] ifFalse:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
261 |
step := -1 |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
262 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
263 |
nSubviews := subViews size. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
264 |
start to:stop by:step do:[:index | |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
265 |
|bw view o1 o2 relCorner relOrg newCorner newOrg newExt| |
105 | 266 |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
267 |
view := subViews at:index. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
268 |
bw := view borderWidth. |
105 | 269 |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
270 |
index == 1 ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
271 |
o1 := 0. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
272 |
] ifFalse:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
273 |
o1 := barHeight // 2 - bw |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
274 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
275 |
index == nSubviews ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
276 |
o2 := 0. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
277 |
] ifFalse:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
278 |
o2 := barHeight // 2 - bw |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
279 |
]. |
105 | 280 |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
281 |
relCorner := view relativeCorner. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
282 |
relCorner isNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
283 |
self error:'subview must have relative corner' |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
284 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
285 |
newCorner := view cornerFromRelativeCorner. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
286 |
newCorner notNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
287 |
newCorner x:(newCorner x - o2) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
288 |
]. |
105 | 289 |
|
290 |
" |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
291 |
relOrg := view relativeOrigin. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
292 |
relOrg isNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
293 |
self error:'subview must have relative origin' |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
294 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
295 |
newOrg := view originFromRelativeOrigin. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
296 |
newOrg notNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
297 |
(index ~~ 1) ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
298 |
newOrg x:(newOrg x + o1) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
299 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
300 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
301 |
view pixelOrigin:newOrg corner:newCorner |
105 | 302 |
" |
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
303 |
newOrg := view computeOrigin. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
304 |
newOrg notNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
305 |
(index ~~ 1) ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
306 |
newOrg x:(newOrg x + o1) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
307 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
308 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
309 |
newExt := view computeExtent. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
310 |
newExt notNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
311 |
newExt x:(newExt x - o2 - o1) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
312 |
]. |
105 | 313 |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
314 |
view pixelOrigin:newOrg extent:newExt. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
315 |
] |
105 | 316 |
] |
317 |
! |
|
318 |
||
319 |
setupSubviewOrigins |
|
320 |
"setup subviews origins (SV 16.1.95)" |
|
321 |
||
322 |
|x e| |
|
323 |
||
324 |
x := 0.0. |
|
325 |
||
326 |
1 to:(subViews size) do:[:index | |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
327 |
|view| |
105 | 328 |
|
174
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
329 |
view := subViews at:index. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
330 |
e := view relativeExtent. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
331 |
e notNil ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
332 |
view relativeExtent:nil. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
333 |
e := e x. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
334 |
index == subViews size ifTrue:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
335 |
view origin:(x @ 0.0) corner:(1.0 @ 1.0) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
336 |
] ifFalse:[ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
337 |
view origin:(x @ 0.0) corner:((x+e) @ 1.0) |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
338 |
]. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
339 |
x := x + e. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
340 |
] ifFalse: [ |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
341 |
view origin:(x @ 0.0). |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
342 |
x := view relativeCorner x. |
d80a6cc3f9b2
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
105
diff
changeset
|
343 |
]. |
105 | 344 |
] |
345 |
||
0 | 346 |
! |
347 |
||
202 | 348 |
setupSubviewSizes |
349 |
"setup subviews sizes (in case of non-relative sizes)" |
|
350 |
||
351 |
|x w | |
|
352 |
||
353 |
self anyNonRelativeSubviews ifTrue:[ |
|
354 |
"there is at least one subview without |
|
355 |
relative origin/extent - setup all subviews |
|
356 |
to spread evenly ..." |
|
357 |
||
358 |
x := 0.0. |
|
359 |
w := 1.0 / (subViews size). |
|
360 |
||
361 |
1 to:(subViews size) do:[:index | |
|
362 |
|view| |
|
363 |
||
364 |
view := subViews at:index. |
|
365 |
index == subViews size ifTrue:[ |
|
366 |
view origin:(x @ 0.0) corner:(1.0 @ 1.0) |
|
367 |
] ifFalse:[ |
|
368 |
view origin:(x @ 0.0) corner:((x + w) @ 1.0) |
|
369 |
]. |
|
370 |
x := x + w |
|
371 |
] |
|
372 |
] |
|
0 | 373 |
! ! |
374 |
||
205 | 375 |
!VariableHorizontalPanel class methodsFor:'documentation'! |
376 |
||
377 |
version |
|
378 |
^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanel.st,v 1.17 1995-11-23 18:16:49 cg Exp $' |
|
379 |
! ! |