author | Claus Gittinger <cg@exept.de> |
Mon, 20 Feb 2006 22:30:35 +0100 | |
changeset 3260 | 274ba11c1789 |
parent 3211 | 54cb5fb7fd2f |
child 3613 | 0a1963025199 |
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 |
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
16 |
instanceVariableNames:'verticalPanel labelPanel formLabel textLabel buttons actions |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
17 |
defaultButtonIndex' |
355 | 18 |
classVariableNames:'WarnBitmap' |
19 |
poolDictionaries:'' |
|
20 |
category:'Views-DialogBoxes' |
|
0 | 21 |
! |
22 |
||
847 | 23 |
!OptionBox class methodsFor:'documentation'! |
7 | 24 |
|
38 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 28 |
All Rights Reserved |
38 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
7 | 39 |
documentation |
40 |
" |
|
646 | 41 |
CAVEAT: this is a leftover - functionality has been merged into DialogBox |
42 |
PLEASE use one of the `Dialog chooseXXX' methods nstead of OptionBox. |
|
43 |
||
44 |
||
355 | 45 |
Historic note: |
646 | 46 |
originally, ST/X had separate classes for the various entry methods; |
47 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
48 |
In the meantime, the DialogBox class (and therefore its alias: Dialog) |
|
49 |
is going to duplicate most funcionality found in these classes. |
|
355 | 50 |
|
646 | 51 |
In the future, those existing subclasses' functionality is going to |
52 |
be moved fully into Dialog, and the subclasses will be replaced by dummy |
|
53 |
delegators. (They will be kept for backward compatibility, though). |
|
355 | 54 |
|
55 |
||
38 | 56 |
OptionBoxes are like YesNoBoxes but with as many buttons as you like; |
91 | 57 |
this will finally be a superclass of WarnBox and YesNoBox - or maybe merged |
38 | 58 |
all into DialogBox.. |
97 | 59 |
Use them for multiway questions. |
91 | 60 |
For a consistent user interface, the rightmost button is the default return |
97 | 61 |
button (i.e. pressing return in the box performs this buttons function). |
91 | 62 |
|
646 | 63 |
[author:] |
64 |
Claus Gittinger |
|
91 | 65 |
|
646 | 66 |
[see also:] |
67 |
DialogBox |
|
68 |
" |
|
69 |
! |
|
91 | 70 |
|
646 | 71 |
examples |
72 |
" |
|
73 |
[exBegin] |
|
74 |
|box| |
|
97 | 75 |
|
646 | 76 |
box := OptionBox title:'hello' numberOfOptions:4. |
77 |
box showAtPointer |
|
78 |
[exEnd] |
|
97 | 79 |
|
80 |
||
646 | 81 |
[exBegin] |
82 |
|box| |
|
83 |
box := OptionBox title:'hello' numberOfOptions:3. |
|
84 |
box buttonTitles:#('one' 'two' 'three'). |
|
85 |
box showAtPointer |
|
86 |
[exEnd] |
|
97 | 87 |
|
646 | 88 |
performing an action: |
97 | 89 |
|
646 | 90 |
[exBegin] |
91 |
|box| |
|
92 |
box := OptionBox title:'hello' numberOfOptions:3. |
|
93 |
box buttonTitles:#('one' 'two' 'three'). |
|
94 |
box action:[:which | Transcript show:'button '; |
|
95 |
show: which; |
|
655 | 96 |
showCR:' was pressed']. |
646 | 97 |
box showAtPointer |
98 |
[exEnd] |
|
97 | 99 |
|
646 | 100 |
returning a value: |
101 |
[exBegin] |
|
102 |
|what| |
|
133 | 103 |
|
646 | 104 |
what := OptionBox |
105 |
request:('text has not been accepted.\\Your modifications will be lost when continuing.') withCRs |
|
106 |
label:' Attention' |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
107 |
image:(WarningBox iconBitmap) |
3211 | 108 |
buttonLabels:#('Abort' 'Accept' 'Continue') |
646 | 109 |
values:#(#abort #accept #continue). |
655 | 110 |
Transcript showCR:what. |
646 | 111 |
[exEnd] |
3211 | 112 |
|
113 |
||
114 |
use callBack-hook to intercept creation: |
|
115 |
[exBegin] |
|
116 |
|what| |
|
117 |
||
118 |
AboutToOpenBoxNotificationSignal handle:[:ex | |
|
119 |
|box| |
|
120 |
||
121 |
box := ex parameter. |
|
122 |
box verticalPanel |
|
123 |
add:(CheckBox label:'Do no show this Dialog again.' |
|
124 |
model:false asValue). |
|
125 |
ex proceed. |
|
126 |
] do:[ |
|
127 |
what := OptionBox |
|
128 |
request:('bla bla bla bla.\\You must bla bla bla!!') withCRs |
|
129 |
label:' Attention' |
|
130 |
image:(WarningBox iconBitmap) |
|
131 |
buttonLabels:#('Abort' 'Accept' 'Continue') |
|
132 |
values:#(#abort #accept #continue) |
|
133 |
default:#continue. |
|
134 |
]. |
|
135 |
Transcript showCR:what. |
|
136 |
[exEnd] |
|
7 | 137 |
" |
197 | 138 |
! ! |
139 |
||
847 | 140 |
!OptionBox class methodsFor:'instance creation'! |
197 | 141 |
|
142 |
title:titleString numberOfOptions:nOptions |
|
143 |
"create a new optionBox with title, aTitleString and nOptions options" |
|
144 |
||
145 |
|box| |
|
146 |
||
147 |
box := (self basicNew) numberOfOptions:nOptions. |
|
148 |
box device:Screen current. |
|
149 |
box initialize. |
|
150 |
box title:titleString. |
|
151 |
^ box |
|
7 | 152 |
! ! |
153 |
||
2449 | 154 |
!OptionBox class methodsFor:'easy startup'! |
95 | 155 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
156 |
forRequest:title label:label image:anImage buttonLabels:labels values:values default:defaultValue |
2585 | 157 |
"create a new optionBox and return it. |
158 |
Does not open the box." |
|
159 |
||
160 |
|box| |
|
161 |
||
162 |
box := OptionBox title:title numberOfOptions:(labels size). |
|
163 |
box buttonTitles:labels. |
|
164 |
box defaultButtonIndex:(values indexOf:defaultValue). |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
165 |
box label:label; image:anImage. |
2898 | 166 |
values keysAndValuesDo:[:idx :val | |
167 |
val == false ifTrue:[ |
|
168 |
(box buttons at:idx) cursor:(Cursor thumbsDown). |
|
169 |
]. |
|
170 |
val == true ifTrue:[ |
|
171 |
(box buttons at:idx) cursor:(Cursor thumbsUp). |
|
172 |
]. |
|
173 |
]. |
|
2585 | 174 |
^ box |
175 |
||
176 |
"Modified: / 23.2.2000 / 11:59:32 / cg" |
|
177 |
! |
|
178 |
||
2668 | 179 |
request:title buttonLabels:labels values:values |
180 |
"create a new optionBox, open it modal and return the value of |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
181 |
the corresponding values collection. Return nil if cancelled" |
2668 | 182 |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
183 |
^ self |
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
184 |
request:title label:title buttonLabels:labels values:values |
2668 | 185 |
|
186 |
" |
|
187 |
OptionBox |
|
188 |
request:'please select any' |
|
189 |
buttonLabels:#('one' 'two' 'three') |
|
190 |
values:#(1 2 3) |
|
191 |
" |
|
192 |
! |
|
193 |
||
2669 | 194 |
request:title buttonLabels:labels values:values default:defaultValue |
195 |
"create a new optionBox, open it modal and return the value of |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
196 |
the corresponding values collection. Return nil if cancelled." |
2669 | 197 |
|
198 |
^ self |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
199 |
request:title label:title image:(YesNoBox iconBitmap) buttonLabels:labels values:values |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
200 |
default:defaultValue onCancel:nil |
2669 | 201 |
|
202 |
" |
|
203 |
OptionBox |
|
204 |
request:'please select' |
|
205 |
buttonLabels:#('one' 'two' 'three') |
|
206 |
values:#(1 2 3) |
|
207 |
default:3 |
|
208 |
" |
|
209 |
! |
|
210 |
||
2405 | 211 |
request:title label:label buttonLabels:labels values:values |
212 |
"create a new optionBox, open it modal and return the value of |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
213 |
the corresponding values collection. Return nil if cancelled" |
2405 | 214 |
|
215 |
^ self |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
216 |
request:title label:label image:(YesNoBox iconBitmap) |
2405 | 217 |
buttonLabels:labels values:values default:nil onCancel:nil |
2668 | 218 |
|
219 |
" |
|
220 |
OptionBox |
|
221 |
request:'please select' |
|
222 |
label:'select any' |
|
223 |
buttonLabels:#('one' 'two' 'three') |
|
224 |
values:#(1 2 3) |
|
225 |
" |
|
2405 | 226 |
! |
227 |
||
228 |
request:title label:label buttonLabels:labels values:values default:defaultValue |
|
229 |
"create a new optionBox, open it modal and return the value of |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
230 |
the corresponding values collection. Return nil if cancelled" |
2405 | 231 |
|
232 |
^ self |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
233 |
request:title label:label image:(YesNoBox iconBitmap) buttonLabels:labels values:values |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
234 |
default:defaultValue onCancel:nil |
2668 | 235 |
|
236 |
" |
|
237 |
OptionBox |
|
238 |
request:'please select' |
|
239 |
label:'select any' |
|
240 |
buttonLabels:#('one' 'two' 'three') |
|
241 |
values:#(1 2 3) |
|
242 |
default:3 |
|
243 |
" |
|
2405 | 244 |
! |
245 |
||
246 |
request:title label:label buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
|
247 |
"create a new optionBox, open it modal and return the value of |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
248 |
the corresponding values collection. Return cancelValue if cancelled." |
2405 | 249 |
|
250 |
^ self |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
251 |
request:title label:label image:(YesNoBox iconBitmap) buttonLabels:labels values:values |
2405 | 252 |
default:defaultValue onCancel:cancelValue |
2668 | 253 |
|
254 |
" |
|
255 |
OptionBox |
|
256 |
request:'please select' |
|
257 |
label:'select any' |
|
258 |
buttonLabels:#('one' 'two' 'three') |
|
259 |
values:#(1 2 3) |
|
260 |
default:3 |
|
261 |
onCancel:2 |
|
262 |
" |
|
2405 | 263 |
! |
264 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
265 |
request:title label:label image:anImage buttonLabels:labels values:values |
133 | 266 |
"create a new optionBox, open it modal and return the value of |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
267 |
the corresponding values collection. Return nil, if cancelled." |
133 | 268 |
|
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
269 |
^ self |
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
270 |
request:title label:label image:anImage buttonLabels:labels values:values |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
271 |
default:nil onCancel:nil |
2668 | 272 |
|
273 |
" |
|
274 |
OptionBox |
|
275 |
request:'please select' |
|
276 |
label:'select any' |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
277 |
image:(WarningBox iconBitmap) |
2668 | 278 |
buttonLabels:#('one' 'two' 'three') |
279 |
values:#(1 2 3) |
|
280 |
" |
|
133 | 281 |
! |
282 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
283 |
request:title label:label image:anImage buttonLabels:labels values:values default:defaultValue |
95 | 284 |
"create a new optionBox, open it modal and return the value of |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
285 |
the corresponding values collection. Return nil if cancelled." |
95 | 286 |
|
2390 | 287 |
^ self |
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
288 |
request:title label:label image:anImage buttonLabels:labels values:values |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
289 |
default:defaultValue onCancel:nil |
2668 | 290 |
|
291 |
" |
|
292 |
OptionBox |
|
293 |
request:'please select' |
|
294 |
label:'select any' |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
295 |
image:(WarningBox iconBitmap) |
2668 | 296 |
buttonLabels:#('one' 'two' 'three') |
297 |
values:#(1 2 3) |
|
298 |
default:3 |
|
299 |
" |
|
2390 | 300 |
! |
301 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
302 |
request:title label:label image:anImage buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
2390 | 303 |
"create a new optionBox, open it modal and return the value of |
2711
e18e9edca978
by default, return nil if cancelled
Claus Gittinger <cg@exept.de>
parents:
2700
diff
changeset
|
304 |
the corresponding values collection. Return cancelValue if cancelled." |
2390 | 305 |
|
2162 | 306 |
|box retVal| |
95 | 307 |
|
2390 | 308 |
retVal := cancelValue. |
2585 | 309 |
box := self |
310 |
forRequest:title |
|
311 |
label:label |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
312 |
image:anImage |
2585 | 313 |
buttonLabels:labels |
314 |
values:values |
|
315 |
default:defaultValue. |
|
316 |
||
2162 | 317 |
box action:[:n | retVal := values at:n]. |
3211 | 318 |
self showAndThenDestroyBox:box. |
2389 | 319 |
|
2162 | 320 |
^ retVal |
95 | 321 |
|
322 |
" |
|
2668 | 323 |
OptionBox |
324 |
request:'please select' |
|
325 |
label:'select any' |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
326 |
image:(WarningBox iconBitmap) |
2668 | 327 |
buttonLabels:#('one' 'two' 'three') |
328 |
values:#(1 2 3) |
|
329 |
default:3 |
|
330 |
onCancel:nil |
|
95 | 331 |
" |
920 | 332 |
|
2162 | 333 |
"Modified: / 23.2.2000 / 11:59:32 / cg" |
95 | 334 |
! ! |
335 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
336 |
!OptionBox class methodsFor:'obsolete'! |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
337 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
338 |
forRequest:title label:label form:anImage buttonLabels:labels values:values default:defaultValue |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
339 |
"create a new optionBox and return it. |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
340 |
Does not open the box." |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
341 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
342 |
<resource:#obsolete> |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
343 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
344 |
self forRequest:title label:label image:anImage buttonLabels:labels values:values default:defaultValue |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
345 |
! |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
346 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
347 |
request:title label:label form:aForm buttonLabels:labels values:values |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
348 |
"create a new optionBox, open it modal and return the value of |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
349 |
the corresponding values collection. Return nil, if cancelled." |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
350 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
351 |
<resource:#obsolete> |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
352 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
353 |
^ self |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
354 |
request:title label:label image:aForm buttonLabels:labels values:values |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
355 |
default:nil onCancel:nil |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
356 |
! |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
357 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
358 |
request:title label:label form:aForm buttonLabels:labels values:values default:defaultValue |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
359 |
"create a new optionBox, open it modal and return the value of |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
360 |
the corresponding values collection. Return nil if cancelled." |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
361 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
362 |
<resource:#obsolete> |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
363 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
364 |
^ self |
2991 | 365 |
request:title |
366 |
label:label |
|
367 |
image:aForm |
|
368 |
buttonLabels:labels |
|
369 |
values:values |
|
370 |
default:defaultValue |
|
371 |
onCancel:nil |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
372 |
! |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
373 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
374 |
request:title label:label form:aForm buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
375 |
"create a new optionBox, open it modal and return the value of |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
376 |
the corresponding values collection. Return cancelValue if cancelled." |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
377 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
378 |
<resource:#obsolete> |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
379 |
|
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
380 |
^ self request:title label:label image:aForm buttonLabels:labels values:values default:defaultValue onCancel:cancelValue |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
381 |
! ! |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
382 |
|
197 | 383 |
!OptionBox methodsFor:'accessing'! |
384 |
||
385 |
action:actionBlock |
|
386 |
"define a single the action for all buttons. |
|
387 |
The action will be evaluated with the button index as argument." |
|
388 |
||
389 |
buttons keysAndValuesDo:[:index :button | |
|
390 |
button action:[ |
|
391 |
button turnOffWithoutRedraw. |
|
392 |
self hide. |
|
393 |
actionBlock value:index |
|
394 |
] |
|
395 |
]. |
|
396 |
! |
|
397 |
||
398 |
actions:actionBlocks |
|
399 |
"define the actions" |
|
0 | 400 |
|
197 | 401 |
actions := actionBlocks |
402 |
! |
|
403 |
||
404 |
buttonTitles:titles actions:actionBlocks |
|
405 |
"define both button titles and actions" |
|
406 |
||
407 |
self buttonTitles:titles. |
|
408 |
actions := actionBlocks. |
|
409 |
! |
|
0 | 410 |
|
197 | 411 |
defaultButtonIndex:index |
847 | 412 |
"define which button is the default (i.e. return-) button. |
413 |
By default, no returnButton is setup. The argument must be an |
|
414 |
index 1..nButtons, or nil" |
|
415 |
||
197 | 416 |
defaultButtonIndex notNil ifTrue:[ |
847 | 417 |
(buttons at:defaultButtonIndex) isReturnButton:false |
197 | 418 |
]. |
419 |
(index notNil and:[index ~~ 0]) ifTrue:[ |
|
847 | 420 |
defaultButtonIndex := index. |
421 |
defaultButtonIndex notNil ifTrue:[ |
|
422 |
(buttons at:defaultButtonIndex) isReturnButton:true |
|
423 |
]. |
|
197 | 424 |
] |
847 | 425 |
|
426 |
"Modified: 18.10.1996 / 14:53:36 / cg" |
|
197 | 427 |
! |
428 |
||
429 |
numberOfOptions |
|
430 |
"return the number of options" |
|
431 |
||
432 |
^ buttons size |
|
433 |
! |
|
434 |
||
435 |
numberOfOptions:nOptions |
|
847 | 436 |
"set the number of options - this is a private interface" |
197 | 437 |
|
3260 | 438 |
buttons := OrderedCollection withSize:nOptions. |
439 |
actions := OrderedCollection withSize:nOptions |
|
847 | 440 |
|
441 |
"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
|
442 |
! ! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
443 |
|
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
444 |
!OptionBox methodsFor:'accessing-components'! |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
445 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
446 |
buttons |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
447 |
"return the buttons collection" |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
448 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
449 |
^ buttons |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
450 |
! |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
451 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
452 |
labelPanel |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
453 |
^ labelPanel |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
454 |
! |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
455 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
456 |
verticalPanel |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
457 |
^ verticalPanel |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
458 |
! ! |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
459 |
|
2227 | 460 |
!OptionBox methodsFor:'accessing-look'! |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
461 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
462 |
buttonTitles:titles |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
463 |
"set the button titles" |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
464 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
465 |
titles keysAndValuesDo:[:index :aString | |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
466 |
|b| |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
467 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
468 |
(b := buttons at:index) label:aString. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
469 |
b resize. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
470 |
]. |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
471 |
shown ifTrue:[self resize] |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
472 |
! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
473 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
474 |
form:aFormOrImage |
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
475 |
"historical leftover - define a form to be displayed left of the title" |
2212
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
476 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
477 |
<resource:#obsolete> |
2212
7475e8be57bb
recompute label origin, if the form changes
Claus Gittinger <cg@exept.de>
parents:
2162
diff
changeset
|
478 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
479 |
self image:aFormOrImage |
740
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
480 |
! |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
481 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
482 |
formLabel |
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
483 |
"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
|
484 |
|
2d5cb01c7e11
no need for focusSequence - DialogBox does it
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
485 |
^ formLabel |
197 | 486 |
! |
0 | 487 |
|
2476 | 488 |
image:aFormOrImage |
489 |
"set the image shown in the label-view" |
|
490 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
491 |
|mm| |
2476 | 492 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
493 |
mm := ViewSpacing. |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
494 |
formLabel label:aFormOrImage. |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
495 |
textLabel origin:((mm + formLabel width + mm) @ mm). |
2476 | 496 |
! |
497 |
||
2328 | 498 |
textLabel |
499 |
"return the label-view which displays a message string" |
|
500 |
||
501 |
^ textLabel |
|
502 |
! |
|
503 |
||
0 | 504 |
title:aString |
16 | 505 |
"set the boxes title" |
0 | 506 |
|
16 | 507 |
aString ~= textLabel label ifTrue:[ |
59 | 508 |
textLabel label:aString withoutSeparators. |
110 | 509 |
textLabel forceResize. |
97 | 510 |
shown ifTrue:[self resize] |
16 | 511 |
] |
0 | 512 |
! |
513 |
||
97 | 514 |
title:aString numberOfOptions:nOptions |
515 |
"set the boxes title and number of options" |
|
516 |
||
517 |
self title:aString. |
|
518 |
buttons grow:nOptions. |
|
519 |
actions grow:nOptions |
|
197 | 520 |
! ! |
97 | 521 |
|
197 | 522 |
!OptionBox methodsFor:'events'! |
77 | 523 |
|
197 | 524 |
keyPress:aKey x:x y:y |
2700 | 525 |
"return-key duplicates ok-function if acceptReturnAsOK is true" |
77 | 526 |
|
490 | 527 |
<resource: #keyboard (#Return)> |
528 |
||
197 | 529 |
|action| |
77 | 530 |
|
197 | 531 |
defaultButtonIndex notNil ifTrue:[ |
490 | 532 |
(aKey == #Return) ifTrue:[ |
533 |
self hide. |
|
534 |
action := actions at:defaultButtonIndex. |
|
3201 | 535 |
action value |
490 | 536 |
] |
197 | 537 |
]. |
538 |
super keyPress:aKey x:x y:y |
|
490 | 539 |
|
540 |
"Modified: 7.3.1996 / 13:17:36 / cg" |
|
197 | 541 |
! ! |
0 | 542 |
|
2523 | 543 |
!OptionBox methodsFor:'initialization'! |
7 | 544 |
|
197 | 545 |
initFormBitmap |
546 |
WarnBitmap isNil ifTrue:[ |
|
1914 | 547 |
WarnBitmap := WarningBox iconBitmap. |
548 |
"/ WarnBitmap := Image fromFile:'bitmaps/Warning.xbm' resolution:100 on:Display |
|
0 | 549 |
]. |
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2898
diff
changeset
|
550 |
formLabel label:WarnBitmap |
899 | 551 |
|
1914 | 552 |
"Modified: / 25.5.1999 / 16:08:06 / cg" |
0 | 553 |
! |
554 |
||
555 |
initialize |
|
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
556 |
|nButt mm vPanelLayout| |
0 | 557 |
|
558 |
super initialize. |
|
559 |
||
372 | 560 |
mm := ViewSpacing. |
561 |
||
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
562 |
verticalPanel := VerticalPanelView in:self. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
563 |
vPanelLayout := LayoutFrame origin:(mm @ mm) corner:(1.0@1.0). |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
564 |
vPanelLayout bottomOffset:(font height + (mm * 5)) negated. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
565 |
vPanelLayout rightOffset:mm negated. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
566 |
verticalPanel geometryLayout:vPanelLayout. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
567 |
verticalPanel horizontalLayout:#fit. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
568 |
verticalPanel verticalLayout:#bottomFit. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
569 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
570 |
labelPanel := HorizontalPanelView in:verticalPanel. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
571 |
labelPanel horizontalLayout:#leftSpace. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
572 |
labelPanel verticalLayout:#topSpace. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
573 |
labelPanel height:(labelPanel preferredExtent y + (mm * 4)). |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
574 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
575 |
formLabel := Label in:labelPanel. |
38 | 576 |
self initFormBitmap. |
0 | 577 |
formLabel borderWidth:0. |
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
578 |
"/ formLabel origin:(mm @ mm). |
0 | 579 |
|
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
580 |
textLabel := Label label:'Select' in:labelPanel. |
0 | 581 |
textLabel borderWidth:0. |
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
582 |
"/ textLabel origin:((mm + formLabel width + mm) @ mm). |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
583 |
|
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
584 |
verticalPanel resize. |
0 | 585 |
|
1612
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
586 |
"/ buttonPanel isNil ifTrue:[ |
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
587 |
"/ 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
|
588 |
"/ ]. |
130 | 589 |
buttonPanel |
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
590 |
bottomInset:0 "mm"; |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
591 |
topInset:(font height + (mm * 4)) negated. |
130 | 592 |
buttonPanel |
372 | 593 |
borderWidth:0; |
594 |
horizontalLayout:#fitSpace. |
|
59 | 595 |
|
0 | 596 |
nButt := buttons size. |
597 |
||
7 | 598 |
1 to:nButt do:[:index | |
372 | 599 |
|button| |
7 | 600 |
|
372 | 601 |
button := Button label:'press'. |
602 |
button action:[ |
|
603 |
|action| |
|
7 | 604 |
|
372 | 605 |
(buttons at:index) turnOffWithoutRedraw. |
606 |
self hide. |
|
607 |
action := actions at:index. |
|
3201 | 608 |
action value |
372 | 609 |
]. |
133 | 610 |
"/ index == nButt ifTrue:[ |
611 |
"/ button isReturnButton:true |
|
612 |
"/ ]. |
|
372 | 613 |
buttonPanel addSubView:button. |
614 |
buttons at:index put:button. |
|
91 | 615 |
]. |
616 |
||
617 |
" |
|
618 |
|box| |
|
619 |
||
620 |
box := OptionBox title:'hello' numberOfOptions:4. |
|
621 |
box open |
|
622 |
" |
|
372 | 623 |
|
1612
e7d3bc88a533
oops - two buttonPanels where created (MD's fix).
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
624 |
"Modified: / 27.7.1998 / 19:37:17 / cg" |
133 | 625 |
! ! |
626 |
||
63 | 627 |
!OptionBox methodsFor:'queries'! |
0 | 628 |
|
130 | 629 |
preferredExtent |
59 | 630 |
"return a size to make everything fit into myself" |
631 |
||
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
632 |
|w w1 h buttonPanelsPref vPanelsPref mm| |
0 | 633 |
|
799 | 634 |
"/ If I have an explicit preferredExtent .. |
635 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
636 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
637 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
638 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
639 |
|
371 | 640 |
mm := ViewSpacing. |
641 |
||
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
642 |
vPanelsPref := verticalPanel preferredExtent. |
371 | 643 |
w1 := (mm * 3) + formLabel width + textLabel width. |
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
644 |
buttonPanelsPref := buttonPanel preferredExtent. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
645 |
w := w1 max:buttonPanelsPref x. |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
646 |
w := w max:vPanelsPref x. |
38 | 647 |
|
3208
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
648 |
h := mm |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
649 |
+ vPanelsPref y |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
650 |
+ mm |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
651 |
+ buttonPanelsPref y |
7b4c5a215af9
use panels, to allow for hooks to add more widgets.
Claus Gittinger <cg@exept.de>
parents:
3201
diff
changeset
|
652 |
+ mm. |
0 | 653 |
|
59 | 654 |
^ w @ h |
371 | 655 |
|
799 | 656 |
"Modified: 19.7.1996 / 20:45:11 / cg" |
0 | 657 |
! ! |
197 | 658 |
|
847 | 659 |
!OptionBox class methodsFor:'documentation'! |
243 | 660 |
|
661 |
version |
|
3260 | 662 |
^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.63 2006-02-20 21:30:35 cg Exp $' |
243 | 663 |
! ! |