author | Claus Gittinger <cg@exept.de> |
Fri, 04 Dec 2015 17:26:23 +0100 | |
changeset 5516 | 6ac4f56c49f3 |
parent 4945 | b3a7feb93dd8 |
child 5536 | b5b14ac35684 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
60 | 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 |
" |
|
2190 | 12 |
"{ Package: 'stx:libwidg' }" |
13 |
||
5516 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
119 | 16 |
SimpleView subclass:#PanelView |
585 | 17 |
instanceVariableNames:'hLayout vLayout verticalSpace horizontalSpace mustRearrange |
4415 | 18 |
elementsChangeSize ignoreInvisibleComponents backgroundChannel' |
585 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Views-Layout' |
|
0 | 22 |
! |
23 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
24 |
!PanelView class methodsFor:'documentation'! |
0 | 25 |
|
38 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
60 | 29 |
All Rights Reserved |
0 | 30 |
|
38 | 31 |
This software is furnished under a license and may be used |
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
0 | 39 |
|
38 | 40 |
documentation |
41 |
" |
|
127 | 42 |
this is a view for holding subviews. (layout-widget ?) |
38 | 43 |
|
44 |
Instances of PanelView try to get all their subviews into them, |
|
45 |
arranging subviews left-to-right, top-to-bottom. |
|
46 |
||
47 |
If you dont like its layout, define a new subclass or use one of |
|
48 |
the existing subclasses: HorizontalPanelView and VerticalPanelView. |
|
60 | 49 |
|
127 | 50 |
The panel assumes, that the elements do not resize themselfes, after it |
51 |
became visible. This is not true for all widgets (buttons or labels may |
|
52 |
like to change). If you have changing elements, tell this to the panel |
|
53 |
with 'aPanel elementsChangeSize:true'. In that case, the panel will react |
|
54 |
to size changes, and reorganize things. |
|
55 |
||
63 | 56 |
PanelViews normally delay the actual positioning/sizing of their elements, |
60 | 57 |
until actually displayed. This is useful, if more elements are to |
58 |
be added, to avoid repeated configuration of the elements. |
|
59 |
||
60 |
If you want to query for the relative position of an element BEFORE |
|
61 |
the view is visible, you have to send #setChildPositionsIfChanged before |
|
63 | 62 |
doing so (otherwise, you may get invalid origins from the subviews). As |
63 |
an example, the modalBoxes do so before showing themselfes to ask for the |
|
64 |
position of the ok-button relative to the top-left box-origin, in order to |
|
65 |
position the ok-button under the mouse-pointer. |
|
66 |
||
585 | 67 |
[Instance variables:] |
63 | 68 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
69 |
hLayout <Symbol> controls horizontal layout; ignored in this |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
70 |
class, but used in Horizontal- and |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
71 |
VerticalPanelViews. See more info there. |
63 | 72 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
73 |
vLayout <Symbol> controls vertical layout; ignored in this |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
74 |
class, but used in Horizontal- and |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
75 |
VerticalPanelViews. See more info there. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
76 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
77 |
horizontalSpace <Integer> number of pixels to use as space between elements |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
78 |
defaults to ViewSpacing, which is 1mm |
63 | 79 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
80 |
verticalSpace <Integer> number of pixels to use as space between elements |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
81 |
defaults to ViewSpacing, which is 1mm |
63 | 82 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
83 |
mustRearrange <Boolean> internal flag, if rearrangement is needed |
63 | 84 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
85 |
elementsChangeSize |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
86 |
<Boolean> if true, the panel takes care of this situation. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
87 |
By default, this is false. |
125 | 88 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
89 |
ignoreInvisibleComponents |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
90 |
<Boolean> if true, invisible (i.e. hidden) views |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
91 |
are not considered in the layout computation. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
92 |
If false, they will lead to additional space |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
93 |
between visible components. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
94 |
The default is false. |
585 | 95 |
|
96 |
[author:] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
97 |
Claus Gittinger |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
98 |
" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
99 |
! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
100 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
101 |
examples |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
102 |
" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
103 |
The generic panelView simply tries to get its |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
104 |
components arranged for fitting them all into |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
105 |
its area. No special layout is done, except for |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
106 |
horizontal/vertical spacings. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
107 |
The view is filled top-left to bottom-right |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
108 |
with subcomponents. Subcomponents are not resized. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
109 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
110 |
example: |
1604 | 111 |
[exBegin] |
112 |
|v p b1 b2 b3| |
|
113 |
||
114 |
v := StandardSystemView new. |
|
115 |
v label:'panel'. |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
116 |
|
1604 | 117 |
p := PanelView in:v. |
118 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
119 |
b1 := Button label:'button1' in:p. |
|
120 |
b2 := Button label:'button2' in:p. |
|
121 |
b3 := Button label:'button3' in:p. |
|
122 |
v extent:300 @ 100. |
|
123 |
v open |
|
124 |
[exEnd] |
|
125 |
||
126 |
||
127 |
invisible component not considered in layout: |
|
128 |
[exBegin] |
|
129 |
|v p b1 b2 b3| |
|
130 |
||
131 |
v := StandardSystemView new. |
|
132 |
v label:'panel'. |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
133 |
|
1604 | 134 |
p := PanelView in:v. |
135 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
136 |
b1 := Button label:'button1' in:p. |
|
137 |
b2 := Button label:'button2' in:p. |
|
138 |
b2 beInvisible. |
|
139 |
b3 := Button label:'button3' in:p. |
|
140 |
v extent:300 @ 100. |
|
141 |
v open |
|
142 |
[exEnd] |
|
143 |
||
144 |
invisible component considered in layout: |
|
145 |
[exBegin] |
|
146 |
|v p b1 b2 b3| |
|
147 |
||
148 |
v := StandardSystemView new. |
|
149 |
v label:'panel'. |
|
150 |
||
151 |
p := PanelView in:v. |
|
152 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
153 |
p ignoreInvisibleComponents:false. |
|
154 |
b1 := Button label:'button1' in:p. |
|
155 |
b2 := Button label:'button2' in:p. |
|
156 |
b2 beInvisible. |
|
157 |
b3 := Button label:'button3' in:p. |
|
158 |
v extent:300 @ 100. |
|
159 |
v open |
|
160 |
[exEnd] |
|
38 | 161 |
" |
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
162 |
! ! |
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
163 |
|
202 | 164 |
!PanelView methodsFor:'accessing'! |
165 |
||
1959 | 166 |
elementsChangeSize |
167 |
"tell the panel if elements are to change their size by themselfes |
|
168 |
(for example, Labels or Buttons may do so if their contents changes). |
|
169 |
Setting this flag will make the panel reorganize the elements whenever |
|
170 |
any element changes its size." |
|
171 |
||
172 |
^ elementsChangeSize |
|
173 |
! |
|
174 |
||
202 | 175 |
elementsChangeSize:aBoolean |
176 |
"tell the panel if elements are to change their size by themselfes |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
177 |
(for example, Labels or Buttons may do so if their contents changes). |
202 | 178 |
Setting this flag will make the panel reorganize the elements whenever |
179 |
any element changes its size." |
|
180 |
||
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
181 |
elementsChangeSize ~~ aBoolean ifTrue:[ |
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
182 |
elementsChangeSize := aBoolean. |
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
183 |
aBoolean ifTrue:[ |
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
184 |
self makeMyselfDependentOnSubviews. |
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
185 |
]. |
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
186 |
]. |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
187 |
! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
188 |
|
3843 | 189 |
hierarchicalIndexOfChild:aView |
190 |
^ aView hierarchicalIndexInList:subViews |
|
191 |
! |
|
192 |
||
1036 | 193 |
horizontalLayout |
194 |
"not supported by this view" |
|
195 |
||
196 |
^ nil |
|
197 |
! |
|
198 |
||
199 |
horizontalLayout:aLayoutSymbol |
|
200 |
"not supported by this view" |
|
201 |
||
202 |
! |
|
203 |
||
1072 | 204 |
horizontalSpace |
205 |
"return the horizontal space between elements on pixels (default is 1mm)" |
|
206 |
||
207 |
^ horizontalSpace |
|
208 |
! |
|
209 |
||
202 | 210 |
horizontalSpace:numberOfPixels |
211 |
"set the horizontal space between elements on pixels (default is 1mm)" |
|
212 |
||
213 |
horizontalSpace ~= numberOfPixels ifTrue:[ |
|
214 |
horizontalSpace := numberOfPixels. |
|
215 |
self layoutChanged |
|
216 |
] |
|
217 |
! |
|
218 |
||
1423 | 219 |
ignoreInvisibleComponents |
220 |
"return the flag which controls if invisible (unrealized) |
|
221 |
components should be ignored in the layout computation. |
|
222 |
By default, it is false, which means that invisible components will |
|
223 |
lead to a visible space between visible components" |
|
224 |
||
225 |
^ ignoreInvisibleComponents |
|
226 |
! |
|
227 |
||
228 |
ignoreInvisibleComponents:aBoolean |
|
229 |
"set/clears the flag which controls if invisible (unrealized) |
|
230 |
components should be ignored in the layout computation. |
|
231 |
By default, it is false, which means that invisible components will |
|
2006 | 232 |
lead to a visible space between visible components." |
1423 | 233 |
|
1605
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
234 |
(ignoreInvisibleComponents ~~ aBoolean) ifTrue:[ |
2006 | 235 |
aBoolean ifTrue:[ |
236 |
self makeMyselfDependentOnSubviews. |
|
237 |
]. |
|
1605
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
238 |
ignoreInvisibleComponents := aBoolean. |
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
239 |
self layoutChanged |
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
240 |
] |
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
241 |
|
6ddd87c04fd5
recompute layout when ignoreInvisible* is changed.
Claus Gittinger <cg@exept.de>
parents:
1604
diff
changeset
|
242 |
"Modified: / 20.7.1998 / 14:12:38 / cg" |
1423 | 243 |
! |
244 |
||
202 | 245 |
space:numberOfPixels |
246 |
"set the space between elements in pixels (default is 1mm) for both directions" |
|
247 |
||
248 |
(verticalSpace ~= numberOfPixels |
|
249 |
or:[horizontalSpace ~= numberOfPixels]) ifTrue:[ |
|
250 |
horizontalSpace := numberOfPixels. |
|
251 |
verticalSpace := numberOfPixels. |
|
252 |
self layoutChanged |
|
253 |
] |
|
254 |
! |
|
255 |
||
1036 | 256 |
verticalLayout |
257 |
"not supported by this view" |
|
258 |
||
259 |
^ nil |
|
260 |
! |
|
261 |
||
262 |
verticalLayout:aLayoutSymbol |
|
263 |
"not supported by this view" |
|
264 |
||
265 |
! |
|
266 |
||
1072 | 267 |
verticalSpace |
268 |
"return the vertical space between elements on pixels (default is 1mm)" |
|
269 |
||
270 |
^ verticalSpace |
|
271 |
! |
|
272 |
||
202 | 273 |
verticalSpace:numberOfPixels |
274 |
"set the vertical space between elements (in pixels). |
|
275 |
The default is computed for 1mm spacing." |
|
276 |
||
277 |
verticalSpace ~= numberOfPixels ifTrue:[ |
|
278 |
verticalSpace := numberOfPixels. |
|
279 |
self layoutChanged |
|
280 |
] |
|
281 |
! ! |
|
282 |
||
4415 | 283 |
!PanelView methodsFor:'accessing-channels'! |
284 |
||
285 |
backgroundChannel |
|
286 |
"return a valueHolder for background color" |
|
287 |
||
288 |
^ backgroundChannel |
|
289 |
||
290 |
"Modified: / 30.3.1999 / 13:49:28 / stefan" |
|
291 |
"Created: / 30.3.1999 / 13:50:55 / stefan" |
|
292 |
! |
|
293 |
||
294 |
backgroundChannel:aValueHolder |
|
295 |
"set the backgroundChannel - a valueHolder holding a color" |
|
296 |
||
297 |
|prev| |
|
298 |
||
299 |
prev := backgroundChannel. |
|
300 |
backgroundChannel := aValueHolder. |
|
301 |
self setupChannel:aValueHolder for:#backgroundColorChanged withOld:prev |
|
302 |
||
303 |
"Modified: / 31.10.1997 / 14:38:38 / cg" |
|
304 |
"Created: / 30.3.1999 / 13:48:42 / stefan" |
|
305 |
! ! |
|
306 |
||
202 | 307 |
!PanelView methodsFor:'adding & removing subviews'! |
308 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
309 |
addComponent:aComponent |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
310 |
"redefined to recompute layout when a component is added" |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
311 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
312 |
super addComponent:aComponent. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
313 |
self addedView:aComponent |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
314 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
315 |
"Created: 28.1.1997 / 17:44:18 / cg" |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
316 |
! |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
317 |
|
202 | 318 |
addSubView:aView |
319 |
"redefined to recompute layout when a subview is added" |
|
320 |
||
321 |
super addSubView:aView. |
|
322 |
self addedView:aView |
|
323 |
! |
|
324 |
||
4406 | 325 |
addSubView:newView after:aViewOrNil |
202 | 326 |
"redefined to recompute layout when a subview is added" |
327 |
||
4406 | 328 |
super addSubView:newView after:aViewOrNil. |
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
329 |
self addedView:newView |
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
330 |
|
4406 | 331 |
"Modified: / 15-07-1996 / 10:15:04 / cg" |
332 |
"Modified (format): / 22-03-2012 / 10:37:42 / cg" |
|
202 | 333 |
! |
334 |
||
4406 | 335 |
addSubView:newView before:aViewOrNil |
202 | 336 |
"redefined to recompute layout when a subview is added" |
337 |
||
4406 | 338 |
super addSubView:newView before:aViewOrNil. |
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
339 |
self addedView:newView |
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
340 |
|
4406 | 341 |
"Modified: / 15-07-1996 / 10:14:39 / cg" |
342 |
"Modified (format): / 22-03-2012 / 10:37:46 / cg" |
|
202 | 343 |
! |
344 |
||
345 |
removeSubView:aView |
|
346 |
"redefined to recompute layout when a subview is removed" |
|
347 |
||
348 |
super removeSubView:aView. |
|
349 |
aView removeDependent:self. |
|
350 |
self layoutChanged |
|
38 | 351 |
! ! |
0 | 352 |
|
1159 | 353 |
!PanelView methodsFor:'enumerating subviews'! |
354 |
||
355 |
changeSequenceOrderFor:aSubView to:anIndex |
|
3885 | 356 |
"change a subview's position in the subviews collection. |
357 |
This affects the arrangemnt of the views." |
|
358 |
||
1159 | 359 |
|success| |
360 |
||
361 |
success := super changeSequenceOrderFor:aSubView to:anIndex. |
|
362 |
||
363 |
success ifTrue:[ |
|
3885 | 364 |
self layoutChanged. |
1159 | 365 |
]. |
366 |
^ success |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
367 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
368 |
" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
369 |
|panel comp1 comp2 comp3| |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
370 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
371 |
panel := HorizontalPanelView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
372 |
comp1 := Label label:'one' in:panel. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
373 |
comp2 := Label label:'two' in:panel. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
374 |
comp3 := Label label:'three' in:panel. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
375 |
panel open. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
376 |
Delay waitForSeconds:3. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
377 |
panel changeSequenceOrderFor:comp2 to:3. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
378 |
Delay waitForSeconds:3. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
379 |
panel changeSequenceOrderFor:comp2 to:1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
380 |
" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
381 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
382 |
"Modified: / 17.1.1998 / 00:13:43 / cg" |
1159 | 383 |
! ! |
384 |
||
2753 | 385 |
!PanelView methodsFor:'event handling'! |
0 | 386 |
|
4415 | 387 |
backgroundColorChanged |
388 |
"called to update the background color" |
|
389 |
||
390 |
|color| |
|
391 |
||
392 |
color := backgroundChannel value. |
|
393 |
self backgroundColor:color. |
|
394 |
! |
|
395 |
||
0 | 396 |
sizeChanged:how |
119 | 397 |
"my size has changed - must rearrange elements" |
398 |
||
0 | 399 |
super sizeChanged:how. |
4945 | 400 |
"/ self layoutChanged - no; leads to recursion |
401 |
realized ifTrue:[ |
|
402 |
self setChildPositions |
|
403 |
] ifFalse:[ |
|
404 |
mustRearrange := true |
|
405 |
]. |
|
125 | 406 |
! |
407 |
||
408 |
update:something with:aParameter from:changedObject |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
409 |
"an element changed its size" |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
410 |
|
125 | 411 |
something == #sizeOfView ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
412 |
elementsChangeSize ifTrue:[ |
2034
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
413 |
self layoutChanged. |
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
414 |
]. |
2006 | 415 |
^ self |
416 |
]. |
|
2190 | 417 |
"/ something == #preferredExtent ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
418 |
"/ elementsChangeSize ifTrue:[ |
2190 | 419 |
"/ self layoutChanged. |
420 |
"/ ]. |
|
421 |
"/ ^ self |
|
422 |
"/ ]. |
|
2006 | 423 |
something == #visibility ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
424 |
ignoreInvisibleComponents ifTrue:[ |
2034
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
425 |
self layoutChanged. |
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
426 |
]. |
2006 | 427 |
^ self |
125 | 428 |
]. |
429 |
^ super update:something with:aParameter from:changedObject |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
430 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
431 |
"Modified: 28.1.1997 / 17:52:44 / cg" |
0 | 432 |
! ! |
433 |
||
1821
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
434 |
!PanelView methodsFor:'focus handling'! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
435 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
436 |
wantsFocusWithButtonPress |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
437 |
"no, do not catch the keyboard focus on button click" |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
438 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
439 |
^ false |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
440 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
441 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
442 |
! ! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
443 |
|
202 | 444 |
!PanelView methodsFor:'initialization'! |
445 |
||
446 |
initialize |
|
447 |
super initialize. |
|
448 |
||
449 |
hLayout := vLayout := #center. "/ notice, this is ignored in this class |
|
450 |
"/ used by subclasses only |
|
451 |
verticalSpace := ViewSpacing. |
|
452 |
horizontalSpace := ViewSpacing. |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
453 |
mustRearrange := elementsChangeSize := false. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
454 |
ignoreInvisibleComponents := true. |
202 | 455 |
! |
456 |
||
5516 | 457 |
mapped |
458 |
mustRearrange ifTrue:[ |
|
459 |
self setChildPositions |
|
460 |
]. |
|
461 |
super mapped |
|
462 |
! |
|
463 |
||
202 | 464 |
realize |
465 |
mustRearrange ifTrue:[ |
|
466 |
self setChildPositions |
|
467 |
]. |
|
468 |
super realize |
|
469 |
! |
|
470 |
||
1216
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
471 |
resize |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
472 |
super resize. |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
473 |
mustRearrange ifTrue:[ |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
474 |
self setChildPositions |
1216
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
475 |
]. |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
476 |
! |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
477 |
|
202 | 478 |
setChildPositionsIfChanged |
479 |
"set all of my child positions - this is usually delayed, |
|
480 |
until the panel is actually shown (since we dont know, if more |
|
481 |
elements are to be added) thus avoiding repositioning the elements |
|
482 |
over and over. However, sometimes it is nescessary, to force positioning |
|
483 |
the elements, for example, before querying the relative position of |
|
484 |
an element (modalBoxes do so, to position the ok-button under the mouse |
|
485 |
pointer)." |
|
486 |
||
487 |
mustRearrange ifTrue:[ |
|
488 |
self setChildPositions |
|
489 |
]. |
|
490 |
||
491 |
! ! |
|
492 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
493 |
!PanelView methodsFor:'layout'! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
494 |
|
3861 | 495 |
preferredExtent |
496 |
"return a good extent, one that makes subviews fit. |
|
497 |
Note that width is considered as given, and compute height here." |
|
498 |
||
499 |
|subViews xpos totalHeight maxHeightInRow first| |
|
500 |
||
501 |
"/ If I have an explicit preferredExtent.. |
|
502 |
explicitExtent notNil ifTrue:[ |
|
503 |
^ explicitExtent |
|
504 |
]. |
|
505 |
||
506 |
"/ If I have a cached preferredExtent value.. |
|
507 |
preferredExtent notNil ifTrue:[ |
|
508 |
^ preferredExtent |
|
509 |
]. |
|
510 |
||
511 |
subViews := self subViewsToConsider. |
|
512 |
subViews isEmptyOrNil ifTrue:[ |
|
513 |
^ super preferredExtent. |
|
514 |
]. |
|
515 |
||
516 |
xpos := horizontalSpace. |
|
517 |
||
518 |
totalHeight := 0. |
|
519 |
maxHeightInRow := 0. |
|
520 |
first := true. |
|
521 |
||
522 |
subViews do:[:eachChild | |childPreferredExtent| |
|
523 |
childPreferredExtent := eachChild preferredExtent. |
|
524 |
||
525 |
"go to next row, if this subview won't fit" |
|
526 |
first ifFalse: [ |
|
527 |
(xpos + childPreferredExtent x + horizontalSpace) > width |
|
528 |
ifTrue: [ |
|
529 |
xpos := horizontalSpace. |
|
530 |
totalHeight := totalHeight + maxHeightInRow + verticalSpace. |
|
531 |
maxHeightInRow := 0. |
|
532 |
] |
|
533 |
]. |
|
534 |
||
535 |
xpos := xpos + (childPreferredExtent x) + horizontalSpace. |
|
536 |
(maxHeightInRow < (childPreferredExtent y)) ifTrue:[ |
|
537 |
maxHeightInRow := childPreferredExtent y. |
|
538 |
]. |
|
539 |
first := false |
|
540 |
]. |
|
541 |
maxHeightInRow ~= 0 ifTrue:[ |
|
542 |
totalHeight := totalHeight + maxHeightInRow + verticalSpace. |
|
543 |
]. |
|
544 |
||
545 |
^ width @ totalHeight |
|
546 |
! |
|
547 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
548 |
setChildPositions |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
549 |
"(re)compute position of every child. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
550 |
This method is redefined for different layout characteristics - you may |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
551 |
even create subclasses with completely different geometry management." |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
552 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
553 |
|first xpos ypos maxHeightInRow thisRow subViews ext| |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
554 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
555 |
subViews := self subViewsToConsider. |
1423 | 556 |
subViews size == 0 ifTrue:[^ self]. |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
557 |
|
3501 | 558 |
"/ self extentChangedFlag ifTrue:[ |
559 |
"/ ext := self computeExtent. |
|
560 |
"/ width := ext x. |
|
561 |
"/ height := ext y. |
|
562 |
"/ ]. |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
563 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
564 |
xpos := horizontalSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
565 |
ypos := verticalSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
566 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
567 |
maxHeightInRow := 0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
568 |
first := true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
569 |
thisRow := OrderedCollection new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
570 |
subViews do:[:child | |
1423 | 571 |
"go to next row, if this subview won't fit" |
572 |
first ifFalse: [ |
|
573 |
(xpos + child widthIncludingBorder + horizontalSpace) > width |
|
574 |
ifTrue: [ |
|
575 |
thisRow notEmpty ifTrue:[ |
|
576 |
thisRow do:[:rowElement | |
|
577 |
rowElement heightIncludingBorder < maxHeightInRow ifTrue:[ |
|
578 |
rowElement top:(rowElement top + (maxHeightInRow - rowElement heightIncludingBorder)) |
|
579 |
] |
|
580 |
] |
|
581 |
]. |
|
582 |
ypos := ypos + verticalSpace + maxHeightInRow. |
|
583 |
xpos := horizontalSpace. |
|
584 |
maxHeightInRow := 0. |
|
585 |
thisRow := OrderedCollection new. |
|
586 |
] |
|
587 |
]. |
|
588 |
thisRow add:child. |
|
589 |
child origin:(xpos@ypos). |
|
590 |
xpos := xpos + (child widthIncludingBorder) + horizontalSpace. |
|
591 |
(maxHeightInRow < (child heightIncludingBorder)) ifTrue:[ |
|
592 |
maxHeightInRow := child heightIncludingBorder |
|
593 |
]. |
|
594 |
first := false |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
595 |
]. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
596 |
thisRow notEmpty ifTrue:[ |
1423 | 597 |
thisRow do:[:rowElement | |
598 |
rowElement heightIncludingBorder < maxHeightInRow ifTrue:[ |
|
599 |
rowElement top:(rowElement top + (maxHeightInRow - rowElement heightIncludingBorder)) |
|
600 |
] |
|
601 |
] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
602 |
]. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
603 |
mustRearrange := false |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
604 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
605 |
"Modified: / 17.1.1998 / 00:17:19 / cg" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
606 |
! ! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
607 |
|
0 | 608 |
!PanelView methodsFor:'private'! |
609 |
||
202 | 610 |
addedView:aView |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
611 |
"added a new element - rearrange components" |
202 | 612 |
|
2006 | 613 |
(elementsChangeSize or:[ignoreInvisibleComponents]) ifTrue:[ |
614 |
aView addDependent:self |
|
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
615 |
]. |
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
616 |
aView resize. |
788
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
617 |
"/ explicitExtent ~~ true ifTrue:[ |
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
618 |
"/ self resize |
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
619 |
"/ ]. |
202 | 620 |
self layoutChanged |
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
621 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
622 |
"Modified: 28.1.1997 / 17:45:10 / cg" |
202 | 623 |
! |
624 |
||
0 | 625 |
layoutChanged |
119 | 626 |
"called whenever repositioning is required. If the panel view is |
627 |
already visible, reposition elements right now. Otherwise, remember |
|
628 |
that a repositioning is needed to do so when the view eventually becomes |
|
629 |
visible." |
|
630 |
||
4945 | 631 |
super layoutChanged. |
2198 | 632 |
realized ifTrue:[ |
633 |
self setChildPositions |
|
0 | 634 |
] ifFalse:[ |
2198 | 635 |
mustRearrange := true |
4945 | 636 |
]. |
0 | 637 |
! |
638 |
||
2006 | 639 |
makeMyselfDependentOnSubviews |
2527 | 640 |
subViews notNil ifTrue:[ |
2006 | 641 |
subViews do:[:aView | |
642 |
aView addDependent:self |
|
643 |
] |
|
644 |
] |
|
645 |
! |
|
646 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
647 |
subViewsToConsider |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
648 |
"return a collection of subviews which are to be considered in |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
649 |
the layout. If ignoreInvisibleComponents is true, only visible |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
650 |
components are considered; otherwise, all are considered." |
0 | 651 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
652 |
|subViews| |
1042 | 653 |
|
654 |
subViews := self subViews. |
|
3779 | 655 |
ignoreInvisibleComponents ifTrue:[ |
656 |
subViews size ~~ 0 ifTrue:[ |
|
657 |
subViews := subViews |
|
658 |
select:[:v | realized |
|
659 |
ifTrue:[v realized] |
|
660 |
ifFalse:[v isHiddenOnRealize not] |
|
661 |
]. |
|
662 |
]. |
|
1042 | 663 |
]. |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
664 |
^ subViews |
1042 | 665 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
666 |
"Created: / 17.1.1998 / 00:17:05 / cg" |
0 | 667 |
! ! |
125 | 668 |
|
3863
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
669 |
!PanelView methodsFor:'queries'! |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
670 |
|
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
671 |
isLayoutWrapper |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
672 |
"answer true, if this view defines the layout of it's subviews" |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
673 |
|
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
674 |
^ true |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
675 |
! ! |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
676 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
677 |
!PanelView class methodsFor:'documentation'! |
205 | 678 |
|
679 |
version |
|
5516 | 680 |
^ '$Header$' |
205 | 681 |
! ! |
4945 | 682 |