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