author | Claus Gittinger <cg@exept.de> |
Fri, 09 Oct 2015 17:31:17 +0200 | |
changeset 5477 | 931002803ea7 |
parent 5020 | 67d4d7034f64 |
child 5527 | e19e3e903172 |
permissions | -rw-r--r-- |
5477 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
5 | 4 |
COPYRIGHT (c) 1991 by Claus Gittinger |
59 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
2203 | 14 |
"{ Package: 'stx:libwidg' }" |
15 |
||
5477 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
118 | 18 |
SimpleView subclass:#FramedBox |
2203 | 19 |
instanceVariableNames:'label labelChannel labelPosition fgColor showFrame frame3D |
5477 | 20 |
frameMacRounded horizontalSpace verticalSpace |
21 |
innerHorizontalSpace innerVerticalSpace frameColor' |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
22 |
classVariableNames:'' |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
23 |
poolDictionaries:'' |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
24 |
category:'Views-Layout' |
0 | 25 |
! |
26 |
||
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
27 |
!FramedBox class methodsFor:'documentation'! |
38 | 28 |
|
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 32 |
All Rights Reserved |
0 | 33 |
|
38 | 34 |
This software is furnished under a license and may be used |
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
a frame around something. The frame may have a label, whose position |
|
133 | 46 |
is controlled by the labelPosition variable, a symbol which may be one of: |
3673 | 47 |
[#topCenter #topLeft #topRight #bottomLeft #bottomCenter #bottomRight #hidden] |
38 | 48 |
|
133 | 49 |
The default labelPosition is controlled by the styleSheet variable: |
50 |
'framedBoxLabelPosition' (usually, #topCenter). |
|
51 |
||
38 | 52 |
Its also possible, to not show the frame but only the label, by setting |
53 |
showFrame to false. |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
54 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
55 |
The distance from the outer viewBorder to the frame is controlled by |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
56 |
horizontalSpace / verticalSpace. The default is the fonts height. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
57 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
58 |
The distance from the frame to the interior area is controlled by |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
59 |
innerHorizontalSpace / innerVerticalSpace. The default is 0. |
585 | 60 |
|
61 |
[author:] |
|
62 |
Claus Gittinger |
|
685 | 63 |
|
64 |
[see also:] |
|
65 |
PanelView Separator |
|
38 | 66 |
" |
0 | 67 |
! |
68 |
||
125 | 69 |
examples |
70 |
" |
|
71 |
simple: |
|
593 | 72 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
73 |
|top frame1 frame2 frame3| |
125 | 74 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
75 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
76 |
top extent:300@200. |
125 | 77 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
78 |
frame1 := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
79 |
frame1 label:'frame1'. |
3 | 80 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
81 |
frame2 := FramedBox origin:0.5@0.0 corner:1.0@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
82 |
frame2 label:'frame2'. |
125 | 83 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
84 |
frame3 := FramedBox origin:0.0@0.5 corner:1.0@1.0 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
85 |
frame3 label:'frame3'. |
0 | 86 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
87 |
top open |
593 | 88 |
[exEnd] |
125 | 89 |
|
90 |
||
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
91 |
non-string label: |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
92 |
[exBegin] |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
93 |
|top frame| |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
94 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
95 |
top := StandardSystemView new. |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
96 |
top extent:300@200. |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
97 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
98 |
frame := FramedBox origin:0.0@0.0 corner:1.0@1.0 in:top. |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
99 |
frame label:(Image fromFile:'bitmaps/SBrowser.xbm'). |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
100 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
101 |
top open |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
102 |
[exEnd] |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
103 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
104 |
|
125 | 105 |
placing something inside: |
593 | 106 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
107 |
|top frame1 frame2 frame3 v1 v2 v3| |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
108 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
109 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
110 |
top extent:300@200. |
3 | 111 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
112 |
frame1 := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
113 |
frame1 label:'frame1'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
114 |
v1 := View origin:0.0@0.0 corner:1.0@1.0 in:frame1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
115 |
v1 viewBackground:(Color yellow); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
116 |
level:1. |
125 | 117 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
118 |
frame2 := FramedBox origin:0.5@0.0 corner:1.0@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
119 |
frame2 label:'frame2'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
120 |
v2 := View origin:0.0@0.0 corner:1.0@1.0 in:frame2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
121 |
v2 viewBackground:(Color red); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
122 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
123 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
124 |
frame3 := FramedBox origin:0.0@0.5 corner:1.0@1.0 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
125 |
frame3 label:'frame3'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
126 |
v3 := View origin:0.0@0.0 corner:1.0@1.0 in:frame3. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
127 |
v3 viewBackground:(Color green); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
128 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
129 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
130 |
top open |
593 | 131 |
[exEnd] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
132 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
133 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
134 |
placing something inside a frame in a dialog: |
593 | 135 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
136 |
|box panel frame1 frame2 frame3 v1 v1b v2 v3| |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
137 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
138 |
box := Dialog new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
139 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
140 |
frame1 := FramedBox label:'frame1'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
141 |
panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
142 |
v1 := View extent:100@100 in:panel. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
143 |
v1 viewBackground:(Color red); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
144 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
145 |
v1b := View extent:100@100 in:panel. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
146 |
v1b viewBackground:(Color yellow); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
147 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
148 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
149 |
box addComponent:frame1. |
0 | 150 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
151 |
frame2 := FramedBox label:'frame2'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
152 |
v2 := View origin:0.0@0.0 corner:1.0@1.0 in:frame2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
153 |
v2 viewBackground:(Color green); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
154 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
155 |
box addComponent:frame2. |
0 | 156 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
157 |
frame3 := FramedBox label:'frame3'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
158 |
v3 := View origin:0.0@0.0 corner:1.0@1.0 in:frame3. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
159 |
v3 viewBackground:(Color blue); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
160 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
161 |
box addComponent:frame3. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
162 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
163 |
box addOkButton. |
593 | 164 |
box stickAtBottomWithVariableHeight:frame3. |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
165 |
box open |
593 | 166 |
[exEnd] |
125 | 167 |
|
0 | 168 |
|
125 | 169 |
placing something inside a frame in a dialog: |
593 | 170 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
171 |
|box panel frame1 frame2 frame3 v1 v1b v2 v3| |
125 | 172 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
173 |
box := Dialog new. |
0 | 174 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
175 |
frame1 := FramedBox label:'frame1'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
176 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
177 |
v1 := View extent:100@100 in:panel. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
178 |
v1 viewBackground:(Color red); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
179 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
180 |
v1b := View extent:100@100 in:panel. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
181 |
v1b viewBackground:(Color yellow); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
182 |
level:1. |
125 | 183 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
184 |
box addComponent:frame1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
185 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
186 |
frame2 := FramedBox label:'frame2'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
187 |
v2 := View origin:0.0@0.0 corner:1.0@1.0 in:frame2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
188 |
v2 viewBackground:(Color green); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
189 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
190 |
box addComponent:frame2. |
0 | 191 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
192 |
frame3 := FramedBox label:'frame3'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
193 |
v3 := View origin:0.0@0.0 corner:1.0@1.0 in:frame3. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
194 |
v3 viewBackground:(Color blue); |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
195 |
level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
196 |
box addComponent:frame3. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
197 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
198 |
box addOkButton. |
593 | 199 |
box stickAtBottomWithVariableHeight:frame3. |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
200 |
box open |
593 | 201 |
[exEnd] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
202 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
203 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
204 |
simple again, default spacings: |
593 | 205 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
206 |
|top frame v| |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
207 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
208 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
209 |
top extent:300@200. |
125 | 210 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
211 |
frame := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
212 |
frame label:'frame'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
213 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
214 |
v := View origin:0.0@0.0 corner:1.0@1.0 in:frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
215 |
v viewBackground:(Color yellow); level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
216 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
217 |
top open |
593 | 218 |
[exEnd] |
125 | 219 |
|
220 |
||
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
221 |
changing spacings: |
593 | 222 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
223 |
|top frame v| |
0 | 224 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
225 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
226 |
top extent:300@200. |
125 | 227 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
228 |
frame := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
229 |
frame label:'frame'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
230 |
frame horizontalSpace:30. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
231 |
frame verticalSpace:20. |
125 | 232 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
233 |
v := View origin:0.0@0.0 corner:1.0@1.0 in:frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
234 |
v viewBackground:(Color yellow); level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
235 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
236 |
top open |
593 | 237 |
[exEnd] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
238 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
239 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
240 |
changing inner spacings: |
593 | 241 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
242 |
|top frame v| |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
243 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
244 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
245 |
top extent:300@200. |
125 | 246 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
247 |
frame := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
248 |
frame label:'frame'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
249 |
frame innerHorizontalSpace:30. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
250 |
frame innerVerticalSpace:20. |
0 | 251 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
252 |
v := View origin:0.0@0.0 corner:1.0@1.0 in:frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
253 |
v viewBackground:(Color yellow); level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
254 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
255 |
top open |
593 | 256 |
[exEnd] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
257 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
258 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
259 |
label only (no frame around): |
593 | 260 |
[exBegin] |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
261 |
|top frame v| |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
262 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
263 |
top := StandardSystemView new. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
264 |
top extent:300@200. |
0 | 265 |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
266 |
frame := FramedBox origin:0.0@0.0 corner:0.5@0.5 in:top. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
267 |
frame label:'frame'. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
268 |
frame showFrame:false. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
269 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
270 |
v := View origin:0.0@0.0 corner:1.0@1.0 in:frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
271 |
v viewBackground:(Color yellow); level:1. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
272 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
273 |
top open |
593 | 274 |
[exEnd] |
125 | 275 |
" |
195 | 276 |
! ! |
277 |
||
278 |
!FramedBox methodsFor:'accessing'! |
|
279 |
||
280 |
font:aFont |
|
664 | 281 |
"set the frame labelstrings font. |
282 |
CAVEAT: with the addition of Text objects, |
|
283 |
this method is going to be obsoleted by a textStyle |
|
284 |
method, which allows specific control over |
|
285 |
normalFont/boldFont/italicFont parameters." |
|
195 | 286 |
|
4890 | 287 |
(self font ~= aFont) ifTrue:[ |
664 | 288 |
super font:aFont. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
289 |
self invalidate |
195 | 290 |
] |
664 | 291 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
292 |
"Modified: / 6.6.1998 / 20:05:05 / cg" |
195 | 293 |
! |
294 |
||
295 |
foregroundColor |
|
5477 | 296 |
"return the label's foreground color" |
195 | 297 |
|
298 |
^ fgColor |
|
299 |
! |
|
300 |
||
301 |
foregroundColor:aColor |
|
5477 | 302 |
"set the frame label's foreground color" |
195 | 303 |
|
304 |
aColor ~= fgColor ifTrue:[ |
|
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
305 |
fgColor := aColor. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
306 |
self invalidateRepairNow:true |
195 | 307 |
] |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
308 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
309 |
"Modified: / 6.6.1998 / 19:23:14 / cg" |
195 | 310 |
! |
311 |
||
5477 | 312 |
frameColor |
313 |
"return the frame's color" |
|
314 |
||
315 |
^ frameColor |
|
316 |
! |
|
317 |
||
318 |
frameColor:aColor |
|
319 |
"set the frame's foreground color" |
|
320 |
||
321 |
aColor ~= frameColor ifTrue:[ |
|
322 |
frameColor := aColor. |
|
323 |
self invalidateRepairNow:true |
|
324 |
] |
|
325 |
! |
|
326 |
||
195 | 327 |
frameShown |
328 |
"return true, if frame is shown; |
|
5477 | 329 |
if false, only the label is shown. |
195 | 330 |
OBSOLETE; use #showFrame." |
331 |
||
3672 | 332 |
^ self showFrame |
195 | 333 |
! |
334 |
||
335 |
horizontalSpace |
|
336 |
"return the number of pixels by which the frame is inset horizontally. |
|
337 |
The default, nil, lets the box compute the horizontal inset from the |
|
338 |
labels font height." |
|
339 |
||
340 |
^ horizontalSpace |
|
341 |
||
342 |
"Modified: 5.9.1995 / 17:24:21 / claus" |
|
343 |
! |
|
344 |
||
345 |
horizontalSpace:aNumber |
|
346 |
"set the number of pixels by which the frame is inset horizontally. |
|
347 |
The default, nil, lets the box compute the horizontal inset from the |
|
348 |
labels font height." |
|
349 |
||
350 |
horizontalSpace := aNumber |
|
351 |
! |
|
352 |
||
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
353 |
innerHorizontalSpace:aNumber |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
354 |
"set the number of pixels by which the interior is inset horizontally from the frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
355 |
The default is 0" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
356 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
357 |
innerHorizontalSpace := aNumber |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
358 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
359 |
"Created: 10.1.1996 / 14:39:20 / cg" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
360 |
! |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
361 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
362 |
innerVerticalSpace:aNumber |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
363 |
"set the number of pixels by which the interior is inset vertically from the frame. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
364 |
The default is 0" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
365 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
366 |
innerVerticalSpace := aNumber |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
367 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
368 |
"Created: 10.1.1996 / 14:39:35 / cg" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
369 |
! |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
370 |
|
195 | 371 |
label |
372 |
"return the frames labelstring" |
|
373 |
||
374 |
^ label |
|
375 |
! |
|
376 |
||
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
377 |
label:aStringOrImage |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
378 |
"set the frames labelstring or labelImage" |
195 | 379 |
|
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
380 |
(label ~= aStringOrImage) ifTrue:[ |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
381 |
(aStringOrImage isString |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
382 |
and:[aStringOrImage isEmpty]) ifTrue:[ |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
383 |
label := nil |
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
384 |
] ifFalse:[ |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
385 |
label := aStringOrImage. |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
386 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
387 |
self invalidateRepairNow:true |
195 | 388 |
] |
389 |
||
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
390 |
"Modified: / 5.9.1995 / 17:20:05 / claus" |
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
391 |
"Modified: / 6.6.1998 / 19:23:17 / cg" |
195 | 392 |
! |
393 |
||
394 |
labelPosition |
|
395 |
"return the labelPosition, which is a symbol describing |
|
396 |
the labels position." |
|
397 |
||
398 |
^ labelPosition |
|
399 |
! |
|
400 |
||
401 |
labelPosition:aSymbol |
|
402 |
"define the position of the label; |
|
403 |
aSymbol may be one of: |
|
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
404 |
#topLeft, #topCenter, #topRight; |
3672 | 405 |
#bottomLeft, #bottomCenter or #bottomRight |
406 |
#hidden" |
|
195 | 407 |
|
408 |
labelPosition ~~ aSymbol ifTrue:[ |
|
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
409 |
labelPosition := aSymbol. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
410 |
self invalidate |
195 | 411 |
] |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
412 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
413 |
"Modified: / 6.6.1998 / 20:04:22 / cg" |
195 | 414 |
! |
415 |
||
416 |
layout:something |
|
417 |
"OBSOLETE compatibility interface. Will vanish. |
|
418 |
In the meantime, try to figure out what is meant ... a kludge" |
|
419 |
||
2364 | 420 |
<resource:#obsolete> |
421 |
||
195 | 422 |
something isLayout ifTrue:[^ super layout:something]. |
423 |
||
424 |
self obsoleteMethodWarning:'use #labelPosition:'. |
|
425 |
^ self labelPosition:something |
|
426 |
||
427 |
"Modified: 31.8.1995 / 23:07:00 / claus" |
|
428 |
! |
|
429 |
||
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
430 |
setLabel:anImage |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
431 |
"set the frames label. |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
432 |
same as #label: for ST-80 GroupBox compatibility" |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
433 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
434 |
^ self label:anImage |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
435 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
436 |
"Created: 17.2.1997 / 11:03:04 / cg" |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
437 |
"Modified: 17.2.1997 / 11:03:24 / cg" |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
438 |
! |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
439 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
440 |
setLabelString:anImage |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
441 |
"set the frames label. |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
442 |
same as #label: for ST-80 GroupBox compatibility" |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
443 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
444 |
^ self label:anImage |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
445 |
|
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
446 |
"Modified: 17.2.1997 / 11:03:19 / cg" |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
447 |
! |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
448 |
|
195 | 449 |
showFrame |
450 |
"return if the view shows its frame. |
|
451 |
If false, only the label is drawn" |
|
452 |
||
453 |
^ showFrame |
|
454 |
||
455 |
"Modified: 5.9.1995 / 17:21:37 / claus" |
|
456 |
! |
|
457 |
||
458 |
showFrame:aBoolean |
|
459 |
"turn on/off showing of the frame - |
|
3672 | 460 |
without a frame, only the label is shown at its position. |
461 |
(unless the label is nil or #hidden)" |
|
195 | 462 |
|
463 |
aBoolean ~~ showFrame ifTrue:[ |
|
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
464 |
showFrame := aBoolean. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
465 |
self invalidate |
195 | 466 |
] |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
467 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
468 |
"Modified: / 6.6.1998 / 20:03:50 / cg" |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
469 |
! |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
470 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
471 |
verticalSpace |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
472 |
"return the number of pixels by which the frame is inset vertically. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
473 |
The default, nil, lets the box compute the vertical inset from the |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
474 |
labels font height." |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
475 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
476 |
^ verticalSpace |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
477 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
478 |
"Modified: 5.9.1995 / 17:24:21 / claus" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
479 |
"Created: 10.1.1996 / 14:38:21 / cg" |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
480 |
! |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
481 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
482 |
verticalSpace:aNumber |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
483 |
"set the number of pixels by which the frame is inset vertically. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
484 |
The default, nil, lets the box compute the vertical inset from the |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
485 |
labels font height." |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
486 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
487 |
verticalSpace := aNumber. |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
488 |
|
1555
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
489 |
"Created: / 10.1.1996 / 14:38:31 / cg" |
49aee7cb2f36
label changes are redrawn immediately
Claus Gittinger <cg@exept.de>
parents:
1364
diff
changeset
|
490 |
"Modified: / 6.6.1998 / 20:04:39 / cg" |
0 | 491 |
! ! |
492 |
||
2227 | 493 |
!FramedBox methodsFor:'accessing-channels'! |
2203 | 494 |
|
495 |
labelChannel |
|
5477 | 496 |
"return the labelChannel - or nil. |
497 |
If not nil, it should provide the actual label via #value |
|
498 |
(and may send out change notifications). |
|
499 |
If nil, the static label is used." |
|
2203 | 500 |
|
501 |
^ labelChannel. |
|
502 |
! |
|
503 |
||
504 |
labelChannel:aValueHolder |
|
505 |
"set the labelChannel - a valueHolder holding a string |
|
5477 | 506 |
which is shown as my logo. |
507 |
If not nil, it should provide the actual label via #value |
|
508 |
(and may send out change notifications). |
|
509 |
If nil, the static label is used." |
|
510 |
||
2203 | 511 |
labelChannel notNil ifTrue:[ |
512 |
labelChannel removeDependent:self. |
|
513 |
]. |
|
514 |
||
515 |
(labelChannel := aValueHolder) notNil ifTrue:[ |
|
516 |
labelChannel addDependent:self. |
|
517 |
self label:(labelChannel value). |
|
518 |
]. |
|
519 |
! ! |
|
520 |
||
2227 | 521 |
!FramedBox methodsFor:'change & update'! |
2203 | 522 |
|
523 |
update:what with:aPara from:aModel |
|
524 |
"the MVC way of changing the label ... |
|
525 |
" |
|
2614 | 526 |
aModel == labelChannel ifTrue:[ |
2203 | 527 |
self label:(aModel value). |
2614 | 528 |
^ self |
2203 | 529 |
]. |
530 |
^ super update:what with:aPara from:aModel |
|
531 |
! ! |
|
532 |
||
0 | 533 |
!FramedBox methodsFor:'drawing'! |
534 |
||
535 |
drawFrame |
|
536 |
"redraw the frame" |
|
537 |
||
133 | 538 |
|halfSepX halfSepY w h| |
0 | 539 |
|
38 | 540 |
" |
541 |
if there is no label, give more real estate to the inside |
|
542 |
" |
|
543 |
label isNil ifTrue:[ |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
544 |
halfSepX := halfSepY := 2 |
38 | 545 |
] ifFalse:[ |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
546 |
halfSepX := halfSepY := (label heightOn:self) // 2. |
38 | 547 |
]. |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
548 |
|
133 | 549 |
horizontalSpace notNil ifTrue:[ |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
550 |
halfSepX := horizontalSpace. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
551 |
]. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
552 |
verticalSpace notNil ifTrue:[ |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
553 |
halfSepY := verticalSpace. |
133 | 554 |
]. |
38 | 555 |
|
1635
095c31e9c914
fixed drawingPosition, with big margin (i.e. 3D level)
Claus Gittinger <cg@exept.de>
parents:
1555
diff
changeset
|
556 |
halfSepX := halfSepX + margin. |
095c31e9c914
fixed drawingPosition, with big margin (i.e. 3D level)
Claus Gittinger <cg@exept.de>
parents:
1555
diff
changeset
|
557 |
halfSepY := halfSepY + margin. |
095c31e9c914
fixed drawingPosition, with big margin (i.e. 3D level)
Claus Gittinger <cg@exept.de>
parents:
1555
diff
changeset
|
558 |
|
133 | 559 |
w := width - halfSepX - halfSepX. |
560 |
h := height - halfSepY - halfSepY. |
|
38 | 561 |
|
5477 | 562 |
frameMacRounded ifTrue:[ |
563 |
^ self. |
|
564 |
]. |
|
565 |
||
59 | 566 |
frame3D ifFalse:[ |
5477 | 567 |
frameColor ~= fgColor ifTrue:[ |
568 |
self paint:frameColor |
|
569 |
]. |
|
570 |
self displayRectangleX:halfSepX y:halfSepY width:w height:h. |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
571 |
^ self |
0 | 572 |
]. |
38 | 573 |
|
574 |
w := w + 1. |
|
575 |
h := h + 1. |
|
7 | 576 |
|
685 | 577 |
self paint:lightColor. |
5477 | 578 |
self displayRectangleX:halfSepX y:halfSepY width:w height:h. |
685 | 579 |
|
0 | 580 |
self paint:shadowColor. |
5477 | 581 |
self displayRectangleX:halfSepX-1 y:halfSepY-1 width:w height:h. |
0 | 582 |
|
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
583 |
"Modified: 17.2.1997 / 11:04:34 / cg" |
0 | 584 |
! |
585 |
||
586 |
redraw |
|
587 |
"redraw the frame and name if present" |
|
588 |
||
589 |
|labelLen l x y| |
|
590 |
||
1084 | 591 |
self clear. |
592 |
||
3672 | 593 |
(label isNil or:[ labelPosition == #hidden]) ifTrue:[ |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
594 |
labelLen := 0 |
0 | 595 |
] ifFalse:[ |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
596 |
label isString ifTrue:[ |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
597 |
l := ' ' , label , ' '. |
4890 | 598 |
gc createFontOnDevice. |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
599 |
] ifFalse:[ |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
600 |
l := label |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
601 |
]. |
1084 | 602 |
labelLen := l widthOn:self |
0 | 603 |
]. |
604 |
||
38 | 605 |
showFrame ifTrue:[ |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
606 |
self drawFrame. |
38 | 607 |
]. |
608 |
||
0 | 609 |
labelLen > 0 ifTrue:[ |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
610 |
labelLen < width ifTrue:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
611 |
(labelPosition == #topLeft |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
612 |
or:[labelPosition == #topCenter |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
613 |
or:[labelPosition == #topRight]]) ifTrue:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
614 |
" |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
615 |
label at top |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
616 |
" |
4890 | 617 |
y := gc font ascent + margin. |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
618 |
] ifFalse:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
619 |
" |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
620 |
label at bottom |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
621 |
" |
4890 | 622 |
y := height - margin - gc font descent. |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
623 |
]. |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
624 |
(labelPosition == #topLeft |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
625 |
or:[labelPosition == #bottomLeft]) ifTrue:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
626 |
" |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
627 |
label at left |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
628 |
" |
4890 | 629 |
x := gc font height + margin |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
630 |
] ifFalse:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
631 |
(labelPosition == #topRight |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
632 |
or:[labelPosition == #bottomRight]) ifTrue:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
633 |
" |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
634 |
label at right |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
635 |
" |
4898 | 636 |
x := width - margin - labelLen - gc font height |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
637 |
] ifFalse:[ |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
638 |
" |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
639 |
label at center |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
640 |
" |
1635
095c31e9c914
fixed drawingPosition, with big margin (i.e. 3D level)
Claus Gittinger <cg@exept.de>
parents:
1555
diff
changeset
|
641 |
x := (width - margin - labelLen) // 2 |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
642 |
] |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
643 |
]. |
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
644 |
self paint:fgColor on:viewBackground. |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
645 |
label isString ifTrue:[ |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
646 |
self displayOpaqueString:l x:x y:y |
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
647 |
] ifFalse:[ |
4898 | 648 |
l displayOpaqueOn:self x:x y:y - gc font ascent |
1019
0d027812861e
allow image-labels (for compatibility with ST-80's GroupBox)
Claus Gittinger <cg@exept.de>
parents:
993
diff
changeset
|
649 |
] |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
650 |
] |
0 | 651 |
] |
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
652 |
|
1084 | 653 |
"Modified: 28.2.1997 / 21:28:09 / cg" |
0 | 654 |
! ! |
655 |
||
195 | 656 |
!FramedBox methodsFor:'event handling'! |
657 |
||
658 |
sizeChanged:how |
|
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2614
diff
changeset
|
659 |
self invalidate. |
195 | 660 |
super sizeChanged:how |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
661 |
|
993 | 662 |
"Modified: 8.2.1997 / 15:19:52 / cg" |
195 | 663 |
! ! |
664 |
||
665 |
!FramedBox methodsFor:'initialization'! |
|
666 |
||
944 | 667 |
fetchDeviceResources |
668 |
"fetch device colors, to avoid reallocation at redraw time" |
|
669 |
||
670 |
super fetchDeviceResources. |
|
671 |
||
4898 | 672 |
fgColor := fgColor onDevice:self graphicsDevice. |
5477 | 673 |
frameColor := frameColor onDevice:self graphicsDevice. |
674 |
||
944 | 675 |
"Created: 15.2.1997 / 16:57:56 / cg" |
676 |
! |
|
677 |
||
195 | 678 |
initStyle |
959 | 679 |
"setup style specifics. |
680 |
The default position is top-center, except for ms-windows, where |
|
195 | 681 |
the text is positioned at top-left" |
682 |
||
1364 | 683 |
<resource: #style (#'framedBox.foregroundColor' |
684 |
#'framedBox.labelPosition' |
|
5477 | 685 |
#'framedBox.frameColor' |
1845
84f68da8e19b
added framedBox.font attribute in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1635
diff
changeset
|
686 |
#'framedBox.font' |
5477 | 687 |
#'framedBox.MacRoundFrame' |
1364 | 688 |
#'framedBox.3DFrame')> |
608 | 689 |
|
195 | 690 |
super initStyle. |
691 |
||
4914 | 692 |
fgColor := StyleSheet at:'framedBox.foregroundColor' default:self blackColor. |
5477 | 693 |
frameColor := StyleSheet at:'framedBox.frameColor' default:fgColor. |
1364 | 694 |
labelPosition := StyleSheet at:'framedBox.labelPosition' default:#topCenter. |
695 |
frame3D := StyleSheet at:'framedBox.3DFrame' default:true. |
|
5477 | 696 |
frameMacRounded := StyleSheet at:'framedBox.MacRoundFrame' default:false. |
4890 | 697 |
self basicFont:(StyleSheet at:'framedBox.font' default:(StyleSheet at:'label.font' default:self font)). |
4022
e34a6aeee9c6
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3862
diff
changeset
|
698 |
self borderWidth:0. |
608 | 699 |
|
1364 | 700 |
"Modified: / 26.10.1997 / 17:00:57 / cg" |
195 | 701 |
! |
702 |
||
703 |
initialize |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
704 |
innerHorizontalSpace := innerVerticalSpace := 0. |
195 | 705 |
super initialize. |
706 |
showFrame := true |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
707 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
708 |
"Modified: 10.1.1996 / 14:38:40 / cg" |
2592 | 709 |
! |
710 |
||
711 |
release |
|
712 |
||
713 |
labelChannel notNil ifTrue:[ |
|
714 |
labelChannel removeDependent:self. |
|
715 |
labelChannel := nil. |
|
716 |
]. |
|
717 |
super release |
|
195 | 718 |
! ! |
719 |
||
125 | 720 |
!FramedBox methodsFor:'queries'! |
721 |
||
195 | 722 |
preferredExtent |
572 | 723 |
"compute the boxes preferredExtent from the components' sizes. |
724 |
Redefined to add space for the frame to the default extent" |
|
195 | 725 |
|
4144 | 726 |
|sep sep2| |
195 | 727 |
|
3753
e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3673
diff
changeset
|
728 |
"/ If I have an explicit preferredExtent.. |
e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3673
diff
changeset
|
729 |
explicitExtent notNil ifTrue:[ |
e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3673
diff
changeset
|
730 |
^ explicitExtent |
e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3673
diff
changeset
|
731 |
]. |
797 | 732 |
|
3753
e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3673
diff
changeset
|
733 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
734 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
735 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
736 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
737 |
|
4898 | 738 |
sep := gc font heightOn:self graphicsDevice. |
5020 | 739 |
sep2 := sep + sep. |
195 | 740 |
|
3672 | 741 |
true "showFrame" ifFalse:[ |
4144 | 742 |
^ super preferredExtent + (0 @ sep2) |
195 | 743 |
]. |
4144 | 744 |
^ super preferredExtent + (sep2 @ sep2) |
572 | 745 |
|
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
746 |
"Modified: 3.1.1997 / 22:02:56 / cg" |
195 | 747 |
! |
748 |
||
125 | 749 |
viewRectangle |
750 |
"return the inside area |
|
751 |
- redefined to save frame from relative computations." |
|
752 |
||
685 | 753 |
|mH mV sepH sepV imH imV lw| |
125 | 754 |
|
4898 | 755 |
sepH := sepV := gc font heightOn:self graphicsDevice. |
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
756 |
horizontalSpace notNil ifTrue:[ |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
757 |
sepH := horizontalSpace |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
758 |
]. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
759 |
verticalSpace notNil ifTrue:[ |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
760 |
sepV := verticalSpace |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
761 |
]. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
762 |
|
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
763 |
mH := sepH * 2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
764 |
mV := sepV * 2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
765 |
imH := innerHorizontalSpace * 2. |
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
766 |
imV := innerVerticalSpace * 2. |
125 | 767 |
|
3672 | 768 |
true "showFrame" ifFalse:[ |
685 | 769 |
sepH := mH := lw := 0. |
770 |
] ifTrue:[ |
|
771 |
lw := 2. |
|
125 | 772 |
]. |
685 | 773 |
|
774 |
^ ((sepH + innerHorizontalSpace + lw) @ (innerVerticalSpace + sepV + lw)) |
|
775 |
extent:((width - imH - mH - lw - lw) @ (height - imV - mV - lw - lw)) |
|
125 | 776 |
|
777 |
"/ |m2 sepH sepV| |
|
778 |
"/ |
|
779 |
"/ sepV := font height. |
|
780 |
"/ |
|
781 |
"/ showFrame ifFalse:[ |
|
782 |
"/ ^ (0 @ sepV) extent:(width @ (height - sepV - sepV)) |
|
783 |
"/ ]. |
|
784 |
"/ sepH := sepV // 2. |
|
785 |
"/ ^ (sepH @ sepH) extent:((width - sepH - sepH) @ (height - sepV - sepV)) |
|
277
243d138cf316
more frame layout control added
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
786 |
|
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
787 |
"Modified: 3.1.1997 / 22:03:08 / cg" |
125 | 788 |
! ! |
789 |
||
914
c2435be998ba
care for font being on device before querying
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
790 |
!FramedBox class methodsFor:'documentation'! |
205 | 791 |
|
792 |
version |
|
5477 | 793 |
^ '$Header$' |
4022
e34a6aeee9c6
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3862
diff
changeset
|
794 |
! |
e34a6aeee9c6
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3862
diff
changeset
|
795 |
|
e34a6aeee9c6
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3862
diff
changeset
|
796 |
version_CVS |
5477 | 797 |
^ '$Header$' |
205 | 798 |
! ! |
4890 | 799 |