author | Claus Gittinger <cg@exept.de> |
Fri, 16 Nov 2001 15:29:37 +0100 | |
changeset 2476 | 7fb8b94e650c |
parent 2449 | b9bf97bf089d |
child 2523 | c10ebb01ab09 |
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 |
" |
|
12 |
||
2212
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
13 |
"{ Package: 'stx:libwidg' }" |
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
14 |
|
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
15 |
DialogBox subclass:#OptionBox |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
16 |
instanceVariableNames:'formLabel textLabel buttons actions defaultButtonIndex' |
355 | 17 |
classVariableNames:'WarnBitmap' |
18 |
poolDictionaries:'' |
|
19 |
category:'Views-DialogBoxes' |
|
0 | 20 |
! |
21 |
||
847 | 22 |
!OptionBox class methodsFor:'documentation'! |
7 | 23 |
|
38 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 27 |
All Rights Reserved |
38 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
7 | 38 |
documentation |
39 |
" |
|
646 | 40 |
CAVEAT: this is a leftover - functionality has been merged into DialogBox |
41 |
PLEASE use one of the `Dialog chooseXXX' methods nstead of OptionBox. |
|
42 |
||
43 |
||
355 | 44 |
Historic note: |
646 | 45 |
originally, ST/X had separate classes for the various entry methods; |
46 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
47 |
In the meantime, the DialogBox class (and therefore its alias: Dialog) |
|
48 |
is going to duplicate most funcionality found in these classes. |
|
355 | 49 |
|
646 | 50 |
In the future, those existing subclasses' functionality is going to |
51 |
be moved fully into Dialog, and the subclasses will be replaced by dummy |
|
52 |
delegators. (They will be kept for backward compatibility, though). |
|
355 | 53 |
|
54 |
||
38 | 55 |
OptionBoxes are like YesNoBoxes but with as many buttons as you like; |
91 | 56 |
this will finally be a superclass of WarnBox and YesNoBox - or maybe merged |
38 | 57 |
all into DialogBox.. |
97 | 58 |
Use them for multiway questions. |
91 | 59 |
For a consistent user interface, the rightmost button is the default return |
97 | 60 |
button (i.e. pressing return in the box performs this buttons function). |
91 | 61 |
|
646 | 62 |
[author:] |
63 |
Claus Gittinger |
|
91 | 64 |
|
646 | 65 |
[see also:] |
66 |
DialogBox |
|
67 |
" |
|
68 |
! |
|
91 | 69 |
|
646 | 70 |
examples |
71 |
" |
|
72 |
[exBegin] |
|
73 |
|box| |
|
97 | 74 |
|
646 | 75 |
box := OptionBox title:'hello' numberOfOptions:4. |
76 |
box showAtPointer |
|
77 |
[exEnd] |
|
97 | 78 |
|
79 |
||
646 | 80 |
[exBegin] |
81 |
|box| |
|
82 |
box := OptionBox title:'hello' numberOfOptions:3. |
|
83 |
box buttonTitles:#('one' 'two' 'three'). |
|
84 |
box showAtPointer |
|
85 |
[exEnd] |
|
97 | 86 |
|
646 | 87 |
performing an action: |
97 | 88 |
|
646 | 89 |
[exBegin] |
90 |
|box| |
|
91 |
box := OptionBox title:'hello' numberOfOptions:3. |
|
92 |
box buttonTitles:#('one' 'two' 'three'). |
|
93 |
box action:[:which | Transcript show:'button '; |
|
94 |
show: which; |
|
655 | 95 |
showCR:' was pressed']. |
646 | 96 |
box showAtPointer |
97 |
[exEnd] |
|
97 | 98 |
|
646 | 99 |
returning a value: |
100 |
[exBegin] |
|
101 |
|what| |
|
133 | 102 |
|
646 | 103 |
what := OptionBox |
104 |
request:('text has not been accepted.\\Your modifications will be lost when continuing.') withCRs |
|
105 |
label:' Attention' |
|
106 |
form:(WarningBox iconBitmap) |
|
107 |
buttonLabels:#('abort' 'accept' 'continue') |
|
108 |
values:#(#abort #accept #continue). |
|
655 | 109 |
Transcript showCR:what. |
646 | 110 |
[exEnd] |
7 | 111 |
" |
197 | 112 |
! ! |
113 |
||
847 | 114 |
!OptionBox class methodsFor:'instance creation'! |
197 | 115 |
|
116 |
title:titleString numberOfOptions:nOptions |
|
117 |
"create a new optionBox with title, aTitleString and nOptions options" |
|
118 |
||
119 |
|box| |
|
120 |
||
121 |
box := (self basicNew) numberOfOptions:nOptions. |
|
122 |
box device:Screen current. |
|
123 |
box initialize. |
|
124 |
box title:titleString. |
|
125 |
^ box |
|
7 | 126 |
! ! |
127 |
||
2449 | 128 |
!OptionBox class methodsFor:'easy startup'! |
95 | 129 |
|
2405 | 130 |
request:title label:label buttonLabels:labels values:values |
131 |
"create a new optionBox, open it modal and return the value of |
|
132 |
the corresponding values collection." |
|
133 |
||
134 |
^ self |
|
135 |
request:title label:label form:(YesNoBox iconBitmap) |
|
136 |
buttonLabels:labels values:values default:nil onCancel:nil |
|
137 |
! |
|
138 |
||
139 |
request:title label:label buttonLabels:labels values:values default:defaultValue |
|
140 |
"create a new optionBox, open it modal and return the value of |
|
141 |
the corresponding values collection. (nil if cancelled)" |
|
142 |
||
143 |
^ self |
|
144 |
request:title label:label form:(YesNoBox iconBitmap) buttonLabels:labels values:values |
|
145 |
default:defaultValue onCancel:defaultValue |
|
146 |
! |
|
147 |
||
148 |
request:title label:label buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
|
149 |
"create a new optionBox, open it modal and return the value of |
|
150 |
the corresponding values collection. (nil if cancelled)" |
|
151 |
||
152 |
^ self |
|
153 |
request:title label:label form:(YesNoBox iconBitmap) buttonLabels:labels values:values |
|
154 |
default:defaultValue onCancel:cancelValue |
|
155 |
! |
|
156 |
||
133 | 157 |
request:title label:label form:aForm buttonLabels:labels values:values |
158 |
"create a new optionBox, open it modal and return the value of |
|
159 |
the corresponding values collection." |
|
160 |
||
2390 | 161 |
^ self request:title label:label form:aForm buttonLabels:labels values:values default:nil onCancel:nil |
133 | 162 |
! |
163 |
||
164 |
request:title label:label form:aForm buttonLabels:labels values:values default:defaultValue |
|
95 | 165 |
"create a new optionBox, open it modal and return the value of |
2389 | 166 |
the corresponding values collection. (nil if cancelled)" |
95 | 167 |
|
2390 | 168 |
^ self |
169 |
request:title label:label form:aForm buttonLabels:labels values:values |
|
170 |
default:defaultValue onCancel:defaultValue |
|
171 |
! |
|
172 |
||
173 |
request:title label:label form:aForm buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
|
174 |
"create a new optionBox, open it modal and return the value of |
|
175 |
the corresponding values collection. (cancelValue if cancelled)" |
|
176 |
||
2162 | 177 |
|box retVal| |
95 | 178 |
|
2390 | 179 |
retVal := cancelValue. |
95 | 180 |
box := OptionBox title:title numberOfOptions:(labels size). |
181 |
box buttonTitles:labels. |
|
133 | 182 |
box defaultButtonIndex:(values indexOf:defaultValue). |
2162 | 183 |
box action:[:n | retVal := values at:n]. |
95 | 184 |
box label:label; form:aForm. |
185 |
box showAtPointer. |
|
920 | 186 |
box destroy. |
2389 | 187 |
|
2162 | 188 |
^ retVal |
95 | 189 |
|
190 |
" |
|
97 | 191 |
OptionBox request:'please select' |
920 | 192 |
label:'select any' |
193 |
form:(WarningBox iconBitmap) |
|
194 |
buttonLabels:#('one' 'two' 'three') |
|
195 |
values:#(1 2 3) |
|
196 |
default:3 |
|
95 | 197 |
" |
920 | 198 |
|
2162 | 199 |
"Modified: / 23.2.2000 / 11:59:32 / cg" |
95 | 200 |
! ! |
201 |
||
197 | 202 |
!OptionBox methodsFor:'accessing'! |
203 |
||
204 |
action:actionBlock |
|
205 |
"define a single the action for all buttons. |
|
206 |
The action will be evaluated with the button index as argument." |
|
207 |
||
208 |
buttons keysAndValuesDo:[:index :button | |
|
209 |
button action:[ |
|
210 |
button turnOffWithoutRedraw. |
|
211 |
self hide. |
|
212 |
actionBlock value:index |
|
213 |
] |
|
214 |
]. |
|
215 |
! |
|
216 |
||
217 |
actions:actionBlocks |
|
218 |
"define the actions" |
|
0 | 219 |
|
197 | 220 |
actions := actionBlocks |
221 |
! |
|
222 |
||
223 |
buttonTitles:titles actions:actionBlocks |
|
224 |
"define both button titles and actions" |
|
225 |
||
226 |
self buttonTitles:titles. |
|
227 |
actions := actionBlocks. |
|
228 |
! |
|
0 | 229 |
|
197 | 230 |
buttons |
231 |
"return the buttons collection" |
|
232 |
||
233 |
^ buttons |
|
234 |
! |
|
235 |
||
236 |
defaultButtonIndex:index |
|
847 | 237 |
"define which button is the default (i.e. return-) button. |
238 |
By default, no returnButton is setup. The argument must be an |
|
239 |
index 1..nButtons, or nil" |
|
240 |
||
197 | 241 |
defaultButtonIndex notNil ifTrue:[ |
847 | 242 |
(buttons at:defaultButtonIndex) isReturnButton:false |
197 | 243 |
]. |
244 |
(index notNil and:[index ~~ 0]) ifTrue:[ |
|
847 | 245 |
defaultButtonIndex := index. |
246 |
defaultButtonIndex notNil ifTrue:[ |
|
247 |
(buttons at:defaultButtonIndex) isReturnButton:true |
|
248 |
]. |
|
197 | 249 |
] |
847 | 250 |
|
251 |
"Modified: 18.10.1996 / 14:53:36 / cg" |
|
197 | 252 |
! |
253 |
||
254 |
numberOfOptions |
|
255 |
"return the number of options" |
|
256 |
||
257 |
^ buttons size |
|
258 |
! |
|
259 |
||
260 |
numberOfOptions:nOptions |
|
847 | 261 |
"set the number of options - this is a private interface" |
197 | 262 |
|
263 |
buttons := (OrderedCollection new:nOptions) grow:nOptions. |
|
264 |
actions := (OrderedCollection new:nOptions) grow:nOptions |
|
847 | 265 |
|
266 |
"Modified: 18.10.1996 / 14:54:30 / cg" |
|
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
267 |
! ! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
268 |
|
2227 | 269 |
!OptionBox methodsFor:'accessing-look'! |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
270 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
271 |
buttonTitles:titles |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
272 |
"set the button titles" |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
273 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
274 |
titles keysAndValuesDo:[:index :aString | |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
275 |
|b| |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
276 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
277 |
(b := buttons at:index) label:aString. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
278 |
b resize. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
279 |
]. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
280 |
shown ifTrue:[self resize] |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
281 |
! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
282 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
283 |
form:aFormOrImage |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
284 |
"set the image shown in the label-view" |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
285 |
|
2212
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
286 |
|mm| |
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
287 |
|
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
288 |
mm := ViewSpacing. |
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
289 |
formLabel form:aFormOrImage. |
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
290 |
textLabel origin:((mm + formLabel width + mm) @ mm). |
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
291 |
|
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
292 |
! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
293 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
294 |
formLabel |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
295 |
"return the label-view which displays a bitmap" |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
296 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
297 |
^ formLabel |
197 | 298 |
! |
0 | 299 |
|
2476 | 300 |
image:aFormOrImage |
301 |
"set the image shown in the label-view" |
|
302 |
||
303 |
self form:aFormOrImage |
|
304 |
||
305 |
"Created: / 16.11.2001 / 15:20:02 / cg" |
|
306 |
! |
|
307 |
||
2328 | 308 |
textLabel |
309 |
"return the label-view which displays a message string" |
|
310 |
||
311 |
^ textLabel |
|
312 |
! |
|
313 |
||
0 | 314 |
title:aString |
16 | 315 |
"set the boxes title" |
0 | 316 |
|
16 | 317 |
aString ~= textLabel label ifTrue:[ |
59 | 318 |
textLabel label:aString withoutSeparators. |
110 | 319 |
textLabel forceResize. |
97 | 320 |
shown ifTrue:[self resize] |
16 | 321 |
] |
0 | 322 |
! |
323 |
||
97 | 324 |
title:aString numberOfOptions:nOptions |
325 |
"set the boxes title and number of options" |
|
326 |
||
327 |
self title:aString. |
|
328 |
buttons grow:nOptions. |
|
329 |
actions grow:nOptions |
|
197 | 330 |
! ! |
97 | 331 |
|
197 | 332 |
!OptionBox methodsFor:'events'! |
77 | 333 |
|
197 | 334 |
keyPress:aKey x:x y:y |
335 |
"return-key dublicates ok-function if acceptReturnAsOK is true" |
|
77 | 336 |
|
490 | 337 |
<resource: #keyboard (#Return)> |
338 |
||
197 | 339 |
|action| |
77 | 340 |
|
197 | 341 |
defaultButtonIndex notNil ifTrue:[ |
490 | 342 |
(aKey == #Return) ifTrue:[ |
343 |
self hide. |
|
344 |
action := actions at:defaultButtonIndex. |
|
345 |
action notNil ifTrue:[ |
|
346 |
action value |
|
347 |
] |
|
348 |
] |
|
197 | 349 |
]. |
350 |
super keyPress:aKey x:x y:y |
|
490 | 351 |
|
352 |
"Modified: 7.3.1996 / 13:17:36 / cg" |
|
197 | 353 |
! ! |
0 | 354 |
|
197 | 355 |
!OptionBox methodsFor:'initializing'! |
7 | 356 |
|
197 | 357 |
initFormBitmap |
358 |
WarnBitmap isNil ifTrue:[ |
|
1914 | 359 |
WarnBitmap := WarningBox iconBitmap. |
360 |
"/ WarnBitmap := Image fromFile:'bitmaps/Warning.xbm' resolution:100 on:Display |
|
0 | 361 |
]. |
197 | 362 |
formLabel form:WarnBitmap |
899 | 363 |
|
1914 | 364 |
"Modified: / 25.5.1999 / 16:08:06 / cg" |
0 | 365 |
! |
366 |
||
367 |
initialize |
|
372 | 368 |
|nButt mm| |
0 | 369 |
|
370 |
super initialize. |
|
371 |
||
372 | 372 |
mm := ViewSpacing. |
373 |
||
38 | 374 |
formLabel := Label in:self. |
375 |
self initFormBitmap. |
|
0 | 376 |
formLabel borderWidth:0. |
372 | 377 |
formLabel origin:(mm @ mm). |
0 | 378 |
|
188 | 379 |
textLabel := Label label:'Select' in:self. |
0 | 380 |
textLabel borderWidth:0. |
372 | 381 |
textLabel origin:((mm + formLabel width + mm) @ mm). |
0 | 382 |
|
1612
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
383 |
"/ buttonPanel isNil ifTrue:[ |
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
384 |
"/ buttonPanel := HorizontalPanelView origin:(0.0 @ 1.0) corner:(1.0 @ 1.0) in:self. |
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
385 |
"/ ]. |
130 | 386 |
buttonPanel |
372 | 387 |
bottomInset:mm; |
388 |
topInset:(font height + mm * 2) negated. |
|
130 | 389 |
buttonPanel |
372 | 390 |
borderWidth:0; |
391 |
horizontalLayout:#fitSpace. |
|
59 | 392 |
|
0 | 393 |
nButt := buttons size. |
394 |
||
7 | 395 |
1 to:nButt do:[:index | |
372 | 396 |
|button| |
7 | 397 |
|
372 | 398 |
button := Button label:'press'. |
399 |
button action:[ |
|
400 |
|action| |
|
7 | 401 |
|
372 | 402 |
(buttons at:index) turnOffWithoutRedraw. |
403 |
self hide. |
|
404 |
action := actions at:index. |
|
405 |
action notNil ifTrue:[ |
|
406 |
action value |
|
407 |
] |
|
408 |
]. |
|
133 | 409 |
"/ index == nButt ifTrue:[ |
410 |
"/ button isReturnButton:true |
|
411 |
"/ ]. |
|
372 | 412 |
buttonPanel addSubView:button. |
413 |
buttons at:index put:button. |
|
91 | 414 |
]. |
415 |
||
416 |
" |
|
417 |
|box| |
|
418 |
||
419 |
box := OptionBox title:'hello' numberOfOptions:4. |
|
420 |
box open |
|
421 |
" |
|
372 | 422 |
|
1612
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
423 |
"Modified: / 27.7.1998 / 19:37:17 / cg" |
133 | 424 |
! ! |
425 |
||
63 | 426 |
!OptionBox methodsFor:'queries'! |
0 | 427 |
|
130 | 428 |
preferredExtent |
59 | 429 |
"return a size to make everything fit into myself" |
430 |
||
371 | 431 |
|w w1 h maxH prefPanel mm| |
0 | 432 |
|
799 | 433 |
"/ If I have an explicit preferredExtent .. |
434 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
435 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
436 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
437 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
438 |
|
371 | 439 |
mm := ViewSpacing. |
440 |
||
441 |
w1 := (mm * 3) + formLabel width + textLabel width. |
|
130 | 442 |
prefPanel := buttonPanel preferredExtent. |
91 | 443 |
w := w1 max:prefPanel x. |
38 | 444 |
|
97 | 445 |
"/ maxH := 0. |
446 |
"/ buttons do:[:button | |
|
130 | 447 |
"/ maxH := maxH max:(button preferredExtent y) |
97 | 448 |
"/ ]. |
449 |
maxH := prefPanel y. |
|
0 | 450 |
|
371 | 451 |
h := (mm * 4) |
452 |
+ ((formLabel height) max:(textLabel height)) |
|
453 |
+ maxH. |
|
0 | 454 |
|
59 | 455 |
^ w @ h |
371 | 456 |
|
799 | 457 |
"Modified: 19.7.1996 / 20:45:11 / cg" |
0 | 458 |
! ! |
197 | 459 |
|
847 | 460 |
!OptionBox class methodsFor:'documentation'! |
243 | 461 |
|
462 |
version |
|
2476 | 463 |
^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.50 2001-11-16 14:29:37 cg Exp $' |
243 | 464 |
! ! |