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