author | Claus Gittinger <cg@exept.de> |
Tue, 24 Feb 2015 16:46:36 +0100 | |
changeset 5282 | 382e6cfb447d |
parent 5227 | 94ce4ed2f106 |
child 5424 | 21b7fbdf7e5a |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2305
f2850e54b0ab
only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents:
2099
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
f2850e54b0ab
only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents:
2099
diff
changeset
|
13 |
|
0 | 14 |
PanelView subclass:#HorizontalPanelView |
2039
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
15 |
instanceVariableNames:'reverseOrderIfOKAtLeft' |
340
f820bcd29a51
defaultExtent with rightSpace forgot about spacing
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
16 |
classVariableNames:'' |
f820bcd29a51
defaultExtent with rightSpace forgot about spacing
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
17 |
poolDictionaries:'' |
f820bcd29a51
defaultExtent with rightSpace forgot about spacing
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
18 |
category:'Views-Layout' |
0 | 19 |
! |
20 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
21 |
!HorizontalPanelView class methodsFor:'documentation'! |
38 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
59 | 26 |
All Rights Reserved |
38 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
a View which arranges its child-views in a horizontal row. |
|
40 |
All real work is done in PanelView - only the layout computation is |
|
41 |
redefined here. |
|
42 |
||
77 | 43 |
The layout is controlled the instance variables: |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
44 |
horizontalLayout and verticalLayout |
127 | 45 |
in addition to |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
46 |
horizontalSpace and verticalSpace. |
77 | 47 |
|
133 | 48 |
HorizontalSpace and verticalSpace control the spacing between elements; |
49 |
they default to some 1mm. |
|
50 |
||
62 | 51 |
The horizontal layout can be any of: |
52 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
53 |
#left arrange elements at left |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
54 |
#leftSpace arrange elements at the left, start with spacing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
55 |
#fixLeft same as #left, but do not reduce spacing in case of no fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
56 |
#fixLeftSpace same as #leftSpace, but do not reduce spacing in case of no fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
57 |
#right arrange elements at the right |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
58 |
#rightSpace arrange elements at the right, start with spacing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
59 |
#center arrange elements in the center |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
60 |
#spread spread elements evenly |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
61 |
#spreadSpace spread elements evenly with spacing at the ends |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
62 |
#fit like #spread, but resize elements for tight packing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
63 |
#fitSpace like #fit, with additional spacing at the far ends |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
64 |
#leftFit like #left, but extend the last (rightMost) element to the right |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
65 |
#leftSpaceFit like #leftSpace, but extend the last (rightMost) element to the right |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
66 |
#rightFit like #right, but extend the first (leftMost) element to the left |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
67 |
#rightSpaceFit like #rightSpace, but extend the first (leftMost) element to the left |
133 | 68 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
69 |
#leftMax like corresponding non-Max layouts, |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
70 |
#leftSpaceMax but resize all components to width of widest components |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
71 |
#rightMax |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
72 |
#rightSpaceMax |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
73 |
#centerMax |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
74 |
#spreadMax |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
75 |
#spreadSpaceMax |
62 | 76 |
|
77 |
the vertical layout can be: |
|
78 |
||
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
79 |
#top place element at the top |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
80 |
#topSpace place element at the top, offset by verticalSpace |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
81 |
#center place it horizontally centered |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
82 |
#bottom place it at the bottom |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
83 |
#bottomSpace place it at the bottom, offset by verticalSpace |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
84 |
#fit resize elements vertically to fit this panel |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
85 |
#fitSpace like #fit, but with spacing |
133 | 86 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
87 |
#topMax like #top, but resize all views vertically to max height |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
88 |
#topSpaceMax like #topSpace, but resize all views vertically to max height |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
89 |
#bottomMax like #bottom, but resize all views vertically to max height |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
90 |
#bottomSpaceMax like #bottomSpace, but resize all views vertically to max height |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
91 |
#centerMax like #center, but resize all views vertically to max height |
62 | 92 |
|
77 | 93 |
The defaults is #center for both directions. |
62 | 94 |
The layout is changed by the messages #verticalLayout: and #horizontalLayout:. |
95 |
For backward compatibility (to times, where only hLayout existed), the simple |
|
133 | 96 |
#layout: does the same as #horizontalLayout:. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
97 |
Do not use this old method; it will vanish and currently outputs a warning. |
77 | 98 |
|
127 | 99 |
The panel assumes, that the elements do not resize themselfes, after it |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
100 |
became visible. This is not true for all widgets (buttons, labels or |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
101 |
inputFields may like to change). |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
102 |
If you have changing elements, tell this to the panel |
127 | 103 |
with 'aPanel elementsChangeSize:true'. In that case, the panel will react |
133 | 104 |
to size changes of its elements, and reorganize things. |
127 | 105 |
|
118 | 106 |
By combining Horizontal- and VerticalPanels (i.e. place a hPanel into a |
107 |
vPanel), most layouts should be implementable. |
|
133 | 108 |
However, iff none of these layout/space combinations is exactly what you need |
118 | 109 |
in your application, create a subclass, and redefine the setChildPositions |
110 |
method there. |
|
125 | 111 |
|
112 |
TODO: for completeness, support #fixRight, #fixRightSpace, |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
113 |
#rightFit, #rightSpaceFit layouts |
127 | 114 |
|
115 |
CAVEAT: this class started with #left and no vertical alignments; |
|
133 | 116 |
as time went by, more layouts were added (by users requests) |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
117 |
and now, many layout combinations are possible. |
133 | 118 |
Reflecting this, the setup should be changed to use different selectors |
119 |
for space-on/off, max-resize and alignment |
|
127 | 120 |
(i.e. having more and more layout symbols makes things a bit confusing ...) |
585 | 121 |
|
122 |
[see also:] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
123 |
VerticalPanelView |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
124 |
VariableVerticalPanel VariableHorizontalPanel |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
125 |
Label |
585 | 126 |
|
127 |
[author:] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
128 |
Claus Gittinger |
585 | 129 |
|
130 |
[author:] |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
131 |
Claus Gittinger |
62 | 132 |
" |
133 |
! |
|
134 |
||
135 |
examples |
|
136 |
" |
|
77 | 137 |
These examples show the effect of various horizontalLayout and |
138 |
verticalLayout settings. Try them all. Especially, notice the |
|
139 |
differences between the xxx and xxxSpace layouts and the effect of |
|
140 |
setting different values for the spacing. |
|
141 |
Try resizing the view and see how the elements get rearranged. |
|
142 |
||
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
143 |
Most of the examples below place 3 buttons onto a panel; |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
144 |
Of course, you can put any other view into a panel ... the last examples show this. |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
145 |
(The fit layouts are especially useful to be used with SelectionInListViews; |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
146 |
you can combine multiple labels & editFields with a selectionInListView, which |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
147 |
is expanded to fill the remaining area of the view) |
77 | 148 |
|
127 | 149 |
example: default layout (center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
150 |
centers components |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
151 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
152 |
|v p b1 b2 b3| |
38 | 153 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
154 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
155 |
v label:'default: center'. |
77 | 156 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
157 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
158 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
159 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
160 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
161 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
162 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
163 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
164 |
[exEnd] |
38 | 165 |
|
0 | 166 |
|
133 | 167 |
example: same (default center layout) with different sized elements |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
168 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
169 |
|v p b1 b2 b3| |
133 | 170 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
171 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
172 |
v label:'default: center'. |
133 | 173 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
174 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
175 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
176 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
177 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
178 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
179 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
180 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
181 |
[exEnd] |
133 | 182 |
|
183 |
||
184 |
example: horizontal default (center); vertical centerMax |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
185 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
186 |
|v p b1 b2 b3| |
133 | 187 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
188 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
189 |
v label:'vL=centerMax'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
190 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
191 |
p verticalLayout:#centerMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
192 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
193 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
194 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
195 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
196 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
197 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
198 |
[exEnd] |
133 | 199 |
|
200 |
||
201 |
example: horizontal default (center); vertical topMax |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
202 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
203 |
|v p b1 b2 b3| |
133 | 204 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
205 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
206 |
v label:'vL=topMax'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
207 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
208 |
p verticalLayout:#topMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
209 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
210 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
211 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
212 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
213 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
214 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
215 |
[exEnd] |
133 | 216 |
|
217 |
||
218 |
example: horizontal default (center); vertical topSpaceMax |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
219 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
220 |
|v p b1 b2 b3| |
133 | 221 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
222 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
223 |
v label:'vL=topSpaceMax'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
224 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
225 |
p verticalLayout:#topSpaceMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
226 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
227 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
228 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
229 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
230 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
231 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
232 |
[exEnd] |
133 | 233 |
|
234 |
||
235 |
example: horizontal default (center); vertical bottomMax |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
236 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
237 |
|v p b1 b2 b3| |
133 | 238 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
239 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
240 |
v label:'vL=bottomMax'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
241 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
242 |
p verticalLayout:#bottomMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
243 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
244 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
245 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
246 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
247 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
248 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
249 |
[exEnd] |
133 | 250 |
|
251 |
||
252 |
example: horizontal default (center); vertical bottomSpaceMax |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
253 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
254 |
|v p b1 b2 b3| |
133 | 255 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
256 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
257 |
v label:'vL=bottomSpaceMax'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
258 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
259 |
p verticalLayout:#bottomSpaceMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
260 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
261 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
262 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
263 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
264 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
265 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
266 |
[exEnd] |
133 | 267 |
|
268 |
||
127 | 269 |
example: left-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
270 |
fills left-to-right; no spacing before leftMost component |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
271 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
272 |
|v p b1 b2 b3| |
38 | 273 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
274 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
275 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
276 |
v label:'hL=left; vL=default (center)'. |
77 | 277 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
278 |
p horizontalLayout:#left. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
279 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
280 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
281 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
282 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
283 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
284 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
285 |
[exEnd] |
38 | 286 |
|
287 |
||
127 | 288 |
example: left starting with spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
289 |
fills left-to-right; spacing before leftMost component |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
290 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
291 |
|v p b1 b2 b3| |
77 | 292 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
293 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
294 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
295 |
v label:'hL=leftSpace; vL=center'. |
77 | 296 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
297 |
p horizontalLayout:#leftSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
298 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
299 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
300 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
301 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
302 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
303 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
304 |
[exEnd] |
77 | 305 |
|
306 |
||
127 | 307 |
example: leftFit-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
308 |
fills left-to-right; resizes the rightMost component to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
309 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
310 |
|v p b1 b2 b3| |
0 | 311 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
312 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
313 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
314 |
v label:'hL=leftFit; vL=center'. |
77 | 315 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
316 |
p horizontalLayout:#leftFit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
317 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
318 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
319 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
320 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
321 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
322 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
323 |
[exEnd] |
77 | 324 |
|
325 |
||
127 | 326 |
example: leftSpaceFit-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
327 |
fills left-to-right; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
328 |
starts with spacing & resizes the rightMost component to fit with spacing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
329 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
330 |
|v p b1 b2 b3| |
77 | 331 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
332 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
333 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
334 |
v label:'hL=leftSpaceFit; vL=center'. |
77 | 335 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
336 |
p horizontalLayout:#leftSpaceFit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
337 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
338 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
339 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
340 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
341 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
342 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
343 |
[exEnd] |
77 | 344 |
|
345 |
||
127 | 346 |
example: right-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
347 |
right-to-left |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
348 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
349 |
|v p b1 b2 b3| |
77 | 350 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
351 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
352 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
353 |
v label:'hL=right; vL=center'. |
77 | 354 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
355 |
p horizontalLayout:#right. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
356 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
357 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
358 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
359 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
360 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
361 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
362 |
[exEnd] |
38 | 363 |
|
364 |
||
127 | 365 |
example: right with initial spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
366 |
right-to-left with spacing after last component |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
367 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
368 |
|v p b1 b2 b3| |
77 | 369 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
370 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
371 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
372 |
v label:'hL=rightSpace; vL=center'. |
77 | 373 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
374 |
p horizontalLayout:#rightSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
375 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
376 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
377 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
378 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
379 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
380 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
381 |
[exEnd] |
77 | 382 |
|
383 |
||
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
384 |
example: rightFit-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
385 |
right-to-left; resize the leftMost component to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
386 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
387 |
|v p b1 b2 b3| |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
388 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
389 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
390 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
391 |
v label:'hL=rightFit; vL=center'. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
392 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
393 |
p horizontalLayout:#rightFit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
394 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
395 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
396 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
397 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
398 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
399 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
400 |
[exEnd] |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
401 |
|
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
402 |
|
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
403 |
example: rightSpaceFit with initial spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
404 |
right-to-left; start with spacing & resize the leftMost to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
405 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
406 |
|v p b1 b2 b3| |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
407 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
408 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
409 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
410 |
v label:'hL=rightSpaceFit; vL=center'. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
411 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
412 |
p horizontalLayout:#rightSpaceFit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
413 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
414 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
415 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
416 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
417 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
418 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
419 |
[exEnd] |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
420 |
|
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
421 |
|
127 | 422 |
example: fit-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
423 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
424 |
|v p b1 b2 b3| |
38 | 425 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
426 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
427 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
428 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
429 |
v label:'hL=fit; vL=center'. |
38 | 430 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
431 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
432 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
433 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
434 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
435 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
436 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
437 |
[exEnd] |
77 | 438 |
|
439 |
||
127 | 440 |
example: full fit i.e. no spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
441 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
442 |
|v p b1 b2 b3| |
77 | 443 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
444 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
445 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
446 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
447 |
p horizontalSpace:0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
448 |
v label:'hL=fit hS=0; vL=center'. |
77 | 449 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
450 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
451 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
452 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
453 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
454 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
455 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
456 |
[exEnd] |
77 | 457 |
|
458 |
||
127 | 459 |
example: fit with spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
460 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
461 |
|v p b1 b2 b3| |
77 | 462 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
463 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
464 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
465 |
v label:'hL=fitSpace; vL=center'. |
77 | 466 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
467 |
p horizontalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
468 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
469 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
470 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
471 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
472 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
473 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
474 |
[exEnd] |
62 | 475 |
|
77 | 476 |
|
127 | 477 |
example: spread-layout (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
478 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
479 |
|v p b1 b2 b3| |
77 | 480 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
481 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
482 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
483 |
p horizontalLayout:#spread. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
484 |
v label:'hL=spread; vL=center'. |
77 | 485 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
486 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
487 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
488 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
489 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
490 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
491 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
492 |
[exEnd] |
77 | 493 |
|
494 |
||
127 | 495 |
example: spread with spacing (vertical is default -> center) |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
496 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
497 |
|v p b1 b2 b3| |
77 | 498 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
499 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
500 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
501 |
v label:'hL=spreadSpace; vL=center'. |
77 | 502 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
503 |
p horizontalLayout:#spreadSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
504 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
505 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
506 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
507 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
508 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
509 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
510 |
[exEnd] |
77 | 511 |
|
512 |
||
513 |
example: spread with spacing; vertical fit |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
514 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
515 |
|v p b1 b2 b3| |
77 | 516 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
517 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
518 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
519 |
v label:'hL=spreadSpace; vL=fit'. |
77 | 520 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
521 |
p horizontalLayout:#spreadSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
522 |
p verticalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
523 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
524 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
525 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
526 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
527 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
528 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
529 |
[exEnd] |
77 | 530 |
|
531 |
||
532 |
example: spread with spacing; vertical fit with spacing |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
533 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
534 |
|v p b1 b2 b3| |
77 | 535 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
536 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
537 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
538 |
v label:'hL=spreadSpace; vL=fitSpace'. |
77 | 539 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
540 |
p horizontalLayout:#spreadSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
541 |
p verticalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
542 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
543 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
544 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
545 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
546 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
547 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
548 |
[exEnd] |
77 | 549 |
|
550 |
||
62 | 551 |
example: fit - top |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
552 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
553 |
|v p b1 b2 b3| |
62 | 554 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
555 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
556 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
557 |
v label:'hL=fit; vL=top'. |
77 | 558 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
559 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
560 |
p verticalLayout:#top. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
561 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
562 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
563 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
564 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
565 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
566 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
567 |
[exEnd] |
62 | 568 |
|
77 | 569 |
|
570 |
example: fit with initial spacing |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
571 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
572 |
|v p b1 b2 b3| |
77 | 573 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
574 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
575 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
576 |
v label:'hL=fitSpace; vL=top'. |
77 | 577 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
578 |
p horizontalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
579 |
p verticalLayout:#top. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
580 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
581 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
582 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
583 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
584 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
585 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
586 |
[exEnd] |
77 | 587 |
|
588 |
||
589 |
example: fit with initial spacing in both directions |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
590 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
591 |
|v p b1 b2 b3| |
77 | 592 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
593 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
594 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
595 |
v label:'hL=fitSpace; vL=fitSpace'. |
77 | 596 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
597 |
p horizontalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
598 |
p verticalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
599 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
600 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
601 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
602 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
603 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
604 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
605 |
[exEnd] |
77 | 606 |
|
607 |
||
608 |
example: fit without spacing in both directions |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
609 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
610 |
|v p b1 b2 b3| |
77 | 611 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
612 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
613 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
614 |
v label:'hL=fit hS=0; vL=fit'. |
77 | 615 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
616 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
617 |
p verticalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
618 |
p horizontalSpace:0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
619 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
620 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
621 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
622 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
623 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
624 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
625 |
[exEnd] |
77 | 626 |
|
627 |
||
628 |
example: fit with initial spacing; top with spacing |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
629 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
630 |
|v p b1 b2 b3| |
77 | 631 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
632 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
633 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
634 |
v label:'hL=fitSpace; vL=topSpace'. |
77 | 635 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
636 |
p horizontalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
637 |
p verticalLayout:#topSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
638 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
639 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
640 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
641 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
642 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
643 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
644 |
[exEnd] |
77 | 645 |
|
646 |
||
62 | 647 |
example: fit - top without spacing |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
648 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
649 |
|v p b1 b2 b3| |
62 | 650 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
651 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
652 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
653 |
v label:'hL=fit; vL=top'. |
77 | 654 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
655 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
656 |
p verticalLayout:#top. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
657 |
p horizontalSpace:0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
658 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
659 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
660 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
661 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
662 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
663 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
664 |
[exEnd] |
62 | 665 |
|
77 | 666 |
|
62 | 667 |
example: fit - bottom with spacing and bottomSpace |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
668 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
669 |
|v p b1 b2 b3| |
62 | 670 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
671 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
672 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
673 |
v label:'hL=fitSpace; vL=bottomSpace'. |
77 | 674 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
675 |
p horizontalLayout:#fitSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
676 |
p verticalLayout:#bottomSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
677 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
678 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
679 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
680 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
681 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
682 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
683 |
[exEnd] |
62 | 684 |
|
77 | 685 |
|
62 | 686 |
example: fit no horizontal space - bottom with spacing and bottomSpace |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
687 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
688 |
|v p b1 b2 b3| |
62 | 689 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
690 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
691 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
692 |
v label:'hL=fit; vL=bottomSpace'. |
77 | 693 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
694 |
p horizontalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
695 |
p verticalLayout:#bottomSpace. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
696 |
p horizontalSpace:0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
697 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
698 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
699 |
b2 := Button label:'button2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
700 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
701 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
702 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
703 |
[exEnd] |
77 | 704 |
|
133 | 705 |
example: leftMax - vertical default |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
706 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
707 |
|v p b1 b2 b3| |
133 | 708 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
709 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
710 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
711 |
v label:'hL=leftMax; vL=default'. |
133 | 712 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
713 |
p horizontalLayout:#leftMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
714 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
715 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
716 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
717 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
718 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
719 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
720 |
[exEnd] |
133 | 721 |
|
722 |
||
723 |
example: leftSpaceMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
724 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
725 |
|v p b1 b2 b3| |
133 | 726 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
727 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
728 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
729 |
v label:'hL=leftSpaceMax; vL=default'. |
133 | 730 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
731 |
p horizontalLayout:#leftSpaceMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
732 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
733 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
734 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
735 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
736 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
737 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
738 |
[exEnd] |
133 | 739 |
|
740 |
||
741 |
example: rightMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
742 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
743 |
|v p b1 b2 b3| |
133 | 744 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
745 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
746 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
747 |
v label:'hL=rightMax; vL=default'. |
133 | 748 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
749 |
p horizontalLayout:#rightMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
750 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
751 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
752 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
753 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
754 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
755 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
756 |
[exEnd] |
133 | 757 |
|
758 |
||
759 |
example: rightSpaceMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
760 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
761 |
|v p b1 b2 b3| |
133 | 762 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
763 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
764 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
765 |
v label:'hL=rightSpaceMax; vL=default'. |
133 | 766 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
767 |
p horizontalLayout:#rightSpaceMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
768 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
769 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
770 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
771 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
772 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
773 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
774 |
[exEnd] |
133 | 775 |
|
776 |
||
777 |
example: centerMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
778 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
779 |
|v p b1 b2 b3| |
133 | 780 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
781 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
782 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
783 |
v label:'hL=centerMax; vL=default'. |
133 | 784 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
785 |
p horizontalLayout:#centerMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
786 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
787 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
788 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
789 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
790 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
791 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
792 |
[exEnd] |
133 | 793 |
|
794 |
||
795 |
example: spreadMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
796 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
797 |
|v p b1 b2 b3| |
133 | 798 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
799 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
800 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
801 |
v label:'hL=spreadMax; vL=default'. |
133 | 802 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
803 |
p horizontalLayout:#spreadMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
804 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
805 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
806 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
807 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
808 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
809 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
810 |
[exEnd] |
133 | 811 |
|
812 |
||
813 |
example: spreadSpaceMax - vertical default |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
814 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
815 |
|v p b1 b2 b3| |
133 | 816 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
817 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
818 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
819 |
v label:'hL=spreadSpaceMax; vL=default'. |
133 | 820 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
821 |
p horizontalLayout:#spreadSpaceMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
822 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
823 |
b1 := Button label:'button1' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
824 |
b2 := Button label:'b2' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
825 |
b3 := Button label:'but3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
826 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
827 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
828 |
[exEnd] |
133 | 829 |
|
830 |
||
831 |
example: maximize elements in both directions and center |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
832 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
833 |
|v p b1 b2 b3| |
133 | 834 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
835 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
836 |
v label:'hL=centerMax; vL=centerMax'. |
133 | 837 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
838 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
839 |
p horizontalLayout:#centerMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
840 |
p verticalLayout:#centerMax. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
841 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
842 |
b1 := Button label:'but1' in:p. b1 font:(b1 font size:8). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
843 |
b2 := Button label:'b2' in:p. b2 font:(b1 font size:24). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
844 |
b3 := Button label:'button3' in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
845 |
v extent:300 @ 100. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
846 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
847 |
[exEnd] |
133 | 848 |
|
849 |
||
118 | 850 |
example: placing hPanels into a vPanel |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
851 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
852 |
|v vP hP1 hP2 hP3 b1 b2 b3 b4 b5 b6 b7 b8 b9| |
118 | 853 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
854 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
855 |
vP := VerticalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
856 |
vP origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
857 |
vP verticalLayout:#fit; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
858 |
verticalSpace:0; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
859 |
horizontalLayout:#fit. |
118 | 860 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
861 |
hP1 := HorizontalPanelView in:vP. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
862 |
hP1 horizontalLayout:#fitSpace; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
863 |
verticalLayout:#center. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
864 |
b1 := Button label:'button1' in:hP1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
865 |
b2 := Button label:'button2' in:hP1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
866 |
b3 := Button label:'button3' in:hP1. |
118 | 867 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
868 |
hP2 := HorizontalPanelView in:vP. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
869 |
hP2 horizontalLayout:#fitSpace; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
870 |
verticalLayout:#center. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
871 |
b4 := Button label:'button4' in:hP2. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
872 |
b5 := Button label:'button5' in:hP2. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
873 |
b6 := Button label:'button6' in:hP2. |
118 | 874 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
875 |
hP3 := HorizontalPanelView in:vP. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
876 |
hP3 horizontalLayout:#fitSpace; |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
877 |
verticalLayout:#center. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
878 |
b7 := Button label:'button7' in:hP3. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
879 |
b8 := Button label:'button8' in:hP3. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
880 |
b9 := Button label:'button9' in:hP3. |
118 | 881 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
882 |
v extent:300 @ 300. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
883 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
884 |
[exEnd] |
118 | 885 |
|
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
886 |
example: a browser like table, the two left tables have a fix width, |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
887 |
while the rightmost list extends to the far right. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
888 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
889 |
|v p l1 l2 l3| |
77 | 890 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
891 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
892 |
p := HorizontalPanelView in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
893 |
v label:'hL=leftFit hS=0; vL=fit'. |
77 | 894 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
895 |
p horizontalLayout:#leftFit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
896 |
p horizontalSpace:0. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
897 |
p verticalLayout:#fit. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
898 |
p origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
77 | 899 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
900 |
l1 := ScrollableView for:FileSelectionList in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
901 |
l1 stayInDirectory:true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
902 |
l1 ignoreParentDirectory:true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
903 |
l1 directory:'/'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
904 |
l1 action:[:selection | l2 directory:(l1 selectedPathname)]. |
77 | 905 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
906 |
l2 := ScrollableView for:FileSelectionList in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
907 |
l2 stayInDirectory:true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
908 |
l2 directory:nil. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
909 |
l2 ignoreParentDirectory:true. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
910 |
l2 action:[:selection | l3 directory:(l2 selectedPathname)]. |
77 | 911 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
912 |
l3 := ScrollableView for:FileSelectionList in:p. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
913 |
l3 directory:nil. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
914 |
l3 ignoreParentDirectory:false. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
915 |
v extent:400 @ 300. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
916 |
v open |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
917 |
[exEnd] |
125 | 918 |
|
919 |
||
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
920 |
trouble example: self-resizing elements may cause trouble |
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
921 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
922 |
|v p l1 l2 l3| |
125 | 923 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
924 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
925 |
p := HorizontalPanelView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:v. |
593 | 926 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
927 |
l1 := (Label label:'one' in:p) level:-1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
928 |
l2 := (Label label:'two' in:p) level:-1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
929 |
l3 := (Label label:'three' in:p) level:-1. |
125 | 930 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
931 |
v extent:400 @ 300. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
932 |
v open. |
593 | 933 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
934 |
(Delay forSeconds:5) wait. |
125 | 935 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
936 |
l1 label:'oneone'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
937 |
l2 label:'twotwo'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
938 |
l3 label:'threethree'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
939 |
[exEnd] |
125 | 940 |
|
941 |
||
942 |
fixed trouble example: tell the panel that this situation may happen |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
943 |
[exBegin] |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
944 |
|v p l1 l2 l3| |
125 | 945 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
946 |
v := StandardSystemView new. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
947 |
p := HorizontalPanelView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:v. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
948 |
p elementsChangeSize:true. |
125 | 949 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
950 |
l1 := (Label label:'one' in:p) level:-1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
951 |
l2 := (Label label:'two' in:p) level:-1. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
952 |
l3 := (Label label:'three' in:p) level:-1. |
593 | 953 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
954 |
v extent:400 @ 300. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
955 |
v open. |
125 | 956 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
957 |
(Delay forSeconds:5) wait. |
125 | 958 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
959 |
l1 label:'oneone'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
960 |
l2 label:'twotwo'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
961 |
l3 label:'threethree'. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
962 |
[exEnd] |
38 | 963 |
" |
964 |
! ! |
|
0 | 965 |
|
5227 | 966 |
!HorizontalPanelView class methodsFor:'queries'! |
967 |
||
968 |
possibleHorizontalLayouts |
|
969 |
^ #( |
|
970 |
#okCancelBox |
|
971 |
||
972 |
#left |
|
973 |
#leftSpace |
|
974 |
#fixLeft |
|
975 |
#fixLeftSpace |
|
976 |
#right |
|
977 |
#rightSpace |
|
978 |
#center |
|
979 |
#spread |
|
980 |
#spreadSpace |
|
981 |
#fit |
|
982 |
#fitSpace |
|
983 |
#leftFit |
|
984 |
#leftSpaceFit |
|
985 |
#rightFit |
|
986 |
#rightSpaceFit |
|
987 |
||
988 |
#leftMax |
|
989 |
#leftSpaceMax |
|
990 |
#rightMax |
|
991 |
#rightSpaceMax |
|
992 |
#centerMax |
|
993 |
#spreadMax |
|
994 |
#spreadSpaceMax |
|
995 |
) |
|
996 |
! |
|
997 |
||
998 |
possibleVerticalLayouts |
|
999 |
^ #( |
|
1000 |
#top |
|
1001 |
#topSpace |
|
1002 |
#center |
|
1003 |
#bottom |
|
1004 |
#bottomSpace |
|
1005 |
#fit |
|
1006 |
#fitSpace |
|
1007 |
#topMax |
|
1008 |
#topSpaceMax |
|
1009 |
#bottomMax |
|
1010 |
#bottomSpaceMax |
|
1011 |
#centerMax |
|
1012 |
) |
|
1013 |
! ! |
|
1014 |
||
62 | 1015 |
!HorizontalPanelView methodsFor:'accessing'! |
1016 |
||
1017 |
horizontalLayout |
|
1018 |
"return the horizontal layout as symbol. |
|
1019 |
the returned value is one of |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1020 |
#left arrange elements at the left |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1021 |
#leftSpace arrange elements at the left, start with spacing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1022 |
#fixLeft same as #left, but do not reduce spacing in case of no fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1023 |
#fixLeftSpace same as #leftSpace, but do not reduce spacing in case of no fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1024 |
#right arrange elements at the right |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1025 |
#rightSpace arrange elements at the right, start with spacing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1026 |
#center arrange elements in the center |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1027 |
#spread spread elements evenly |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1028 |
#spreadSpace spread elements evenly with spacing at the ends |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1029 |
#fit like #spread, but resize elements for tight packing |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1030 |
#fitSpace like #fit, with additional spacing at the far ends |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1031 |
#leftFit like #left, but resize the last element to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1032 |
#leftSpaceFit like #leftSpace, but resize the last element to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1033 |
#rightFit like #right, but resize the first element to fit |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1034 |
#rightSpaceFit like #rightSpace, but resize the first element to fit |
77 | 1035 |
the default is #center |
118 | 1036 |
See the class documentation for the meanings. |
62 | 1037 |
" |
1038 |
||
1039 |
^ hLayout |
|
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1040 |
|
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1041 |
"Modified: 17.8.1997 / 15:21:26 / cg" |
62 | 1042 |
! |
1043 |
||
5227 | 1044 |
horizontalLayout:layoutSymbolArg |
62 | 1045 |
"change the horizontal layout as symbol. |
1046 |
The argument, aSymbol must be one of: |
|
5227 | 1047 |
#okCancelBox window system specific. Will dynamically be one of: |
1048 |
#maxRightSpace or #fitSpace, depending on style sheet value. |
|
1049 |
||
1050 |
#left arrange elements at the left |
|
1051 |
#leftSpace arrange elements at the left, start with spacing |
|
1052 |
#fixLeft same as #left, but do not reduce spacing in case of no fit |
|
1053 |
#fixLeftSpace same as #leftSpace, but do not reduce spacing in case of no fit |
|
1054 |
#right arrange elements at the right |
|
1055 |
#rightSpace arrange elements at the right, start with spacing |
|
1056 |
#center arrange elements in the center |
|
1057 |
#spread spread elements evenly |
|
1058 |
#spreadSpace spread elements evenly with spacing at the ends |
|
1059 |
#fit like #spread, but resize elements for tight packing |
|
1060 |
#fitSpace like #fit, with additional spacing at the far ends |
|
1061 |
#leftFit like #left, but resize the last element to fit |
|
1062 |
#leftSpaceFit like #leftSpace, but resize the last element to fit |
|
1063 |
#rightFit like #right, but resize the first element to fit |
|
1064 |
#rightSpaceFit like #rightSpace, but resize the first element to fit |
|
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1065 |
|
5227 | 1066 |
#leftMax like non-Max layouts, resizing components to |
1067 |
#leftSpaceMax the width of the widest component |
|
1068 |
#rightMax |
|
1069 |
#rightSpaceMax |
|
1070 |
#centerMax |
|
1071 |
#spreadMax |
|
1072 |
#spreadSpaceMax |
|
118 | 1073 |
the default (if never changed) is #center. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1074 |
See the class documentation for the meanings. |
62 | 1075 |
" |
1076 |
||
5227 | 1077 |
|layoutSymbol| |
1078 |
||
1079 |
layoutSymbol := layoutSymbolArg. |
|
1080 |
layoutSymbol == #okCancelBox ifTrue:[ |
|
1081 |
layoutSymbol := styleSheet at:#'horizontalPanel.okCancelBox' default:#fitSpace. |
|
1082 |
]. |
|
1083 |
||
1084 |
(hLayout ~~ layoutSymbol) ifTrue:[ |
|
1085 |
hLayout := layoutSymbol. |
|
1086 |
self layoutChanged |
|
62 | 1087 |
] |
1156 | 1088 |
|
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1089 |
"Modified: 17.8.1997 / 15:21:16 / cg" |
62 | 1090 |
! |
1091 |
||
202 | 1092 |
layout:something |
1093 |
"OBSOLETE compatibility interface. Will vanish. |
|
1094 |
leftover for historic reasons - do not use any more. |
|
1095 |
In the meantime, try to figure out what is meant ... a kludge" |
|
1096 |
||
2365 | 1097 |
<resource:#obsolete> |
1098 |
||
202 | 1099 |
something isLayout ifTrue:[^ super layout:something]. |
1100 |
||
1101 |
self obsoleteMethodWarning:'use #horizontalLayout:'. |
|
1102 |
^ self horizontalLayout:something |
|
1103 |
||
1104 |
"Modified: 31.8.1995 / 23:07:33 / claus" |
|
1105 |
! |
|
1106 |
||
2099 | 1107 |
reverseOrderIfOKAtLeft |
1108 |
"return the reverseOrderIfOKAtLeft flag. |
|
1109 |
This can be set for OK-Cancel like panels, where the OK Button should |
|
1110 |
be positioned on the left for some viewStyles." |
|
1111 |
||
1112 |
^ reverseOrderIfOKAtLeft |
|
1113 |
! |
|
1114 |
||
2039
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1115 |
reverseOrderIfOKAtLeft:aBoolean |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1116 |
"set/clear the reverseOrderIfOKAtLeft flag. |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1117 |
This can be set for OK-Cancel like panels, where the OK Button should |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1118 |
be positioned on the left for some viewStyles." |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1119 |
|
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1120 |
reverseOrderIfOKAtLeft := aBoolean |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1121 |
! |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1122 |
|
202 | 1123 |
verticalLayout |
1124 |
"return the vertical layout as a symbol. |
|
1125 |
the returned value is one of |
|
1126 |
#top place element at the top |
|
1127 |
#topSpace place element at the top, offset by verticalSpace |
|
1128 |
#center place it horizontally centered |
|
1129 |
#bottom place it at the bottom |
|
1130 |
#bottomSpace place it at the bottom, offset by verticalSpace |
|
1131 |
#fit resize elements vertically to fit this panel |
|
1132 |
#fitSpace like #fit, but with spacing |
|
1133 |
||
1134 |
#topMax like #top, but resize all views vertically to max height |
|
1135 |
#topSpaceMax like #topSpace, but resize all views vertically to max height |
|
1136 |
#bottomMax like #bottom, but resize all views vertically to max height |
|
1137 |
#bottomSpaceMax like #bottomSpace, but resize all views vertically to max height |
|
1138 |
#centerMax like #center, but resize all views vertically to max height |
|
1139 |
the default is #center |
|
1140 |
See the class documentation for the meanings. |
|
1141 |
" |
|
1142 |
||
1143 |
^ vLayout |
|
1144 |
! |
|
1145 |
||
62 | 1146 |
verticalLayout:aSymbol |
1147 |
"change the vertical layout as a symbol. |
|
1148 |
The argument, aSymbol must be one of: |
|
133 | 1149 |
#top place element at the top |
1150 |
#topSpace place element at the top, offset by verticalSpace |
|
1151 |
#center place it horizontally centered |
|
1152 |
#bottom place it at the bottom |
|
1153 |
#bottomSpace place it at the bottom, offset by verticalSpace |
|
1154 |
#fit resize elements vertically to fit this panel |
|
1155 |
#fitSpace like #fit, but with spacing |
|
1156 |
||
1157 |
#topMax like #top, but resize all views vertically to max height |
|
1158 |
#topSpaceMax like #topSpace, but resize all views vertically to max height |
|
1159 |
#bottomMax like #bottom, but resize all views vertically to max height |
|
1160 |
#bottomSpaceMax like #bottomSpace, but resize all views vertically to max height |
|
1161 |
#centerMax like #center, but resize all views vertically to max height |
|
77 | 1162 |
the default (if never changed) is #center |
118 | 1163 |
See the class documentation for the meanings. |
62 | 1164 |
" |
1165 |
||
1166 |
(vLayout ~~ aSymbol) ifTrue:[ |
|
1167 |
vLayout := aSymbol. |
|
1168 |
self layoutChanged |
|
1169 |
] |
|
0 | 1170 |
! ! |
1171 |
||
3458 | 1172 |
!HorizontalPanelView methodsFor:'focus handling'! |
1173 |
||
1174 |
subviewsInFocusOrder |
|
3515 | 1175 |
|
1176 |
subViews isEmptyOrNil ifTrue:[ ^ #() ]. |
|
1177 |
||
3458 | 1178 |
(reverseOrderIfOKAtLeft == true |
1179 |
and:[Dialog defaultOKButtonAtLeft]) ifTrue:[ |
|
3515 | 1180 |
^ subViews reversed |
3458 | 1181 |
]. |
1182 |
^ subViews |
|
1183 |
! ! |
|
1184 |
||
0 | 1185 |
!HorizontalPanelView methodsFor:'layout'! |
1186 |
||
1187 |
setChildPositions |
|
1188 |
"(re)compute position of every child whenever childs are added or |
|
1189 |
my size has changed" |
|
1190 |
||
133 | 1191 |
|xpos space sumOfWidths numChilds l wEach wInside hL vL resizeToMaxV |
4565
4c4b47122c2c
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
4023
diff
changeset
|
1192 |
resizeToMaxH maxHeight maxWidth m2 subViews restWidth y2 bw| |
1042 | 1193 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1194 |
subViews := self subViewsToConsider. |
2039
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1195 |
(numChilds := subViews size) == 0 ifTrue:[^ self]. |
3778
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1196 |
|
2039
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1197 |
reverseOrderIfOKAtLeft == true ifTrue:[ |
2698 | 1198 |
(Dialog defaultOKButtonAtLeft) ifTrue:[ |
3458 | 1199 |
subViews := subViews reversed. |
2039
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1200 |
] |
ad9313ab0151
added support for component reversal if OK-atLeft
Claus Gittinger <cg@exept.de>
parents:
2033
diff
changeset
|
1201 |
]. |
0 | 1202 |
|
3500 | 1203 |
"/ self extentChangedFlag ifTrue:[ |
1204 |
"/ ext := self computeExtent. |
|
1205 |
"/ width := ext x. |
|
1206 |
"/ height := ext y. |
|
1207 |
"/ ]. |
|
0 | 1208 |
|
1209 |
space := horizontalSpace. |
|
1254
c9e604f03e6a
code compactified (slightly)
Claus Gittinger <cg@exept.de>
parents:
1165
diff
changeset
|
1210 |
|
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1211 |
bw := self borderWidth. |
379
a0ada7891fe9
looks bette if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents:
340
diff
changeset
|
1212 |
m2 := margin * 2. |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1213 |
wInside := width - m2 + (bw*2) - subViews last borderWidth. |
59 | 1214 |
|
118 | 1215 |
hL := hLayout. |
1216 |
vL := vLayout. |
|
1217 |
||
133 | 1218 |
resizeToMaxH := false. |
1219 |
(hL endsWith:'Max') ifTrue:[ |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1220 |
resizeToMaxH := true. |
2484 | 1221 |
wEach := maxWidth := subViews |
2480 | 1222 |
inject:0 |
1223 |
into:[:maxSoFar :child | |
|
1224 |
maxSoFar max:child widthIncludingBorder |
|
1225 |
]. |
|
4565
4c4b47122c2c
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
4023
diff
changeset
|
1226 |
hL := (hL copyButLast:3) asSymbol. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1227 |
]. |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1228 |
|
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1229 |
numChilds == 1 ifTrue:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1230 |
(hL == #leftFit or:[hL == #rightFit]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1231 |
hL := #fit |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1232 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1233 |
(hL == #leftSpaceFit or:[hL == #rightSpaceFit]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1234 |
hL := #fitSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1235 |
]. |
133 | 1236 |
]. |
1237 |
||
118 | 1238 |
hL == #fitSpace ifTrue:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1239 |
" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1240 |
adjust childs extents and set origins. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1241 |
Be careful to avoid accumulation of rounding errors |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1242 |
" |
3458 | 1243 |
wEach := (wInside - ((numChilds + 1) * space)) / numChilds. |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1244 |
xpos := space + margin - bw. |
62 | 1245 |
] ifFalse:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1246 |
hL == #fit ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1247 |
" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1248 |
adjust childs extents and set origins. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1249 |
Be careful to avoid accumulation of rounding errors |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1250 |
" |
3458 | 1251 |
wEach := (wInside - ((numChilds - 1) * space)) / numChilds. |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1252 |
xpos := margin - bw. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1253 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1254 |
l := hL. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1255 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1256 |
" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1257 |
compute net width needed |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1258 |
" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1259 |
resizeToMaxH ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1260 |
sumOfWidths := subViews inject:0 into:[:sumSoFar :child | sumSoFar + maxWidth + (child borderWidth*2)]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1261 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1262 |
sumOfWidths := subViews inject:0 into:[:sumSoFar :child | sumSoFar + child widthIncludingBorder]. |
2030
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1263 |
|
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1264 |
"/ adjust - do not include width of last(first) element if doing a fit |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1265 |
(hL == #leftFit or:[hL == #leftSpaceFit]) ifTrue:[ |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1266 |
sumOfWidths := sumOfWidths - subViews last widthIncludingBorder. |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1267 |
] ifFalse:[ |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1268 |
(hL == #rightFit or:[hL == #rightSpaceFit]) ifTrue:[ |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1269 |
sumOfWidths := sumOfWidths - subViews first widthIncludingBorder. |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1270 |
] |
30247cb8fab0
oops - bug in setChildPositions leading to recursion
Claus Gittinger <cg@exept.de>
parents:
2012
diff
changeset
|
1271 |
]. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1272 |
]. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1273 |
|
3674
d9a22791dc50
spacing computation fixed (boundary condition, spacing reduction)
Claus Gittinger <cg@exept.de>
parents:
3515
diff
changeset
|
1274 |
restWidth := width - sumOfWidths "- (numChilds-1*space)". |
62 | 1275 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1276 |
((l == #center) and:[numChilds == 1]) ifTrue:[l := #spread]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1277 |
(l == #spread and:[numChilds == 1]) ifTrue:[l := #spreadSpace]. |
0 | 1278 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1279 |
" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1280 |
compute position of leftmost subview and space between them; |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1281 |
if they do hardly fit, leave no space between them |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1282 |
" |
3674
d9a22791dc50
spacing computation fixed (boundary condition, spacing reduction)
Claus Gittinger <cg@exept.de>
parents:
3515
diff
changeset
|
1283 |
((sumOfWidths > (width - m2)) |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1284 |
and:[l ~~ #fixLeftSpace and:[l ~~ #fixLeft]]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1285 |
xpos := margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1286 |
space := 0 |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1287 |
] ifFalse: [ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1288 |
l == #fixLeftSpace ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1289 |
l := #leftSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1290 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1291 |
l == #fixLeft ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1292 |
l := #left |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1293 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1294 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1295 |
((l == #right) or:[l == #rightSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1296 |
or:[l == #rightFit or:[l == #rightSpaceFit]]]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1297 |
xpos := restWidth - (space * (numChilds - 1)). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1298 |
"/ |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1299 |
"/ bw == 0 ifTrue:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1300 |
"/ xpos := xpos + space |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1301 |
"/ ]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1302 |
"/ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1303 |
(l == #rightSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1304 |
or:[l == #rightSpaceFit]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1305 |
xpos >= space ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1306 |
xpos := xpos - space |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1307 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1308 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1309 |
xpos := xpos - margin. |
62 | 1310 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1311 |
xpos < 0 ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1312 |
space := space min:(restWidth // (numChilds + 1)). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1313 |
xpos := restWidth - (space * numChilds). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1314 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1315 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1316 |
(l == #spread) ifTrue:[ |
3778
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1317 |
numChilds == 1 ifTrue:[ |
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1318 |
space := (restWidth - m2). |
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1319 |
] ifFalse:[ |
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1320 |
space := (restWidth - m2) // (numChilds - 1). |
c7257987a773
division by zero with numChilds == 1
Claus Gittinger <cg@exept.de>
parents:
3765
diff
changeset
|
1321 |
]. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1322 |
xpos := margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1323 |
(space == 0) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1324 |
xpos := restWidth // 2 |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1325 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1326 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1327 |
(l == #spreadSpace) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1328 |
space := (restWidth - m2) // (numChilds + 1). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1329 |
xpos := space + margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1330 |
(space == 0) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1331 |
xpos := restWidth // 2 |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1332 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1333 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1334 |
((l == #left) or:[l == #leftSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1335 |
or:[l == #leftFit or:[l == #leftSpaceFit]]]) ifTrue:[ |
3737 | 1336 |
(l == #left or:[l == #leftFit]) ifTrue:[ |
1337 |
numChilds == 1 ifTrue: [ |
|
1338 |
space := space min:(restWidth - m2). |
|
1339 |
]ifFalse:[ |
|
1340 |
space := space min:(restWidth - m2) // (numChilds - 1). |
|
1341 |
]. |
|
1342 |
] ifFalse:[ |
|
3674
d9a22791dc50
spacing computation fixed (boundary condition, spacing reduction)
Claus Gittinger <cg@exept.de>
parents:
3515
diff
changeset
|
1343 |
space := space min:(restWidth - m2) // (numChilds "+ 1"). |
d9a22791dc50
spacing computation fixed (boundary condition, spacing reduction)
Claus Gittinger <cg@exept.de>
parents:
3515
diff
changeset
|
1344 |
]. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1345 |
(hL == #fixLeft or:[hL == #fixLeftSpace]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1346 |
space := space max:horizontalSpace. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1347 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1348 |
space := space max:0. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1349 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1350 |
(l == #leftSpace or:[l == #leftSpaceFit]) ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1351 |
xpos := space + margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1352 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1353 |
"/ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1354 |
"/ if the very first view has a 0-level AND |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1355 |
"/ my level is non-zero, begin with margin |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1356 |
"/ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1357 |
true "(margin ~~ 0 and:[subViews first level == 0])" ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1358 |
xpos := margin |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1359 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1360 |
xpos := 0 |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1361 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1362 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1363 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1364 |
"center" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1365 |
xpos := (restWidth - ((numChilds - 1) * space)) // 2. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1366 |
xpos < 0 ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1367 |
space := restWidth // (numChilds + 1). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1368 |
xpos := (restWidth - ((numChilds - 1) * space)) // 2. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1369 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1370 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1371 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1372 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1373 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1374 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1375 |
]. |
0 | 1376 |
]. |
1377 |
||
133 | 1378 |
resizeToMaxV := false. |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1379 |
(vL endsWith:'Max') ifTrue:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1380 |
resizeToMaxV := true. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1381 |
maxHeight := subViews inject:0 into:[:maxSoFar :child | maxSoFar max:child heightIncludingBorder]. |
4565
4c4b47122c2c
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
4023
diff
changeset
|
1382 |
vL := (vL copyButLast:3) asSymbol. |
133 | 1383 |
]. |
1384 |
||
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1385 |
" |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1386 |
now set positions |
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1387 |
" |
0 | 1388 |
|
77 | 1389 |
subViews keysAndValuesDo:[:index :child | |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1390 |
|ypos advance bwChild hChild newHChild| |
62 | 1391 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1392 |
hChild := child heightIncludingBorder. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1393 |
bwChild := child borderWidth. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1394 |
|
3118
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1395 |
elementsChangeSize ifTrue:[ |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1396 |
"to avoid a recursion when we change the elements size" |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1397 |
child removeDependent:self. |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1398 |
]. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1399 |
resizeToMaxV ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1400 |
child height:(hChild := maxHeight - (bwChild * 2)). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1401 |
]. |
0 | 1402 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1403 |
vL == #top ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1404 |
ypos := margin |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1405 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1406 |
vL == #topSpace ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1407 |
ypos := margin + verticalSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1408 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1409 |
vL == #bottom ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1410 |
ypos := height - margin - child heightIncludingBorder |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1411 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1412 |
vL == #bottomSpace ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1413 |
ypos := height - margin |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1414 |
- verticalSpace - child heightIncludingBorder. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1415 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1416 |
vL == #fitSpace ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1417 |
ypos := verticalSpace. |
3458 | 1418 |
newHChild := height - ((verticalSpace + bwChild) * 2). |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1419 |
ypos := ypos + margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1420 |
newHChild := newHChild - m2. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1421 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1422 |
vL == #fit ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1423 |
newHChild := height - (bwChild * 2). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1424 |
"/ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1425 |
"/ if the view has a 0-level AND |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1426 |
"/ my level is non-zero, begin with margin |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1427 |
"/ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1428 |
true "(level ~~ 0 and:[child level == 0])" ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1429 |
ypos := margin. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1430 |
newHChild := newHChild - m2. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1431 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1432 |
ypos := 0. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1433 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1434 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1435 |
"centered" |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1436 |
ypos := margin + ((height - m2 - hChild) // 2). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1437 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1438 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1439 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1440 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1441 |
] |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1442 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1443 |
newHChild notNil ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1444 |
child height:newHChild |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1445 |
]. |
379
a0ada7891fe9
looks bette if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents:
340
diff
changeset
|
1446 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1447 |
(ypos < 0) ifTrue:[ypos := 0]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1448 |
|
2033
fc16e79f649b
size computation with bordered components
Claus Gittinger <cg@exept.de>
parents:
2030
diff
changeset
|
1449 |
y2 := ypos + child height - 1. |
fc16e79f649b
size computation with bordered components
Claus Gittinger <cg@exept.de>
parents:
2030
diff
changeset
|
1450 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1451 |
(hL == #fit |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1452 |
or:[hL == #fitSpace |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1453 |
or:[resizeToMaxH]]) ifTrue:[ |
1747
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1454 |
"/cg: removed this (OLD) piece of code, |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1455 |
"/ which prevents resizing of label-like things if their sizeFixed |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1456 |
"/ is set to true (I dont remember why I ever added this) |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1457 |
|
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1458 |
"/ child sizeFixed ifTrue:[ |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1459 |
"/ d := wEach - (child widthIncludingBorder) // 2. |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1460 |
"/ child origin:(xpos truncated + d @ ypos) |
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1461 |
"/ ] ifFalse:[ |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1462 |
child origin:(xpos truncated @ ypos) |
2033
fc16e79f649b
size computation with bordered components
Claus Gittinger <cg@exept.de>
parents:
2030
diff
changeset
|
1463 |
corner:(xpos + wEach - bwChild - 1) truncated @ y2. |
1747
d5be0d4cf7fc
do not care for sizeFixed views with fit layouts.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1464 |
"/ ]. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1465 |
advance := wEach. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1466 |
] ifFalse:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1467 |
child origin:(xpos @ ypos). |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1468 |
advance := child widthIncludingBorder |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1469 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1470 |
|
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1471 |
index == numChilds ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1472 |
|x| |
1306
bf4903012f7a
added #rightFit & #rightSpaceFit layouts
Claus Gittinger <cg@exept.de>
parents:
1291
diff
changeset
|
1473 |
|
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1474 |
(hL == #leftFit or:[hL == #leftSpaceFit]) ifTrue:[ |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1475 |
x := width - margin - 1 - (bwChild * 2) + bw. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1476 |
hL == #leftSpaceFit ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1477 |
x := x - space |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1478 |
]. |
2033
fc16e79f649b
size computation with bordered components
Claus Gittinger <cg@exept.de>
parents:
2030
diff
changeset
|
1479 |
child corner:(x @ y2) |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1480 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1481 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1482 |
index == 1 ifTrue:[ |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1483 |
(hL == #rightFit or:[hL == #rightSpaceFit]) ifTrue:[ |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1484 |
xpos := margin + 0 + (bwChild * 2) - bw. |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1485 |
hL == #rightSpaceFit ifTrue:[ |
3118
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1486 |
xpos := xpos + space |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1487 |
]. |
3118
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1488 |
advance := restWidth. |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1489 |
child origin:(xpos @ (child origin y)) |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1490 |
corner:((xpos+advance) @ (child corner y)) |
1431
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1491 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1492 |
]. |
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1493 |
|
fd1e74d673ae
really care for margins when doing childPositions
Claus Gittinger <cg@exept.de>
parents:
1418
diff
changeset
|
1494 |
xpos := xpos + advance + space. |
3118
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1495 |
elementsChangeSize ifTrue:[ |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1496 |
"reinstall dependency that we removed above" |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1497 |
child addDependent:self. |
996b7fc6dee7
1. Avoid endless recursion with #elementsChangesSize.
Stefan Vogel <sv@exept.de>
parents:
2699
diff
changeset
|
1498 |
]. |
77 | 1499 |
]. |
155 | 1500 |
|
3503
6af61918313a
setChildPositions fix with rightFit
Claus Gittinger <cg@exept.de>
parents:
3500
diff
changeset
|
1501 |
"Modified: / 04-09-1995 / 18:43:10 / claus" |
6af61918313a
setChildPositions fix with rightFit
Claus Gittinger <cg@exept.de>
parents:
3500
diff
changeset
|
1502 |
"Modified: / 10-10-2007 / 13:49:10 / cg" |
0 | 1503 |
! ! |
202 | 1504 |
|
1505 |
!HorizontalPanelView methodsFor:'queries'! |
|
1506 |
||
1507 |
preferredExtent |
|
1508 |
"return a good extent, one that makes subviews fit" |
|
1509 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
1510 |
|sumOfWidths maxHeight maxWidth m2 subViews| |
202 | 1511 |
|
3765
db70ef63cc02
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3737
diff
changeset
|
1512 |
"/ If I have an explicit preferredExtent.. |
db70ef63cc02
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3737
diff
changeset
|
1513 |
explicitExtent notNil ifTrue:[ |
db70ef63cc02
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3737
diff
changeset
|
1514 |
^ explicitExtent |
db70ef63cc02
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3737
diff
changeset
|
1515 |
]. |
797 | 1516 |
|
3765
db70ef63cc02
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3737
diff
changeset
|
1517 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1518 |
preferredExtent notNil ifTrue:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1519 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1520 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1521 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1522 |
subViews := self subViewsToConsider. |
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1523 |
(subViews size == 0) ifTrue:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1524 |
^ super preferredExtent. |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1525 |
"/ ^ horizontalSpace @ verticalSpace]. |
1038 | 1526 |
]. |
202 | 1527 |
|
1528 |
"compute net height needed" |
|
1529 |
||
1530 |
sumOfWidths := 0. |
|
1531 |
maxHeight := 0. |
|
1532 |
maxWidth := 0. |
|
1533 |
||
1534 |
subViews do:[:child | |
|
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1535 |
|childsPreference| |
202 | 1536 |
|
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1537 |
"/ better to use component's preferredExtent ... |
202 | 1538 |
|
3686 | 1539 |
"/ child realized ifTrue:[ |
1540 |
"/ childsPreference := child extent. |
|
1541 |
"/ ] ifFalse:[ |
|
3674
d9a22791dc50
spacing computation fixed (boundary condition, spacing reduction)
Claus Gittinger <cg@exept.de>
parents:
3515
diff
changeset
|
1542 |
childsPreference := child preferredExtent. |
3686 | 1543 |
"/ ]. |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1544 |
sumOfWidths := sumOfWidths + childsPreference x. |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1545 |
maxHeight := maxHeight max:childsPreference y. |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1546 |
maxWidth := maxWidth max:childsPreference x. |
202 | 1547 |
|
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1548 |
"/ ... instead of actual extent |
202 | 1549 |
"/ sumOfWidths := sumOfWidths + child widthIncludingBorder. |
1550 |
"/ maxHeight := maxHeight max:(child heightIncludingBorder). |
|
1551 |
"/ maxWidth := maxWidth max:(child widthIncludingBorder). |
|
1552 |
]. |
|
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1553 |
"/ self borderWidth ~~ 0 ifTrue:[ |
3686 | 1554 |
"/ sumOfWidths := sumOfWidths + (horizontalSpace * 2). |
1555 |
"/ maxHeight := maxHeight + (verticalSpace * 2). |
|
1556 |
"/ ]. |
|
1557 |
||
202 | 1558 |
(hLayout == #fit |
1559 |
or:[hLayout == #fitSpace |
|
1560 |
or:[hLayout endsWith:'Max']]) ifTrue:[ |
|
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1561 |
sumOfWidths := maxWidth * subViews size. |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1562 |
self borderWidth ~~ 0 ifTrue:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1563 |
sumOfWidths := sumOfWidths + (horizontalSpace * 2). |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1564 |
]. |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1565 |
hLayout == #fitSpace ifTrue:[ |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1566 |
"/ care for spacing ... |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1567 |
sumOfWidths := sumOfWidths + (horizontalSpace * (subViews size + 1)). |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1568 |
]. |
202 | 1569 |
] ifFalse:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1570 |
sumOfWidths := sumOfWidths + ((subViews size - 1) * horizontalSpace). |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1571 |
((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[ |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1572 |
sumOfWidths := sumOfWidths + horizontalSpace |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1573 |
] ifFalse:[ |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1574 |
((hLayout == #center) or:[hLayout == #spread]) ifTrue:[ |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1575 |
sumOfWidths := sumOfWidths + (horizontalSpace * 2) |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1576 |
] |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1577 |
]. |
202 | 1578 |
]. |
1579 |
||
1165
16b8537595fd
care for spacing in preferredExtent of centerSpace layout.
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
1580 |
((vLayout == #topSpace) |
16b8537595fd
care for spacing in preferredExtent of centerSpace layout.
Claus Gittinger <cg@exept.de>
parents:
1156
diff
changeset
|
1581 |
or:[vLayout == #bottomSpace]) ifTrue:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1582 |
maxHeight := maxHeight + verticalSpace |
202 | 1583 |
] ifFalse:[ |
2387
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1584 |
((vLayout == #fitSpace) |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1585 |
or:[vLayout == #center |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1586 |
or:[vLayout == #centerSpace]]) ifTrue:[ |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1587 |
maxHeight := maxHeight + (verticalSpace * 2) |
c589e85a4f43
prefExtent computation was wrong for fitSpace
Claus Gittinger <cg@exept.de>
parents:
2365
diff
changeset
|
1588 |
] |
202 | 1589 |
]. |
1590 |
||
379
a0ada7891fe9
looks bette if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents:
340
diff
changeset
|
1591 |
m2 := margin * 2. |
a0ada7891fe9
looks bette if panels level is ~~ 0 AND subview has 0 level
Claus Gittinger <cg@exept.de>
parents:
340
diff
changeset
|
1592 |
^ (sumOfWidths + m2) @ (maxHeight + m2) |
340
f820bcd29a51
defaultExtent with rightSpace forgot about spacing
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
1593 |
|
1418
3397ec6b8419
added ignoreInvisibleComponents stuff
Claus Gittinger <cg@exept.de>
parents:
1306
diff
changeset
|
1594 |
"Modified: / 17.1.1998 / 00:18:38 / cg" |
202 | 1595 |
! ! |
1596 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
1597 |
!HorizontalPanelView class methodsFor:'documentation'! |
205 | 1598 |
|
1599 |
version |
|
5227 | 1600 |
^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.63 2014-12-18 23:12:41 cg Exp $' |
4023
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1601 |
! |
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1602 |
|
06b045d4e152
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3778
diff
changeset
|
1603 |
version_CVS |
5227 | 1604 |
^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.63 2014-12-18 23:12:41 cg Exp $' |
205 | 1605 |
! ! |
4565
4c4b47122c2c
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
4023
diff
changeset
|
1606 |