author | Claus Gittinger <cg@exept.de> |
Mon, 23 Feb 2015 12:37:42 +0100 | |
changeset 5279 | 3af2da2c44e6 |
parent 4945 | b3a7feb93dd8 |
child 5516 | 6ac4f56c49f3 |
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. |
4945 | 398 |
"/ self layoutChanged - no; leads to recursion |
399 |
realized ifTrue:[ |
|
400 |
self setChildPositions |
|
401 |
] ifFalse:[ |
|
402 |
mustRearrange := true |
|
403 |
]. |
|
125 | 404 |
! |
405 |
||
406 |
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
|
407 |
"an element changed its size" |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
408 |
|
125 | 409 |
something == #sizeOfView ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
410 |
elementsChangeSize ifTrue:[ |
2034
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
411 |
self layoutChanged. |
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
412 |
]. |
2006 | 413 |
^ self |
414 |
]. |
|
2190 | 415 |
"/ something == #preferredExtent ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
416 |
"/ elementsChangeSize ifTrue:[ |
2190 | 417 |
"/ self layoutChanged. |
418 |
"/ ]. |
|
419 |
"/ ^ self |
|
420 |
"/ ]. |
|
2006 | 421 |
something == #visibility ifTrue:[ |
3117
6d0c7aa281f2
#elementsChangeSize: do nothing, if instance var doesn't change
Stefan Vogel <sv@exept.de>
parents:
2753
diff
changeset
|
422 |
ignoreInvisibleComponents ifTrue:[ |
2034
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
423 |
self layoutChanged. |
2efa727de60f
avoid useless work (ignore updates from changed components sometimes)
Claus Gittinger <cg@exept.de>
parents:
2006
diff
changeset
|
424 |
]. |
2006 | 425 |
^ self |
125 | 426 |
]. |
427 |
^ 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
|
428 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
429 |
"Modified: 28.1.1997 / 17:52:44 / cg" |
0 | 430 |
! ! |
431 |
||
1821
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
432 |
!PanelView methodsFor:'focus handling'! |
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 |
wantsFocusWithButtonPress |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
435 |
"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
|
436 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1605
diff
changeset
|
437 |
^ false |
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 |
|
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 |
|
202 | 442 |
!PanelView methodsFor:'initialization'! |
443 |
||
444 |
initialize |
|
445 |
super initialize. |
|
446 |
||
447 |
hLayout := vLayout := #center. "/ notice, this is ignored in this class |
|
448 |
"/ used by subclasses only |
|
449 |
verticalSpace := ViewSpacing. |
|
450 |
horizontalSpace := ViewSpacing. |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
451 |
mustRearrange := elementsChangeSize := false. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
452 |
ignoreInvisibleComponents := true. |
202 | 453 |
! |
454 |
||
455 |
realize |
|
456 |
mustRearrange ifTrue:[ |
|
457 |
self setChildPositions |
|
458 |
]. |
|
459 |
super realize |
|
460 |
! |
|
461 |
||
1216
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
462 |
resize |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
463 |
super resize. |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
464 |
mustRearrange ifTrue:[ |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
465 |
self setChildPositions |
1216
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
466 |
]. |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
467 |
! |
3506a6474c42
setChildPos if extent is set in create->resize->prefExtent
ca
parents:
1159
diff
changeset
|
468 |
|
202 | 469 |
setChildPositionsIfChanged |
470 |
"set all of my child positions - this is usually delayed, |
|
471 |
until the panel is actually shown (since we dont know, if more |
|
472 |
elements are to be added) thus avoiding repositioning the elements |
|
473 |
over and over. However, sometimes it is nescessary, to force positioning |
|
474 |
the elements, for example, before querying the relative position of |
|
475 |
an element (modalBoxes do so, to position the ok-button under the mouse |
|
476 |
pointer)." |
|
477 |
||
478 |
mustRearrange ifTrue:[ |
|
479 |
self setChildPositions |
|
480 |
]. |
|
481 |
||
482 |
! ! |
|
483 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
484 |
!PanelView methodsFor:'layout'! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
485 |
|
3861 | 486 |
preferredExtent |
487 |
"return a good extent, one that makes subviews fit. |
|
488 |
Note that width is considered as given, and compute height here." |
|
489 |
||
490 |
|subViews xpos totalHeight maxHeightInRow first| |
|
491 |
||
492 |
"/ If I have an explicit preferredExtent.. |
|
493 |
explicitExtent notNil ifTrue:[ |
|
494 |
^ explicitExtent |
|
495 |
]. |
|
496 |
||
497 |
"/ If I have a cached preferredExtent value.. |
|
498 |
preferredExtent notNil ifTrue:[ |
|
499 |
^ preferredExtent |
|
500 |
]. |
|
501 |
||
502 |
subViews := self subViewsToConsider. |
|
503 |
subViews isEmptyOrNil ifTrue:[ |
|
504 |
^ super preferredExtent. |
|
505 |
]. |
|
506 |
||
507 |
xpos := horizontalSpace. |
|
508 |
||
509 |
totalHeight := 0. |
|
510 |
maxHeightInRow := 0. |
|
511 |
first := true. |
|
512 |
||
513 |
subViews do:[:eachChild | |childPreferredExtent| |
|
514 |
childPreferredExtent := eachChild preferredExtent. |
|
515 |
||
516 |
"go to next row, if this subview won't fit" |
|
517 |
first ifFalse: [ |
|
518 |
(xpos + childPreferredExtent x + horizontalSpace) > width |
|
519 |
ifTrue: [ |
|
520 |
xpos := horizontalSpace. |
|
521 |
totalHeight := totalHeight + maxHeightInRow + verticalSpace. |
|
522 |
maxHeightInRow := 0. |
|
523 |
] |
|
524 |
]. |
|
525 |
||
526 |
xpos := xpos + (childPreferredExtent x) + horizontalSpace. |
|
527 |
(maxHeightInRow < (childPreferredExtent y)) ifTrue:[ |
|
528 |
maxHeightInRow := childPreferredExtent y. |
|
529 |
]. |
|
530 |
first := false |
|
531 |
]. |
|
532 |
maxHeightInRow ~= 0 ifTrue:[ |
|
533 |
totalHeight := totalHeight + maxHeightInRow + verticalSpace. |
|
534 |
]. |
|
535 |
||
536 |
^ width @ totalHeight |
|
537 |
! |
|
538 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
539 |
setChildPositions |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
540 |
"(re)compute position of every child. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
541 |
This method is redefined for different layout characteristics - you may |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
542 |
even create subclasses with completely different geometry management." |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
543 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
544 |
|first xpos ypos maxHeightInRow thisRow subViews ext| |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
545 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
546 |
subViews := self subViewsToConsider. |
1423 | 547 |
subViews size == 0 ifTrue:[^ self]. |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
548 |
|
3501 | 549 |
"/ self extentChangedFlag ifTrue:[ |
550 |
"/ ext := self computeExtent. |
|
551 |
"/ width := ext x. |
|
552 |
"/ height := ext y. |
|
553 |
"/ ]. |
|
1418
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 |
xpos := horizontalSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
556 |
ypos := verticalSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
557 |
|
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
558 |
maxHeightInRow := 0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
559 |
first := true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
560 |
thisRow := OrderedCollection new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
561 |
subViews do:[:child | |
1423 | 562 |
"go to next row, if this subview won't fit" |
563 |
first ifFalse: [ |
|
564 |
(xpos + child widthIncludingBorder + horizontalSpace) > width |
|
565 |
ifTrue: [ |
|
566 |
thisRow notEmpty ifTrue:[ |
|
567 |
thisRow do:[:rowElement | |
|
568 |
rowElement heightIncludingBorder < maxHeightInRow ifTrue:[ |
|
569 |
rowElement top:(rowElement top + (maxHeightInRow - rowElement heightIncludingBorder)) |
|
570 |
] |
|
571 |
] |
|
572 |
]. |
|
573 |
ypos := ypos + verticalSpace + maxHeightInRow. |
|
574 |
xpos := horizontalSpace. |
|
575 |
maxHeightInRow := 0. |
|
576 |
thisRow := OrderedCollection new. |
|
577 |
] |
|
578 |
]. |
|
579 |
thisRow add:child. |
|
580 |
child origin:(xpos@ypos). |
|
581 |
xpos := xpos + (child widthIncludingBorder) + horizontalSpace. |
|
582 |
(maxHeightInRow < (child heightIncludingBorder)) ifTrue:[ |
|
583 |
maxHeightInRow := child heightIncludingBorder |
|
584 |
]. |
|
585 |
first := false |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
586 |
]. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
587 |
thisRow notEmpty ifTrue:[ |
1423 | 588 |
thisRow do:[:rowElement | |
589 |
rowElement heightIncludingBorder < maxHeightInRow ifTrue:[ |
|
590 |
rowElement top:(rowElement top + (maxHeightInRow - rowElement heightIncludingBorder)) |
|
591 |
] |
|
592 |
] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
593 |
]. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
594 |
mustRearrange := false |
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 |
"Modified: / 17.1.1998 / 00:17:19 / cg" |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
597 |
! ! |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
598 |
|
0 | 599 |
!PanelView methodsFor:'private'! |
600 |
||
202 | 601 |
addedView:aView |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
602 |
"added a new element - rearrange components" |
202 | 603 |
|
2006 | 604 |
(elementsChangeSize or:[ignoreInvisibleComponents]) ifTrue:[ |
605 |
aView addDependent:self |
|
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
606 |
]. |
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
607 |
aView resize. |
788
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
608 |
"/ explicitExtent ~~ true ifTrue:[ |
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
609 |
"/ self resize |
653fd742b5b0
extent handling when adding views
Claus Gittinger <cg@exept.de>
parents:
787
diff
changeset
|
610 |
"/ ]. |
202 | 611 |
self layoutChanged |
787
c568dfd06f11
recompute & resize to the preferredExtent when views are added
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
612 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
613 |
"Modified: 28.1.1997 / 17:45:10 / cg" |
202 | 614 |
! |
615 |
||
0 | 616 |
layoutChanged |
119 | 617 |
"called whenever repositioning is required. If the panel view is |
618 |
already visible, reposition elements right now. Otherwise, remember |
|
619 |
that a repositioning is needed to do so when the view eventually becomes |
|
620 |
visible." |
|
621 |
||
4945 | 622 |
super layoutChanged. |
2198 | 623 |
realized ifTrue:[ |
624 |
self setChildPositions |
|
0 | 625 |
] ifFalse:[ |
2198 | 626 |
mustRearrange := true |
4945 | 627 |
]. |
0 | 628 |
! |
629 |
||
2006 | 630 |
makeMyselfDependentOnSubviews |
2527 | 631 |
subViews notNil ifTrue:[ |
2006 | 632 |
subViews do:[:aView | |
633 |
aView addDependent:self |
|
634 |
] |
|
635 |
] |
|
636 |
! |
|
637 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
638 |
subViewsToConsider |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
639 |
"return a collection of subviews which are to be considered in |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
640 |
the layout. If ignoreInvisibleComponents is true, only visible |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
641 |
components are considered; otherwise, all are considered." |
0 | 642 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
643 |
|subViews| |
1042 | 644 |
|
645 |
subViews := self subViews. |
|
3779 | 646 |
ignoreInvisibleComponents ifTrue:[ |
647 |
subViews size ~~ 0 ifTrue:[ |
|
648 |
subViews := subViews |
|
649 |
select:[:v | realized |
|
650 |
ifTrue:[v realized] |
|
651 |
ifFalse:[v isHiddenOnRealize not] |
|
652 |
]. |
|
653 |
]. |
|
1042 | 654 |
]. |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
655 |
^ subViews |
1042 | 656 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1216
diff
changeset
|
657 |
"Created: / 17.1.1998 / 00:17:05 / cg" |
0 | 658 |
! ! |
125 | 659 |
|
3863
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
660 |
!PanelView methodsFor:'queries'! |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
661 |
|
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
662 |
isLayoutWrapper |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
663 |
"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
|
664 |
|
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
665 |
^ true |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
666 |
! ! |
eceb130bb92b
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3861
diff
changeset
|
667 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
788
diff
changeset
|
668 |
!PanelView class methodsFor:'documentation'! |
205 | 669 |
|
670 |
version |
|
4945 | 671 |
^ '$Header: /cvs/stx/stx/libwidg/PanelView.st,v 1.47 2014-03-16 21:25:09 cg Exp $' |
205 | 672 |
! ! |
4945 | 673 |