author | Claus Gittinger <cg@exept.de> |
Tue, 21 Oct 1997 20:28:05 +0200 | |
changeset 1355 | 6725ab9cc6f5 |
parent 1317 | e7b4c929b229 |
child 1360 | ede30cea2827 |
permissions | -rw-r--r-- |
76 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
||
1355 | 13 |
'From Smalltalk/X, Version:3.2.1 on 18-oct-1997 at 3:24:10 pm' ! |
1317 | 14 |
|
76 | 15 |
ModalBox subclass:#DialogBox |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
16 |
instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
17 |
acceptReturnAsOK yPosition leftIndent rightIndent addedComponents |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
18 |
inputFieldGroup acceptOnLeave acceptValue tabableElements |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
19 |
hideOnAccept acceptCheck needResize autoAccept focusToOKOnLeave |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
20 |
bindings namedComponents' |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
21 |
classVariableNames:'' |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
22 |
poolDictionaries:'' |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
23 |
category:'Views-DialogBoxes' |
76 | 24 |
! |
25 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
26 |
!DialogBox class methodsFor:'documentation'! |
76 | 27 |
|
197 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
76 | 40 |
! |
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
this class implements the common behavior of dialogboxes. |
|
45 |
||
647 | 46 |
DialogBox is also a superclass of many other boxes - see InfoBox, |
76 | 47 |
WarningBox, YesNoBox etc. for concrete examples. |
48 |
Most of them simply add buttons or other elements. |
|
49 |
||
121 | 50 |
For programmatically created boxes, instances support adding of components |
51 |
in a top-to-bottom fashion, and also keep track of added text-fields and, |
|
52 |
since they are most common, automatically create an EnterFieldGroup for |
|
53 |
them. |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
54 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
55 |
Caveat: |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
56 |
more adding support is required - especially for row-wise |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
57 |
construction. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
58 |
The programmatic interface is best suited for row-wise |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
59 |
arranged components; laying out elements in columns is a bit |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
60 |
complicate - for complicated dialogs, it may be better to not use |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
61 |
the automatic arrangement, but instead give explicit layouts to |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
62 |
the components (in a subclass). |
122 | 63 |
|
600 | 64 |
Compatibility note: |
65 |
For ST-80 compatibility, DialogBox is also accessable under |
|
66 |
the global named 'Dialog' (which is the name of an ST-80 class, |
|
67 |
providing a very similar protocol). |
|
68 |
This may lead to confusion, if DialogBox is recompiled - you have |
|
69 |
to manually assign Dialog again to refer to the new DialogBox class. |
|
70 |
In future versions of ST/X, DialogBox may be renamed to Dialog. |
|
71 |
||
183 | 72 |
Historic note: |
356 | 73 |
originally, ST/X had separate classes for the various entry methods; |
74 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
75 |
ST-80 has all this defined in the common Dialog. |
|
76 |
Therefore, for compatibility, many ST/X methods defined here in Dialogs |
|
77 |
class protocol simply dispatch to some other boxes class method. |
|
78 |
In the future, those existing subclasses' functionality is going to |
|
79 |
be moved full into Dialog, and the subclasses will be replaced by dummy |
|
80 |
delegators. (They will be kept for backward compatibility, though). |
|
183 | 81 |
|
121 | 82 |
|
585 | 83 |
[instance variables:] |
76 | 84 |
|
356 | 85 |
buttonPanel <PanelView> contains the button(s) |
86 |
||
87 |
okButton <Button> the ok-Button |
|
88 |
||
89 |
okAction <Block> the action to be performed when ok is pressed, |
|
90 |
or return is pressed. |
|
91 |
||
92 |
acceptReturnAsOK <Boolean> if true, pressing the return-key counts |
|
93 |
as if ok was pressed. Default is true. |
|
94 |
||
95 |
abortButton <Button> the cancel-Button |
|
96 |
||
97 |
abortAction <Block> the action to be performed when cancel is |
|
98 |
pressed. |
|
99 |
||
100 |
yPosisition <Integer> current y position when adding components |
|
101 |
||
102 |
leftIndent <Integer> left inset to use when adding components |
|
103 |
||
104 |
rightIndent <Integer> right inset to use when adding components |
|
105 |
||
106 |
addedComponents <Collection> programmatically added components |
|
107 |
||
108 |
inputFieldGroup <EnterFieldGroup> |
|
109 |
for added input fields |
|
110 |
||
111 |
acceptOnLeave <Boolean> if true (the default) and there are |
|
112 |
tabable inputFields, accept and close when |
|
113 |
the last field is left. If false, the ok |
|
114 |
button must be pressed to close the box. |
|
115 |
||
116 |
acceptedValue v(<Boolean>) valueHolder on a boolean |
|
117 |
after close: holds true if box was accepted |
|
118 |
(i.e. ok-Button was pressed), false if box was |
|
119 |
closed via cancel or window manager. |
|
121 | 120 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
121 |
autoAccept Boolean if true, pressing ok (or return) |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
122 |
sends #accept to all subcomponents. |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
123 |
I.e. all subfields update their models |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
124 |
first. The default is true. |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
125 |
|
100 | 126 |
For compatibility with ST-80, this class is also available under |
127 |
the global names DialogView and Dialog (see patches file). |
|
585 | 128 |
|
129 |
[author:] |
|
130 |
Claus Gittinger |
|
593 | 131 |
|
132 |
[see also:] |
|
133 |
Button CheckToggle Toggle |
|
134 |
EditField SelectionInListView FileSelectionList |
|
135 |
FramedBox Separator |
|
136 |
( introduction to view programming :html: programming/viewintro.html ) |
|
76 | 137 |
" |
138 |
! |
|
139 |
||
140 |
examples |
|
141 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
142 |
historically, DialogBox was used as an abstract class as a base for InfoBox, |
600 | 143 |
YesNoBox etc. |
144 |
However, the programmatic construction protocol (#addComponent:) |
|
145 |
now allows those classes to be easily replaced and future versions of |
|
146 |
ST/X may do this and make those subclasses obsolete. |
|
147 |
However, dummy stubs will remain to exist for backward compatibility |
|
148 |
(i.e. do not fear using YesNoBox, EnterBox etc.) |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
149 |
|
125 | 150 |
For most simple standard dialogs, there are ready to use |
151 |
methods in the class protocol. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
152 |
|
125 | 153 |
For example: |
154 |
||
155 |
info & warnings: |
|
593 | 156 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
157 |
Dialog information:'hi there' |
593 | 158 |
[exEnd] |
159 |
[exBegin] |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
160 |
Dialog warn:'oops' |
593 | 161 |
[exEnd] |
125 | 162 |
|
163 |
||
164 |
yes/no questions: |
|
593 | 165 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
166 |
(Dialog confirm:'is this simple ?') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
167 |
ifTrue:[ |
655 | 168 |
Transcript showCR:'thats what I expected' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
169 |
] ifFalse:[ |
655 | 170 |
Transcript showCR:'read more examples and documentation' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
171 |
] |
593 | 172 |
[exEnd] |
125 | 173 |
|
174 |
||
175 |
yes/no question with cancel option: |
|
593 | 176 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
177 |
|answer| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
178 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
179 |
answer := Dialog confirmWithCancel:'is this simple ?'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
180 |
answer isNil ifTrue:[ |
655 | 181 |
Transcript showCR:'no easy decision' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
182 |
] ifFalse:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
183 |
answer ifTrue:[ |
655 | 184 |
Transcript showCR:'thats what I expected' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
185 |
] ifFalse:[ |
655 | 186 |
Transcript showCR:'read more examples and documentation' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
187 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
188 |
] |
593 | 189 |
[exEnd] |
125 | 190 |
|
191 |
||
192 |
asking for a string: |
|
593 | 193 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
194 |
|s| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
195 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
196 |
s := Dialog request:'enter your name, please:'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
197 |
s notEmpty ifTrue:[ |
655 | 198 |
Transcript showCR:'you entered: ' , s. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
199 |
] |
593 | 200 |
[exEnd] |
125 | 201 |
|
202 |
||
203 |
asking for a string with given default: |
|
593 | 204 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
205 |
|s| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
206 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
207 |
s := Dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
208 |
request:'enter your name, please:' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
209 |
initialAnswer:(OperatingSystem getLoginName). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
210 |
s notEmpty ifTrue:[ |
655 | 211 |
Transcript showCR:'you entered: ' , s. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
212 |
] |
593 | 213 |
[exEnd] |
125 | 214 |
|
215 |
||
216 |
asking for a filename: |
|
593 | 217 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
218 |
|s| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
219 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
220 |
s := Dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
221 |
requestFileName:'select a file, please:' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
222 |
default:''. |
655 | 223 |
Transcript show:'you entered: '; showCR:s. |
593 | 224 |
[exEnd] |
125 | 225 |
|
226 |
||
1030 | 227 |
with a namefiler pattern: |
228 |
[exBegin] |
|
229 |
|s| |
|
230 |
||
231 |
s := Dialog |
|
232 |
requestFileName:'select a file, please:' |
|
233 |
default:'' |
|
234 |
pattern:'*.rc'. |
|
235 |
Transcript show:'you entered: '; showCR:s. |
|
236 |
[exEnd] |
|
237 |
||
238 |
||
239 |
another namefiler pattern: |
|
240 |
[exBegin] |
|
241 |
|s| |
|
242 |
||
243 |
s := Dialog |
|
244 |
requestFileName:'select a file, please:' |
|
245 |
default:'' |
|
246 |
pattern:'*.rc;*.st;*.h'. |
|
247 |
Transcript show:'you entered: '; showCR:s. |
|
248 |
[exEnd] |
|
249 |
||
250 |
||
125 | 251 |
with changed button label and pattern: |
593 | 252 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
253 |
|s| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
254 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
255 |
s := Dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
256 |
requestFileName:'select a file, please:' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
257 |
default:'' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
258 |
ok:'show' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
259 |
abort:'cancel' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
260 |
pattern:'*.rc'. |
655 | 261 |
Transcript show:'you entered: '; showCR:s. |
593 | 262 |
[exEnd] |
125 | 263 |
|
302 | 264 |
|
265 |
asking for a password: |
|
593 | 266 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
267 |
|s| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
268 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
269 |
s := Dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
270 |
requestPassword:'enter your secret, please:'. |
655 | 271 |
Transcript show:'you entered: '; showCR:s. |
593 | 272 |
[exEnd] |
302 | 273 |
|
645 | 274 |
multiple choice dialogs: |
275 |
[exBegin] |
|
276 |
Dialog |
|
277 |
choose:'choose any' |
|
278 |
fromList:nil |
|
279 |
values:nil |
|
280 |
buttons:#('one' 'two' 'three' 'four') |
|
281 |
values:#(1 2 3 4) |
|
282 |
lines:nil |
|
283 |
cancel:nil |
|
284 |
[exEnd] |
|
285 |
||
286 |
multiple choice dialog, with list & buttons: |
|
287 |
[exBegin] |
|
655 | 288 |
Transcript showCR:( |
645 | 289 |
Dialog |
290 |
choose:'choose example' |
|
291 |
fromList:#('one' 'two' 'three' 'four') |
|
292 |
values:#(1 2 3 4) |
|
293 |
buttons:#('five' 'six' 'seven') |
|
294 |
values:#(5 6 7) |
|
295 |
lines:4 |
|
296 |
cancel:[Transcript flash. #aborted] |
|
297 |
) |
|
298 |
[exEnd] |
|
299 |
||
300 |
You can (and often have to) construct custom dialogs programmatically, |
|
301 |
from individual components. As shown in the following examples: |
|
91 | 302 |
|
121 | 303 |
basic (unusable) example: |
593 | 304 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
305 |
DialogBox new open |
593 | 306 |
[exEnd] |
76 | 307 |
|
121 | 308 |
still unusable - only an ok-button: |
593 | 309 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
310 |
DialogBox new addOkButton; open |
593 | 311 |
[exEnd] |
121 | 312 |
|
313 |
both ok- and abortButtons: |
|
593 | 314 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
315 |
DialogBox new addAbortButton; addOkButton; open |
593 | 316 |
[exEnd] |
121 | 317 |
|
122 | 318 |
with different ok-label: |
593 | 319 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
320 |
DialogBox new addAbortButton; addOkButtonLabelled:'yeah'; open |
593 | 321 |
[exEnd] |
122 | 322 |
|
645 | 323 |
adding a (centered by default) textlabel gives an infoBox: |
593 | 324 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
325 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
326 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
327 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
328 |
open |
593 | 329 |
[exEnd] |
121 | 330 |
|
331 |
a textlabel with abort- and okButton gives a yesNoBox: |
|
593 | 332 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
333 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
334 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
335 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
336 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
337 |
open |
593 | 338 |
[exEnd] |
121 | 339 |
|
340 |
the same, adjusting the labels contents to the left: |
|
593 | 341 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
342 |
|box| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
343 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
344 |
box := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
345 |
(box addTextLabel:'hello') adjust:#left. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
346 |
box addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
347 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
348 |
open |
593 | 349 |
[exEnd] |
121 | 350 |
|
122 | 351 |
with modified buttons: |
593 | 352 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
353 |
|box| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
354 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
355 |
box := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
356 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
357 |
box addAbortButtonLabelled:'not really'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
358 |
(box addOkButtonLabelled:'yes, absolutely') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
359 |
activeBackgroundColor:Color red. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
360 |
box open |
593 | 361 |
[exEnd] |
122 | 362 |
|
363 |
||
645 | 364 |
mswindows style (different up/down bitmaps in buttons): |
365 |
((try tabbing ...) |
|
593 | 366 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
367 |
|b box| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
368 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
369 |
box := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
370 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
371 |
b := Button new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
372 |
b activeLogo:(Image fromFile:'bitmaps/cancel_down.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
373 |
b passiveLogo:(Image fromFile:'bitmaps/cancel_up.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
374 |
b focusLogo:(Image fromFile:'bitmaps/cancel_focus.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
375 |
b beImageButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
376 |
box addAbortButton:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
377 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
378 |
b := Button new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
379 |
b activeLogo:(Image fromFile:'bitmaps/ok_down.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
380 |
b passiveLogo:(Image fromFile:'bitmaps/ok_up.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
381 |
b focusLogo:(Image fromFile:'bitmaps/ok_focus.bmp'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
382 |
b beImageButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
383 |
box addOkButton:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
384 |
box open |
593 | 385 |
[exEnd] |
162 | 386 |
|
387 |
||
121 | 388 |
two textlabels: |
593 | 389 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
390 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
391 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
392 |
addTextLabel:'world'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
393 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
394 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
395 |
open |
593 | 396 |
[exEnd] |
118 | 397 |
|
121 | 398 |
fixing the dialogs size (suppres it calculating its size from the |
130 | 399 |
preferredExtents of its components): |
593 | 400 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
401 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
402 |
label:'a simple dialog'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
403 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
404 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
405 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
406 |
extent:200@200; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
407 |
sizeFixed:true; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
408 |
open |
593 | 409 |
[exEnd] |
118 | 410 |
|
121 | 411 |
asking the box if it was closed via ok: |
593 | 412 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
413 |
(DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
414 |
label:'a simple dialog'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
415 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
416 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
417 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
418 |
extent:200@200; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
419 |
sizeFixed:true; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
420 |
open |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
421 |
) accepted ifTrue:[ |
655 | 422 |
Transcript showCR:'yes' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
423 |
] ifFalse:[ |
655 | 424 |
Transcript showCR:'no' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
425 |
] |
593 | 426 |
[exEnd] |
118 | 427 |
|
121 | 428 |
textLabels are not limited to strings (although, the name which is |
429 |
used for ST-80 compatibility, suggests it): |
|
593 | 430 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
431 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
432 |
addTextLabel:(Image fromFile:'bitmaps/garfield.gif'); |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
433 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
434 |
open |
593 | 435 |
[exEnd] |
436 |
||
437 |
[exBegin] |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
438 |
DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
439 |
addTextLabel:'hello'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
440 |
addTextLabel:((Image fromFile:'bitmaps/garfield.gif') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
441 |
magnifiedTo:200@150); |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
442 |
addTextLabel:'world'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
443 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
444 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
445 |
open |
593 | 446 |
[exEnd] |
120 | 447 |
|
121 | 448 |
adding an input field (on a string model): |
593 | 449 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
450 |
|stringModel| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
451 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
452 |
stringModel := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
453 |
(DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
454 |
addTextLabel:'Please enter a string:'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
455 |
addInputFieldOn:stringModel; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
456 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
457 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
458 |
open |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
459 |
) accepted ifTrue:[ |
655 | 460 |
Transcript showCR:'entered: ', stringModel value |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
461 |
] |
593 | 462 |
[exEnd] |
120 | 463 |
|
464 |
||
121 | 465 |
multiple input fields (notice, that the dialog connects the fields |
466 |
in a group, so stepping is allowed via Cursor and Return keys): |
|
593 | 467 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
468 |
|firstName lastName| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
469 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
470 |
firstName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
471 |
lastName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
472 |
(DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
473 |
addTextLabel:'Please enter your name:'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
474 |
addInputFieldOn:firstName; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
475 |
addVerticalSpace; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
476 |
addInputFieldOn:lastName; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
477 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
478 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
479 |
open |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
480 |
) accepted ifTrue:[ |
655 | 481 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
482 |
] |
593 | 483 |
[exEnd] |
121 | 484 |
|
485 |
||
486 |
of course, the model may contain a value initially: |
|
593 | 487 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
488 |
|firstName lastName p line i name| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
489 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
490 |
firstName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
491 |
lastName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
492 |
p := PipeStream readingFrom:'finger ' , OperatingSystem getLoginName. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
493 |
p notNil ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
494 |
line := p nextLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
495 |
(i := line findString:'Name:') ~~ 0 ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
496 |
name := line copyFrom:(i + 'Name:' size). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
497 |
] ifFalse:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
498 |
(i := line findString:'real life:') == 0 ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
499 |
line := p nextLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
500 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
501 |
(i := line findString:'real life:') ~~ 0 ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
502 |
name := line copyFrom:(i + 'real life:' size). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
503 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
504 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
505 |
name notNil ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
506 |
firstName value: name asCollectionOfWords first. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
507 |
lastName value: name asCollectionOfWords last. |
655 | 508 |
Transcript showCR:'initially ' , firstName value , ' ' , lastName value. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
509 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
510 |
p close. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
511 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
512 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
513 |
(DialogBox new |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
514 |
addTextLabel:'Please enter your name:'; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
515 |
addInputFieldOn:firstName; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
516 |
addVerticalSpace; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
517 |
addInputFieldOn:lastName; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
518 |
addAbortButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
519 |
addOkButton; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
520 |
open |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
521 |
) accepted ifTrue:[ |
655 | 522 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
523 |
] |
593 | 524 |
[exEnd] |
121 | 525 |
|
120 | 526 |
|
302 | 527 |
validated password entry: |
593 | 528 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
529 |
|box firstEntry secondEntry| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
530 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
531 |
firstEntry := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
532 |
secondEntry := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
533 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
534 |
box := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
535 |
(box addTextLabel:'Please enter your secret:') adjust:#left. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
536 |
(box addInputFieldOn:firstEntry) passwordCharacter:$*. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
537 |
box addVerticalSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
538 |
(box addInputFieldOn:secondEntry) passwordCharacter:$*. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
539 |
box addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
540 |
box addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
541 |
box open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
542 |
box accepted ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
543 |
firstEntry value ~= secondEntry value ifTrue:[ |
655 | 544 |
Transcript showCR:'wrong input - try again' |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
545 |
] ifFalse:[ |
655 | 546 |
Transcript showCR:'entered: ', firstEntry value |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
547 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
548 |
] |
593 | 549 |
[exEnd] |
550 |
||
551 |
input fields with a label: |
|
552 |
[exBegin] |
|
553 |
|box firstNameHolder middleNameHolder lastNameHolder| |
|
554 |
||
555 |
firstNameHolder := 'John' asValue. |
|
556 |
middleNameHolder := 'F' asValue. |
|
557 |
lastNameHolder := 'Peters' asValue. |
|
558 |
||
559 |
box := DialogBox new. |
|
560 |
box |
|
561 |
addLabelledInputField:'first name:' |
|
562 |
adjust:#right |
|
563 |
on:firstNameHolder |
|
564 |
tabable:true |
|
565 |
separateAtX:0.4. |
|
566 |
||
567 |
box |
|
568 |
addLabelledInputField:'middle initial:' |
|
569 |
adjust:#right |
|
570 |
on:middleNameHolder |
|
571 |
tabable:true |
|
572 |
separateAtX:0.4. |
|
573 |
||
574 |
box |
|
575 |
addLabelledInputField:'last name:' |
|
576 |
adjust:#right |
|
577 |
on:lastNameHolder |
|
578 |
tabable:true |
|
579 |
separateAtX:0.4. |
|
580 |
||
581 |
box addOkButton. |
|
582 |
box open. |
|
583 |
[exEnd] |
|
584 |
||
585 |
||
586 |
constructing a dialog from other elements: |
|
121 | 587 |
adding a fileSelectionList: |
588 |
(since the dialog adds the component with its preferred extent, |
|
589 |
ignoring the 300-height, this looks ugly ... |
|
590 |
... especially when resized vertically) |
|
593 | 591 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
592 |
|top l scr fileName| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
593 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
594 |
fileName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
595 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
596 |
top := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
597 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
598 |
l := FileSelectionList new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
599 |
l useIndex:false. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
600 |
l doubleClickAction:[:name | top okPressed]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
601 |
l action:[:name | fileName value:name]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
602 |
scr := ScrollableView forView:l. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
603 |
scr extent:(1.0 @ 300). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
604 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
605 |
top addComponent:scr. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
606 |
top addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
607 |
top openModal. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
608 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
609 |
top accepted ifTrue:[ |
655 | 610 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
611 |
] |
593 | 612 |
[exEnd] |
121 | 613 |
|
614 |
same, looks better, since the height is made larger (not using |
|
615 |
fileLists preferredExtent): |
|
593 | 616 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
617 |
|top l scr fileName| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
618 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
619 |
fileName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
620 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
621 |
top := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
622 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
623 |
l := FileSelectionList new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
624 |
l useIndex:false. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
625 |
l doubleClickAction:[:name | top okPressed]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
626 |
l action:[:name | fileName value:name]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
627 |
scr := ScrollableView forView:l. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
628 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
629 |
top addComponent:scr withExtent:300@300. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
630 |
top addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
631 |
top openModal. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
632 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
633 |
top accepted ifTrue:[ |
655 | 634 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
635 |
] |
593 | 636 |
[exEnd] |
121 | 637 |
|
638 |
||
639 |
again, setting the boxes initial size and fixing it |
|
130 | 640 |
(let it ignore the components' preferredExtent): |
593 | 641 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
642 |
|top fixFrame l scr fileName| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
643 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
644 |
fileName := '' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
645 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
646 |
top := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
647 |
top extent:300@300. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
648 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
649 |
fixFrame := View new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
650 |
fixFrame extent:(1.0 @ 300). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
651 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
652 |
l := FileSelectionList new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
653 |
l useIndex:false. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
654 |
l doubleClickAction:[:name | top okPressed]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
655 |
l action:[:name | fileName value:name]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
656 |
scr := ScrollableView forView:l. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
657 |
scr origin:0.0@0.0 corner:1.0@1.0. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
658 |
fixFrame add:scr. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
659 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
660 |
top addComponent:fixFrame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
661 |
top addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
662 |
top openModal. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
663 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
664 |
top accepted ifTrue:[ |
655 | 665 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
666 |
] |
593 | 667 |
[exEnd] |
118 | 668 |
|
669 |
||
670 |
adding a panel with checkBoxes: |
|
593 | 671 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
672 |
|top panel b value1 value2 value3 value4| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
673 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
674 |
value1 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
675 |
value2 := false asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
676 |
value3 := false asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
677 |
value4 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
678 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
679 |
top := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
680 |
top extent:200@300. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
681 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
682 |
panel := VerticalPanelView new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
683 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
684 |
b := CheckBox on:value1. b label:'check1'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
685 |
panel addSubView:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
686 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
687 |
b := CheckBox on:value2. b label:'check2'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
688 |
panel addSubView:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
689 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
690 |
b := CheckBox on:value3. b label:'check3'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
691 |
panel addSubView:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
692 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
693 |
b := CheckBox on:value4. b label:'check4'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
694 |
panel addSubView:b. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
695 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
696 |
top addComponent:panel. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
697 |
top addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
698 |
top open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
699 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
700 |
top accepted ifTrue:[ |
655 | 701 |
Transcript show:'value1: '; showCR:value1 value. |
702 |
Transcript show:'value2: '; showCR:value2 value. |
|
703 |
Transcript show:'value3: '; showCR:value3 value. |
|
704 |
Transcript show:'value4: '; showCR:value4 value. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
705 |
] |
593 | 706 |
[exEnd] |
118 | 707 |
|
120 | 708 |
same, using a more convenient interface: |
593 | 709 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
710 |
|box value1 value2 value3 value4| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
711 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
712 |
value1 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
713 |
value2 := false asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
714 |
value3 := false asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
715 |
value4 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
716 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
717 |
box := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
718 |
box extent:200@300. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
719 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
720 |
box addCheckBox:'check1' on:value1. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
721 |
box addVerticalSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
722 |
box addCheckBox:'check2' on:value2. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
723 |
box addVerticalSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
724 |
box addCheckBox:'check3' on:value3. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
725 |
box addVerticalSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
726 |
box addCheckBox:'check4' on:value4. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
727 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
728 |
box addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
729 |
box open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
730 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
731 |
box accepted ifTrue:[ |
655 | 732 |
Transcript show:'value1: '; showCR:value1 value. |
733 |
Transcript show:'value2: '; showCR:value2 value. |
|
734 |
Transcript show:'value3: '; showCR:value3 value. |
|
735 |
Transcript show:'value4: '; showCR:value4 value. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
736 |
] |
593 | 737 |
[exEnd] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
738 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
739 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
740 |
same, using an even better interface: |
593 | 741 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
742 |
|box values labels| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
743 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
744 |
values := #(true false false true) collect:[:val | val asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
745 |
labels := #('check1' 'check2' 'check3' 'check4'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
746 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
747 |
box := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
748 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
749 |
box |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
750 |
addColumn:(1 to:labels size) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
751 |
fromX:0.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
752 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
753 |
collect:[:index | CheckBox label:(labels at:index) model:(values at:index)] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
754 |
tabable:true. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
755 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
756 |
box addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
757 |
box open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
758 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
759 |
box accepted ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
760 |
values with:labels do:[:val :lbl | |
655 | 761 |
Transcript show:(lbl , ': '); showCR:val value. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
762 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
763 |
] |
593 | 764 |
[exEnd] |
126 | 765 |
|
766 |
||
164 | 767 |
adding two panels in a frame: |
593 | 768 |
[exBegin] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
769 |
|box frame vPanel1 vPanel2 m1 m2 m3 m4 chk ef| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
770 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
771 |
box := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
772 |
box label:'example'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
773 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
774 |
frame := FramedBox label:'frame'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
775 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
776 |
vPanel1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
777 |
vPanel1 horizontalLayout:#leftSpace. |
644 | 778 |
vPanel1 verticalLayout:#spreadSpace. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
779 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
780 |
vPanel2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
781 |
vPanel2 horizontalLayout:#leftSpace. |
644 | 782 |
vPanel2 verticalLayout:#spreadSpace. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
783 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
784 |
m1 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
785 |
m2 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
786 |
m3 := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
787 |
m4 := 'hello' asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
788 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
789 |
vPanel1 add:(Label label:'check1'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
790 |
vPanel1 add:(Label label:'m2'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
791 |
vPanel1 add:(Label label:'m3'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
792 |
vPanel1 add:(Label label:'enter'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
793 |
vPanel1 add:(Label label:'lbl1'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
794 |
vPanel1 add:(Label label:'lbl2'). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
795 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
796 |
vPanel2 add:(chk := CheckToggle on:m1). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
797 |
box makeTabable:chk. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
798 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
799 |
vPanel2 add:(chk := CheckToggle on:m2). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
800 |
box makeTabable:chk. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
801 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
802 |
vPanel2 add:(chk := CheckToggle on:m3). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
803 |
box makeTabable:chk. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
804 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
805 |
vPanel2 add:(chk := CheckToggle on:m3). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
806 |
box makeTabable:chk. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
807 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
808 |
vPanel2 add:(chk := CheckToggle on:m3). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
809 |
box makeTabable:chk. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
810 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
811 |
vPanel2 add:(ef := EditField on:m4). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
812 |
ef immediateAccept:true. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
813 |
box makeTabable:ef. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
814 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
815 |
box addComponent:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
816 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
817 |
box addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
818 |
box openModal. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
819 |
box accepted ifTrue:[ |
655 | 820 |
Transcript showCR:'accepted with:'. |
821 |
Transcript showCR:' m1: ' , m1 value printString. |
|
822 |
Transcript showCR:' m2: ' , m2 value printString. |
|
823 |
Transcript showCR:' m3: ' , m3 value printString. |
|
824 |
Transcript showCR:' m4: ' , m4 value printString. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
825 |
] |
593 | 826 |
[exEnd] |
827 |
||
828 |
||
829 |
||
830 |
a full example (combined settings dialog - as in launcher): |
|
831 |
[exBegin] |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
832 |
|box warnSTX allowUnderscore immutableArrays logDoits |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
833 |
listOfLanguages listOfStyles styleNames |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
834 |
frame panel c resourceDir dir | |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
835 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
836 |
warnSTX := Compiler warnSTXSpecials asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
837 |
allowUnderscore := Compiler allowUnderscoreInIdentifier asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
838 |
immutableArrays := Compiler arraysAreImmutable asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
839 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
840 |
logDoits := Smalltalk logDoits asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
841 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
842 |
listOfLanguages := SelectionInList with:#('english' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
843 |
'french' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
844 |
'german' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
845 |
'italian' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
846 |
'spanish' |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
847 |
). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
848 |
listOfLanguages selection:(Language asString). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
849 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
850 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
851 |
resourceDir := Smalltalk getSystemFileName:'resources'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
852 |
dir := FileDirectory directoryNamed:resourceDir. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
853 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
854 |
styleNames := dir select:[:aFileName | aFileName endsWith:'.style']. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
855 |
styleNames := styleNames collect:[:aFileName | aFileName copyWithoutLast:6]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
856 |
listOfStyles := SelectionInList with:styleNames sort. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
857 |
listOfStyles selection:(View defaultStyle asString). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
858 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
859 |
box := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
860 |
box label:'Settings'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
861 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
862 |
frame := FramedBox label:'Compiler'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
863 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
864 |
panel horizontalLayout:#leftSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
865 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
866 |
panel add:((CheckBox on:warnSTX) label:'warn about ST/X language extensions'; resize). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
867 |
panel add:((CheckBox on:allowUnderscore) label:'allow underscore in identifiers'; resize). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
868 |
panel add:((CheckBox on:immutableArrays) label:'literal arrays are immutable'; resize). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
869 |
box addComponent:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
870 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
871 |
frame := FramedBox label:'Misc'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
872 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
873 |
panel horizontalLayout:#leftSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
874 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
875 |
panel add:((CheckBox on:logDoits) label:'log doIts in changes file'; resize). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
876 |
box addComponent:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
877 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
878 |
frame := FramedBox label:'Language'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
879 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
880 |
panel horizontalLayout:#leftSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
881 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
882 |
panel add:((PopUpList on:listOfLanguages) width:0.5). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
883 |
box addComponent:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
884 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
885 |
frame := FramedBox label:'Style'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
886 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
887 |
panel horizontalLayout:#leftSpace. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
888 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
889 |
panel add:((PopUpList on:listOfStyles) width:0.5). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
890 |
box addComponent:frame. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
891 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
892 |
box addAbortButton; addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
893 |
box showAtPointer. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
894 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
895 |
box accepted ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
896 |
Transcript topView withCursor:Cursor wait do:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
897 |
Compiler warnSTXSpecials:warnSTX value. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
898 |
Compiler allowUnderscoreInIdentifier:allowUnderscore value. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
899 |
Compiler arraysAreImmutable:immutableArrays value. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
900 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
901 |
Smalltalk logDoits:logDoits value. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
902 |
|
655 | 903 |
Transcript showCR:'change language to ' , listOfLanguages selection , ' ...'. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
904 |
Smalltalk at:#Language put:listOfLanguages selection asSymbol. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
905 |
Smalltalk changed:#Language. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
906 |
ResourcePack flushCachedResourcePacks. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
907 |
|
655 | 908 |
Transcript showCR:'change style to ' , listOfStyles selection , ' ...'. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
909 |
View defaultStyle:listOfStyles selection asSymbol. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
910 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
911 |
] |
593 | 912 |
[exEnd] |
625 | 913 |
an example from Hopkins/Horan: |
644 | 914 |
[exBegin] |
625 | 915 |
|aText index| |
916 |
||
917 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
|
918 |
index := aText findString:'Smalltalk/X' startingAt:1. |
|
919 |
aText emphasizeFrom:index |
|
920 |
to:'Smalltalk/X' size + index - 1 |
|
921 |
with:#bold. |
|
922 |
index := aText findString:'Introduction' startingAt:index. |
|
923 |
aText emphasizeFrom:index |
|
924 |
to:'Introduction' size + index - 1 |
|
925 |
with:#italic. |
|
644 | 926 |
Dialog warn:aText |
625 | 927 |
|
928 |
[exEnd] |
|
929 |
the same, with colors: |
|
644 | 930 |
[exBegin] |
625 | 931 |
|aText index| |
932 |
||
933 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
|
934 |
index := aText findString:'Smalltalk/X' startingAt:1. |
|
935 |
aText emphasizeFrom:index |
|
936 |
to:'Smalltalk/X' size + index - 1 |
|
937 |
with:(Array with:#bold with:#underline with:(#color->Color red)). |
|
938 |
index := aText findString:'Introduction' startingAt:index. |
|
939 |
aText emphasizeFrom:index |
|
940 |
to:'Introduction' size + index - 1 |
|
941 |
with:#italic. |
|
644 | 942 |
Dialog warn:aText |
625 | 943 |
[exEnd] |
76 | 944 |
" |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
945 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
946 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
947 |
inputFocus |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
948 |
" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
949 |
a DialogBox with multiple input fields can be configured on how it |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
950 |
shall behave if the RETURN key is pressed. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
951 |
|
600 | 952 |
The default is to shift the focus to the ok-button - thus, another return |
953 |
has to be entered (as confirmation) to close & accept the box. |
|
954 |
||
955 |
This can be changed to force an automatic OK with: |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
956 |
aBox focusToOKOnLeave:false |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
957 |
|
600 | 958 |
Then, leaving the last field with return, automatically accepts the box, |
959 |
as if ok was pressed. (useful for simple - single entry dialogs). |
|
960 |
All simple dialogs (like 'enter a searchString') behave this way. |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
961 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
962 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
963 |
With: |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
964 |
aBox acceptReturnAsOK:false |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
965 |
|
600 | 966 |
any focusShift or automatic OK is turned off, and the input group |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
967 |
switches its focus back to the topMost field. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
968 |
The default for this is true. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
969 |
(useful, if you want an explicit ok from the user, or need all fields |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
970 |
to be handled somehow). |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
971 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
972 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
973 |
Simply leaving the group with a cursor movement may also be either |
600 | 974 |
interpreted as a return (the default), or again wrap back to the top |
975 |
of the group. |
|
976 |
||
977 |
With: |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
978 |
aBox acceptOnLeave:false |
600 | 979 |
this is turned off, so that with cursor-down, the focus is moved back |
980 |
to the first entry field. The default is true. |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
981 |
" |
76 | 982 |
! ! |
983 |
||
1102 | 984 |
!DialogBox class methodsFor:'ST80 compatibility'! |
985 |
||
986 |
confirm:aMessageString for:ignoredView |
|
987 |
"ST-80 compatibility - confirm using the same viewStyle as in the view |
|
988 |
argument; not supported in ST/X (who mixes styles ?)" |
|
989 |
||
990 |
^ self confirm:aMessageString |
|
991 |
||
992 |
"Created: 6.3.1997 / 15:45:54 / cg" |
|
993 |
! |
|
994 |
||
995 |
warn:aMessageString for:ignoredView |
|
996 |
"ST-80 compatibility - warn using the same viewStyle as in the view |
|
997 |
argument; not supported in ST/X (who mixes styles ?)" |
|
998 |
||
999 |
^ self warn:aMessageString |
|
1000 |
||
1001 |
"Created: 6.3.1997 / 15:46:02 / cg" |
|
1002 |
! ! |
|
1003 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1004 |
!DialogBox class methodsFor:'class initialization'! |
498 | 1005 |
|
1006 |
initialize |
|
528
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1007 |
self == DialogBox ifTrue:[ |
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1008 |
Dialog := self |
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1009 |
] |
498 | 1010 |
|
1011 |
"Created: 8.3.1996 / 21:18:54 / cg" |
|
528
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1012 |
"Modified: 10.4.1996 / 08:16:18 / cg" |
498 | 1013 |
! ! |
1014 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1015 |
!DialogBox class methodsFor:'common dialogs'! |
100 | 1016 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1017 |
information:aString |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1018 |
"launch a Dialog to tell user something" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1019 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1020 |
(InfoBox title:aString) showAtPointer; destroy |
197 | 1021 |
|
1022 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1023 |
Dialog information:'help' |
197 | 1024 |
" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1025 |
|
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1026 |
"Modified: 29.5.1996 / 15:23:03 / cg" |
197 | 1027 |
! |
1028 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1029 |
warn:aString |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1030 |
"launch a Dialog to warn user" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1031 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1032 |
(WarningBox title:aString) showAtPointer; destroy |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1033 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1034 |
" |
625 | 1035 |
Dialog warn:'some warning message' |
1036 |
||
1037 |
Dialog warn:('some text with italic emphasis' asText |
|
1038 |
emphasizeFrom:16 to:22 with:#italic) |
|
1039 |
||
1040 |
Dialog warn:('some warning message' asText |
|
1041 |
emphasizeAllWith:(#color->Color red)) |
|
1042 |
||
1043 |
Dialog warn:('some text with color emphasis' asText |
|
1044 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
|
1045 |
emphasizeFrom:16 to:20 with:(#color->Color red)) |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1046 |
" |
625 | 1047 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1048 |
"Modified: 29.5.1996 / 15:23:14 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1049 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1050 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1051 |
!DialogBox class methodsFor:'confirmation dialogs'! |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1052 |
|
197 | 1053 |
confirm:aString |
1054 |
"launch a Dialog, which allows user to enter yes or no. |
|
1055 |
return true for yes, false for no" |
|
1056 |
||
498 | 1057 |
^ self |
1058 |
confirm:aString |
|
884 | 1059 |
title:(self classResources string:'confirm') |
498 | 1060 |
yesLabel:nil |
1061 |
noLabel:nil |
|
1062 |
||
1063 |
"/ |box answer| |
|
1064 |
"/ |
|
1065 |
"/ box := YesNoBox title:aString. |
|
1066 |
"/ box label:(self classResources string:'Confirm'). |
|
1067 |
"/ box yesAction:[answer := true] noAction:[answer := false]. |
|
1068 |
"/ box showAtPointer. |
|
1069 |
"/ box yesAction:nil noAction:nil. |
|
1070 |
"/ ^ answer |
|
197 | 1071 |
|
1072 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1073 |
Dialog confirm:'really ?' |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1074 |
|
655 | 1075 |
Transcript showCR:( |
414 | 1076 |
Dialog confirm:'are you certain ?' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1077 |
) |
197 | 1078 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1079 |
|
881 | 1080 |
"Modified: 14.11.1996 / 16:02:30 / cg" |
197 | 1081 |
! |
1082 |
||
1083 |
confirm:aString initialAnswer:what |
|
1084 |
"launch a Dialog, which allows user to enter yes or no. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1085 |
return true for yes, false for no. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1086 |
InitialAnswer must be true or false and defines which button is to be |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1087 |
the default (i.e. return-) button" |
197 | 1088 |
|
1089 |
|box answer| |
|
1090 |
||
1091 |
box := YesNoBox title:aString. |
|
1092 |
box yesAction:[answer := true] noAction:[answer := false]. |
|
1093 |
what == false ifTrue:[ |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1094 |
box okButton isReturnButton:false. |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1095 |
box acceptReturnAsOK:false. |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1096 |
box noButton beReturnButton. |
197 | 1097 |
]. |
884 | 1098 |
box label:(self classResources string:'confirm'). |
197 | 1099 |
box showAtPointer. |
1100 |
box yesAction:nil noAction:nil. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1101 |
box destroy. |
197 | 1102 |
^ answer |
1103 |
||
1104 |
" |
|
1105 |
Dialog confirm:'really ?' initialAnswer:false |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1106 |
|
655 | 1107 |
Transcript showCR:( |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1108 |
Dialog confirm:'are you certain ?' initialAnswer:false |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1109 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1110 |
|
655 | 1111 |
Transcript showCR:( |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1112 |
Dialog confirm:'are you certain ?' initialAnswer:true |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1113 |
) |
197 | 1114 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1115 |
|
881 | 1116 |
"Modified: 14.11.1996 / 16:04:13 / cg" |
197 | 1117 |
! |
1118 |
||
498 | 1119 |
confirm:aString title:title yesLabel:yesText noLabel:noText |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1120 |
"launch a Dialog, which allows user to enter yes or no. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1121 |
return true for yes, false for no. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1122 |
The yes/no buttons labels are defined by yesText/noText." |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1123 |
|
881 | 1124 |
|box answer t| |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1125 |
|
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1126 |
box := YesNoBox title:aString. |
498 | 1127 |
yesText notNil ifTrue:[ |
1128 |
box yesLabel:yesText. |
|
1129 |
]. |
|
1130 |
noText notNil ifTrue:[ |
|
1131 |
box noLabel:noText. |
|
1132 |
]. |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1133 |
box yesAction:[answer := true] noAction:[answer := false]. |
498 | 1134 |
title notNil ifTrue:[ |
881 | 1135 |
t := title |
1136 |
] ifFalse:[ |
|
884 | 1137 |
t := self classResources string:'confirm' |
498 | 1138 |
]. |
881 | 1139 |
box label:t. |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1140 |
box showAtPointer. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1141 |
box yesAction:nil noAction:nil. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1142 |
box destroy. |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1143 |
^ answer |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1144 |
|
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1145 |
" |
498 | 1146 |
Dialog |
1147 |
confirm:'really ?' |
|
1148 |
title:'fooBar' |
|
1149 |
yesLabel:'oh well' |
|
1150 |
noLabel:'nope' |
|
1151 |
" |
|
1152 |
||
881 | 1153 |
" |
1154 |
Dialog |
|
1155 |
confirm:'really ?' |
|
1156 |
title:nil |
|
1157 |
yesLabel:'oh well' |
|
1158 |
noLabel:'nope' |
|
1159 |
" |
|
1160 |
||
1161 |
" |
|
1162 |
Dialog |
|
1163 |
confirm:'really ?' |
|
1164 |
title:'' |
|
1165 |
yesLabel:'oh well' |
|
1166 |
noLabel:'nope' |
|
1167 |
" |
|
1168 |
||
498 | 1169 |
"Created: 21.2.1996 / 01:10:14 / cg" |
881 | 1170 |
"Modified: 14.11.1996 / 16:05:41 / cg" |
498 | 1171 |
! |
1172 |
||
1173 |
confirm:aString yesLabel:yesText noLabel:noText |
|
1174 |
"launch a Dialog, which allows user to enter yes or no. |
|
1175 |
return true for yes, false for no. |
|
1176 |
The yes/no buttons labels are defined by yesText/noText." |
|
1177 |
||
1178 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText |
|
1179 |
||
1180 |
" |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1181 |
Dialog confirm:'really ?' yesLabel:'oh well' noLabel:'nope' |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1182 |
" |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1183 |
|
374 | 1184 |
"Created: 21.2.1996 / 01:10:14 / cg" |
498 | 1185 |
"Modified: 8.3.1996 / 21:15:06 / cg" |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1186 |
! |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1187 |
|
197 | 1188 |
confirmWithCancel:aString |
1189 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1190 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1191 |
||
1004 | 1192 |
^ self confirmWithCancel:aString default:nil |
1193 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1194 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1195 |
Dialog confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1196 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1197 |
|
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1198 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1199 |
Transcript showCR:( |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1200 |
Dialog confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1201 |
) |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1202 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1203 |
|
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1204 |
"Modified: 18.10.1996 / 14:51:51 / cg" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1205 |
! |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1206 |
|
1004 | 1207 |
confirmWithCancel:aString default:default |
1208 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1209 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1210 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1211 |
||
1212 |
^ self |
|
1213 |
confirmWithCancel:aString |
|
1214 |
labels:(self |
|
1215 |
classResources |
|
1216 |
array: |
|
1217 |
#('cancel' |
|
1218 |
'no' |
|
1219 |
'yes') |
|
1220 |
) |
|
1221 |
default:(#(nil false true) indexOf:default ifAbsent:nil) |
|
1222 |
" |
|
1223 |
Dialog confirmWithCancel:'really ?' default:false |
|
1224 |
" |
|
1225 |
! |
|
1226 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1227 |
confirmWithCancel:aString labels:buttonLabels default:default |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1228 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1229 |
Return true for 'yes', false for 'no', nil for 'cancel'. |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1230 |
The strings for cancel, no and yes are to be passed in |
1004 | 1231 |
buttonLabels; |
1232 |
The default argument (if non-nil) defines the index of the |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1233 |
return button (1 to 3)" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1234 |
|
197 | 1235 |
|box answer| |
1236 |
||
1237 |
box := OptionBox title:aString numberOfOptions:3. |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1238 |
box buttonTitles:buttonLabels |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1239 |
actions:(Array with:[answer := nil] |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1240 |
with:[answer := false] |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1241 |
with:[answer := true] |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1242 |
). |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1243 |
default notNil ifTrue:[box defaultButtonIndex:default]. |
884 | 1244 |
box label:(self classResources string:'confirm'). |
197 | 1245 |
box showAtPointer. |
1246 |
box actions:nil. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1247 |
box destroy. |
197 | 1248 |
^ answer |
1249 |
||
1250 |
" |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1251 |
Dialog |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1252 |
confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1253 |
labels:#('mhmh' 'maybe' 'definitely') |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1254 |
default:3 |
197 | 1255 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1256 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1257 |
"Created: 18.10.1996 / 14:50:51 / cg" |
881 | 1258 |
"Modified: 14.11.1996 / 16:06:23 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1259 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1260 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1261 |
!DialogBox class methodsFor:'defaults'! |
573 | 1262 |
|
1263 |
defaultLabel |
|
1264 |
"return the boxes default window title." |
|
1265 |
||
1266 |
^ 'Dialog' |
|
1267 |
||
1268 |
"Created: 23.4.1996 / 17:13:10 / cg" |
|
1269 |
! ! |
|
1270 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1271 |
!DialogBox class methodsFor:'file name dialogs'! |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1272 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1273 |
requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1274 |
"same as requestFileName, but only show directories." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1275 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1276 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1277 |
requestDirectoryName:'directory ?' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1278 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1279 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1280 |
Dialog requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1281 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1282 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1283 |
"Created: 19.4.1996 / 14:29:48 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1284 |
"Modified: 19.4.1996 / 14:32:42 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1285 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1286 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1287 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1288 |
"same as requestFileName, but only show directories." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1289 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1290 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1291 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1292 |
default:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1293 |
ifFail:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1294 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1295 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1296 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1297 |
requestDirectoryName:'which directory ?' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1298 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1299 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1300 |
"Created: 19.4.1996 / 14:29:48 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1301 |
"Modified: 19.4.1996 / 14:32:02 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1302 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1303 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1304 |
requestDirectoryName:title default:aFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1305 |
"same as requestFileName, but only show directories" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1306 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1307 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1308 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1309 |
default:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1310 |
ifFail:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1311 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1312 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1313 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1314 |
requestDirectoryName:'which directory ?' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1315 |
default:'/etc' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1316 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1317 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1318 |
"Created: 19.4.1996 / 14:29:10 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1319 |
"Modified: 19.4.1996 / 14:31:52 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1320 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1321 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1322 |
requestDirectoryName:title default:aFileName ifFail:failBlock |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1323 |
"same as requestFileName, but only show directories" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1324 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1325 |
|fileBox| |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1326 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1327 |
fileBox := FileSelectionBox |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1328 |
title:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1329 |
okText:'ok' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1330 |
abortText:'cancel' |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1331 |
action:[:fileName | fileBox destroy. ^ fileName]. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1332 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1333 |
fileBox initialText:aFileName. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1334 |
fileBox selectingDirectory:true. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1335 |
fileBox showAtPointer. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1336 |
fileBox destroy. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1337 |
^ failBlock value |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1338 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1339 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1340 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1341 |
requestDirectoryName:'which directory ?' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1342 |
default:'/etc' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1343 |
ifFail:'none' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1344 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1345 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1346 |
"Created: 19.4.1996 / 14:31:04 / cg" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1347 |
"Modified: 29.5.1996 / 15:24:30 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1348 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1349 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1350 |
requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1351 |
"launch a Dialog, which allows the user to enter a filename. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1352 |
Return the pathname string consisting of the full pathname of the filename, |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1353 |
or an empty string (if cancel was pressed)." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1354 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1355 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1356 |
requestFileName:'filename:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1357 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1358 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1359 |
Dialog requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1360 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1361 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1362 |
"Created: 27.1.1996 / 13:24:35 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1363 |
"Modified: 19.4.1996 / 13:49:28 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1364 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1365 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1366 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1367 |
"launch a Dialog, which allows user to enter a filename. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1368 |
Return the pathname string consisting of the full pathname of the filename, |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1369 |
or an empty string (if cancel was pressed)." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1370 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1371 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1372 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1373 |
default:'file.ext' |
183 | 1374 |
|
197 | 1375 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1376 |
Dialog requestFileName:'enter a fileName:' |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1377 |
Dialog requestFileName:'enter a fileName:' |
183 | 1378 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1379 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1380 |
"Created: 27.1.1996 / 13:24:35 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1381 |
"Modified: 19.4.1996 / 13:53:17 / cg" |
118 | 1382 |
! |
1383 |
||
100 | 1384 |
requestFileName:titleString default:defaultName |
1385 |
"launch a Dialog, which allows user to enter a filename. |
|
1386 |
The box will not allow pressing 'ok' without an entered string. |
|
1387 |
Return the pathname string consisting of the full pathname of the filename, |
|
1388 |
or an empty string (if cancel was pressed)." |
|
1389 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1390 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1391 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1392 |
default:defaultName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1393 |
version:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1394 |
ifFail:'' |
100 | 1395 |
|
1396 |
" |
|
1397 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
1398 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
|
1399 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1400 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1401 |
"Modified: 19.4.1996 / 13:47:44 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1402 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1403 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1404 |
requestFileName:titleString default:defaultName fromDirectory:aDirectoryPath |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1405 |
"launch a Dialog, which allows user to enter a filename. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1406 |
The box will not allow pressing 'ok' without an entered string. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1407 |
Return the pathname string consisting of the full pathname of the filename, |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1408 |
or an empty string (if cancel was pressed)." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1409 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1410 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1411 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1412 |
default:defaultName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1413 |
version:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1414 |
ifFail:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1415 |
fromDirectory:aDirectoryPath |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1416 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1417 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1418 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1419 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1420 |
default:'Makefile.bak' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1421 |
fromDirectory:'..' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1422 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1423 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1424 |
"Modified: 19.4.1996 / 14:27:31 / cg" |
100 | 1425 |
! |
1426 |
||
197 | 1427 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
1428 |
"launch a Dialog, which allows user to enter a filename. |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1429 |
The files presented initially are those from the current directory. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1430 |
The box will show okText in its okButton, abortText in the abortButton. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1431 |
The matchPattern is set to pattern initially. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1432 |
Return the string or nil if cancel was pressed." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1433 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1434 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1435 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1436 |
default:defaultName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1437 |
ok:okText |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1438 |
abort:abortText |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1439 |
pattern:pattern |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1440 |
fromDirectory:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1441 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1442 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1443 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1444 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1445 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1446 |
ok:'yeah' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1447 |
abort:'oh, no' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1448 |
pattern:'*.st' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1449 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1450 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1451 |
"Modified: 20.2.1997 / 18:13:13 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1452 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1453 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1454 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPath |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1455 |
"launch a Dialog, which allows user to enter a filename. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1456 |
The files presented initially are those in aDirectoryPath, or the |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1457 |
current directory (if a nil path is given). |
197 | 1458 |
The box will show okText in its okButton, abortText in the abortButton. |
1459 |
The matchPattern is set to pattern initially. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1460 |
Return the string, or nil if cancel was pressed." |
197 | 1461 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1462 |
|box defaultDir defaultNm| |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1463 |
|
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1464 |
defaultNm := defaultName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1465 |
defaultDir := aDirectoryPath. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1466 |
defaultDir isNil ifTrue:[ |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1467 |
defaultNm notNil ifTrue:[ |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1468 |
defaultDir := defaultName asFilename directoryName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1469 |
defaultNm := defaultNm asFilename baseName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1470 |
]. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1471 |
]. |
197 | 1472 |
|
1473 |
box := FileSelectionBox |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1474 |
title:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1475 |
okText:okText |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1476 |
abortText:abortText |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1477 |
action:[:fileName | box destroy. ^ fileName]. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1478 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1479 |
defaultDir notNil ifTrue:[box directory:defaultDir]. |
197 | 1480 |
box pattern:pattern. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1481 |
box initialText:defaultNm. |
197 | 1482 |
box showAtPointer. |
1483 |
box action:nil. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1484 |
box destroy. |
197 | 1485 |
^ nil |
1486 |
||
1487 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1488 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1489 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1490 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1491 |
ok:'yeah' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1492 |
abort:'oh, no' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1493 |
pattern:'rc*' |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1494 |
fromDirectory:'/etc' |
197 | 1495 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1496 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1497 |
"Modified: 20.2.1997 / 18:12:49 / cg" |
197 | 1498 |
! |
1499 |
||
1030 | 1500 |
requestFileName:titleString default:defaultName pattern:pattern |
1501 |
"launch a Dialog, which allows user to enter a filename. |
|
1502 |
The files presented initially are those from the current directory. |
|
1503 |
The box will show ok/cancel in its buttons. |
|
1504 |
The matchPattern is set to pattern initially. |
|
1505 |
Return the string or nil if cancel was pressed." |
|
1506 |
||
1507 |
^ self |
|
1508 |
requestFileName:titleString |
|
1509 |
default:defaultName |
|
1510 |
ok:(self classResources string:'ok') |
|
1511 |
abort:(self classResources string:'cancel') |
|
1512 |
pattern:pattern |
|
1513 |
fromDirectory:nil |
|
1514 |
||
1515 |
" |
|
1516 |
Dialog |
|
1517 |
requestFileName:'enter a fileName:' |
|
1518 |
default:'' |
|
1519 |
pattern:'*.st' |
|
1520 |
" |
|
1521 |
" |
|
1522 |
Dialog |
|
1523 |
requestFileName:'enter a fileName:' |
|
1524 |
default:'' |
|
1525 |
pattern:'*.st;*.h' |
|
1526 |
" |
|
1527 |
||
1528 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
1529 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
1530 |
! |
|
1531 |
||
100 | 1532 |
requestFileName:titleString default:defaultName version:versionSymbol |
1533 |
"launch a Dialog, which allows user to enter a filename. |
|
1534 |
The box will not allow pressing 'ok' without an entered string. |
|
1535 |
Return the pathname string or the empty string if cancel was pressed. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1536 |
The version argument allows validation of the files existance; |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1537 |
it may be any of: |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1538 |
#mustBeNew - fail (return empty string) if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1539 |
#new - confirm if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1540 |
#mustBeOld - fail if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1541 |
#old - confirm if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1542 |
#any (other) - no validation |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1543 |
" |
100 | 1544 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1545 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1546 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1547 |
default:defaultName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1548 |
version:versionSymbol |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1549 |
ifFail:'' |
100 | 1550 |
|
1551 |
" |
|
1552 |
Dialog requestFileName:'enter a fileName:' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1553 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1554 |
version:nil |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1555 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1556 |
Dialog requestFileName:'enter a fileName:' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1557 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1558 |
version:#mustBeNew |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1559 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1560 |
Dialog requestFileName:'enter a fileName:' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1561 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1562 |
version:#new |
100 | 1563 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1564 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1565 |
"Modified: 19.4.1996 / 13:53:58 / cg" |
100 | 1566 |
! |
1567 |
||
1568 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
1569 |
"launch a Dialog, which allows user to enter a filename. |
|
1570 |
The box will not allow pressing 'ok' without an entered string. |
|
1571 |
Return the string or the value of failBlock if cancel was pressed. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1572 |
The version argument allows validation of the files existance; |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1573 |
it may be any of: |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1574 |
#mustBeNew - fail (return empty string) if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1575 |
#new - confirm if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1576 |
#mustBeOld - fail if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1577 |
#old - confirm if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1578 |
#any (other) - no validation |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1579 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1580 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1581 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1582 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1583 |
default:defaultName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1584 |
version:versionSymbol |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1585 |
ifFail:failBlock |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1586 |
fromDirectory:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1587 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1588 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1589 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1590 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1591 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1592 |
version:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1593 |
ifFail:['none'] |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1594 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1595 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1596 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1597 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1598 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1599 |
version:#old |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1600 |
ifFail:['none'] |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1601 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1602 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1603 |
"Modified: 19.4.1996 / 14:26:36 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1604 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1605 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1606 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1607 |
"launch a Dialog, which allows user to enter a filename. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1608 |
Return the string or the value of failBlock if cancel was pressed. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1609 |
The version argument allows validation of the files existance; |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1610 |
it may be any of: |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1611 |
#mustBeNew - fail (return empty string) if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1612 |
#new - confirm if the file exists |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1613 |
#mustBeOld - fail if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1614 |
#old - confirm if the file does not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1615 |
#any (other) - no validation |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1616 |
" |
100 | 1617 |
|
1031 | 1618 |
^ self requestFileName:titleString default:defaultName version:versionSymbol |
1619 |
ifFail:failBlock pattern:nil fromDirectory:aDirectoryPath |
|
1620 |
||
1621 |
" |
|
1622 |
Dialog |
|
1623 |
requestFileName:'enter a fileName:' |
|
1624 |
default:'' |
|
1625 |
version:nil |
|
1626 |
ifFail:['none'] |
|
1627 |
fromDirectory:'/etc' |
|
1628 |
" |
|
1629 |
" |
|
1630 |
Dialog |
|
1631 |
requestFileName:'enter a fileName:' |
|
1632 |
default:'' |
|
1633 |
version:#old |
|
1634 |
ifFail:['none'] |
|
1635 |
fromDirectory:'/etc' |
|
1636 |
" |
|
1637 |
" |
|
1638 |
Dialog |
|
1639 |
requestFileName:'enter a fileName:' |
|
1640 |
default:'' |
|
1641 |
version:#mustBeNew |
|
1642 |
ifFail:['none'] |
|
1643 |
fromDirectory:'/etc' |
|
1644 |
" |
|
1645 |
||
1646 |
"Modified: 20.2.1997 / 18:12:28 / cg" |
|
1647 |
"Modified: 21.2.1997 / 14:27:27 / stefan" |
|
1648 |
! |
|
1649 |
||
1650 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
1651 |
"launch a Dialog, which allows user to enter a filename. |
|
1652 |
Return the string or the value of failBlock if cancel was pressed. |
|
1653 |
The version argument allows validation of the files existance; |
|
1654 |
it may be any of: |
|
1655 |
#mustBeNew - fail (return empty string) if the file exists |
|
1656 |
#new - confirm if the file exists |
|
1657 |
#mustBeOld - fail if the file does not exist |
|
1658 |
#old - confirm if the file does not exist |
|
1659 |
#any (other) - no validation |
|
1660 |
" |
|
1661 |
||
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1662 |
|box defaultDir defaultNm| |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1663 |
|
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1664 |
defaultNm := defaultName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1665 |
defaultDir := aDirectoryPath. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1666 |
defaultDir isNil ifTrue:[ |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1667 |
defaultNm notNil ifTrue:[ |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1668 |
defaultDir := defaultName asFilename directoryName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1669 |
defaultNm := defaultNm asFilename baseName. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1670 |
]. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1671 |
]. |
100 | 1672 |
|
1673 |
box := FileSelectionBox title:titleString. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1674 |
defaultDir notNil ifTrue:[box directory:defaultDir]. |
1031 | 1675 |
pattern notNil ifTrue:[box pattern:pattern]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1676 |
box initialText:defaultNm. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1677 |
box action:[:name | |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1678 |
versionSymbol == #mustBeNew ifTrue:[ |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1679 |
"/ file may not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1680 |
name asFilename exists ifTrue:[^ '']. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1681 |
]. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1682 |
versionSymbol == #new ifTrue:[ |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1683 |
"/ file may not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1684 |
name asFilename exists ifTrue:[ |
884 | 1685 |
(self confirm:(self classResources string:'''%1'' exists.\\Continue anyway ?' with:box fileName) withCRs) |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1686 |
ifFalse:[^ '']. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1687 |
]. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1688 |
]. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1689 |
versionSymbol == #mustBeOld ifTrue:[ |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1690 |
name asFilename exists ifFalse:[^ '']. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1691 |
]. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1692 |
versionSymbol == #old ifTrue:[ |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1693 |
"/ file may not exist |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1694 |
name asFilename exists ifFalse:[ |
884 | 1695 |
(self confirm:(self classResources string:'''%1'' does not exist yet.\\Continue anyway ?' with:box fileName) withCRs) |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1696 |
ifFalse:[^ '']. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1697 |
]. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1698 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1699 |
box destroy. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1700 |
^ name |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1701 |
]. |
100 | 1702 |
box showAtPointer. |
1703 |
box action:nil. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1704 |
box destroy. |
100 | 1705 |
^ failBlock value |
1706 |
||
1707 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1708 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1709 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1710 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1711 |
version:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1712 |
ifFail:['none'] |
1031 | 1713 |
pattern:'*.conf' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1714 |
fromDirectory:'/etc' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1715 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1716 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1717 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1718 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1719 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1720 |
version:#old |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1721 |
ifFail:['none'] |
1031 | 1722 |
pattern:'*.conf' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1723 |
fromDirectory:'/etc' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1724 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1725 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1726 |
Dialog |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1727 |
requestFileName:'enter a fileName:' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1728 |
default:'' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1729 |
version:#mustBeNew |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1730 |
ifFail:['none'] |
1031 | 1731 |
pattern:'*.conf' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1732 |
fromDirectory:'/etc' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1733 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1734 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
1735 |
"Modified: 20.2.1997 / 18:12:28 / cg" |
1031 | 1736 |
"Created: 21.2.1997 / 14:23:44 / stefan" |
1737 |
"Modified: 21.2.1997 / 14:38:04 / stefan" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1738 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1739 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1740 |
requestFileName:titleString ifFail:cancelBlock |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1741 |
"launch a Dialog, which allows user to enter a filename. |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1742 |
Return the pathname string consisting of the full pathname of the filename, |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1743 |
or the value from evaluating cancelBlock (if cancel was pressed)." |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1744 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1745 |
^ self |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1746 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1747 |
default:'file.ext' |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1748 |
version:nil |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1749 |
ifFail:cancelBlock |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1750 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1751 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1752 |
Dialog requestFileName:'enter a fileName:' ifFail:['foo'] |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1753 |
Dialog requestFileName:'enter a fileName:' ifFail:[nil] |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1754 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1755 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1756 |
"Modified: 19.4.1996 / 13:53:17 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1757 |
"Created: 19.4.1996 / 13:56:28 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1758 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1759 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1760 |
requestNewFileName:titleString default:defaultName |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1761 |
"launch a Dialog, which allows user to enter a filename. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1762 |
We expect a new files (i.e. nonexisting) name to be enterred, |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1763 |
and confirm if it already exists. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1764 |
The box will not allow pressing 'ok' without an entered string. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1765 |
Return the pathname string consisting of the full pathname of the filename, |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1766 |
or an empty string (if cancel was pressed)." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1767 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1768 |
^ self requestFileName:titleString |
314
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
1769 |
default:defaultName |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
1770 |
version:#new |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
1771 |
ifFail:'' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1772 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1773 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1774 |
Dialog requestNewFileName:'enter a fileName:' default:'' |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1775 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1776 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1777 |
"Modified: 27.1.1996 / 13:44:13 / cg" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1778 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1779 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1780 |
!DialogBox class methodsFor:'fill in the blank dialogs'! |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1781 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1782 |
request:aString |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1783 |
"launch a Dialog, which allows user to enter something. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1784 |
Return the entered string (may be empty string) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1785 |
or the empty string (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1786 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1787 |
^ self |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1788 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1789 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1790 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1791 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1792 |
initialAnswer:'' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1793 |
onCancel:'' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1794 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1795 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1796 |
Dialog |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1797 |
request:'enter a string:' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1798 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1799 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1800 |
"Modified: 29.5.1996 / 14:26:25 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1801 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1802 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1803 |
request:aString displayAt:aPoint centered:centered action:resultAction initialAnswer:initial |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1804 |
"launch a Dialog, which allows user to enter a string. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1805 |
If aPoint is nonNil, the box is shown there, optionally centered around |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1806 |
that point. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1807 |
If it is nil, it is shown at the current pointer position or at the |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1808 |
screen center. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1809 |
Return the string or an empty string (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1810 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1811 |
^ self |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1812 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1813 |
displayAt:aPoint |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1814 |
centered:centered |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1815 |
action:resultAction |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1816 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1817 |
onCancel:'' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1818 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1819 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1820 |
centered around 200@200: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1821 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1822 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1823 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1824 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1825 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1826 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1827 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1828 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1829 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1830 |
origin at 200@200: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1831 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1832 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1833 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1834 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1835 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1836 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1837 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1838 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1839 |
under mouse pointer: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1840 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1841 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1842 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1843 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1844 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1845 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1846 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1847 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1848 |
centered on the screen: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1849 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1850 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1851 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1852 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1853 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1854 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1855 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1856 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1857 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1858 |
"Created: 7.12.1995 / 23:14:10 / cg" |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1859 |
"Modified: 29.5.1996 / 14:19:36 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1860 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1861 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1862 |
request:aString displayAt:aPoint centered:centered action:resultAction initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1863 |
"launch a Dialog, which allows user to enter a string. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1864 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1865 |
If it is nil, it is shown at the current pointer position or at the |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1866 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1867 |
The ok-button is labelled okLabel (or the default, ifNil), |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1868 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1869 |
Return the string or the value of cancelValue (if cancel was pressed)" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1870 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1871 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1872 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1873 |
displayAt:aPoint |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1874 |
centered:centered |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1875 |
action:resultAction |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1876 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1877 |
okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1878 |
cancelLabel:cancelLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1879 |
title:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1880 |
onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1881 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1882 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1883 |
at topLeft (centering is suppressed, to make the box fully visible) |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1884 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1885 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1886 |
displayAt:0@0 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1887 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1888 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1889 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1890 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1891 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1892 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1893 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1894 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1895 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1896 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1897 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1898 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1899 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1900 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1901 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1902 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1903 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1904 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1905 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1906 |
topLeft of box at 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1907 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1908 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1909 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1910 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1911 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1912 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1913 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1914 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1915 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1916 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1917 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1918 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1919 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1920 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1921 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1922 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1923 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1924 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1925 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1926 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1927 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1928 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1929 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1930 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1931 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1932 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1933 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1934 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1935 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1936 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1937 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1938 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1939 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1940 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1941 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1942 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1943 |
"Created: 7.12.1995 / 23:14:10 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1944 |
"Modified: 29.5.1996 / 14:35:45 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1945 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1946 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1947 |
request:aString displayAt:aPoint centered:centered action:resultAction initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1948 |
"launch a Dialog, which allows user to enter a string. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1949 |
The dialogs window is titled titleString, or the default (if nil). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1950 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1951 |
If it is nil, it is shown at the current pointer position or at the |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1952 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1953 |
The ok-button is labelled okLabel (or the default, ifNil), |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1954 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1955 |
Return the string or the value of cancelValue (if cancel was pressed)" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1956 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1957 |
|box| |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1958 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1959 |
box := EnterBox title:aString. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1960 |
box initialText:initial. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1961 |
box abortAction:[:val | box destroy. ^ cancelValue value]. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1962 |
okLabel notNil ifTrue:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1963 |
box okText:okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1964 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1965 |
cancelLabel notNil ifTrue:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1966 |
box abortText:cancelLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1967 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1968 |
resultAction isNil ifTrue:[ |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1969 |
box action:[:val | box destroy. ^ val] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1970 |
] ifFalse:[ |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1971 |
box action:[:val | box destroy. ^ resultAction value:val] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1972 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1973 |
titleString notNil ifTrue:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1974 |
box label:titleString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1975 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1976 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1977 |
aPoint notNil ifTrue:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1978 |
box showAt:aPoint center:centered |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1979 |
] ifFalse:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1980 |
centered ifTrue:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1981 |
box showAtCenter |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1982 |
] ifFalse:[ |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1983 |
box showAtPointer |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1984 |
] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1985 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1986 |
box destroy. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1987 |
^ cancelValue value. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1988 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1989 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1990 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1991 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1992 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1993 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1994 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1995 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1996 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1997 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1998 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
1999 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2000 |
title:'foo' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2001 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2002 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2003 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2004 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2005 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2006 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2007 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2008 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2009 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2010 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2011 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2012 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2013 |
title:'foo' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2014 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2015 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2016 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2017 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2018 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2019 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2020 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2021 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2022 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2023 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2024 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2025 |
cancelLabel:'no' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2026 |
title:'foo' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2027 |
onCancel:#foo |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2028 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2029 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2030 |
"Created: 29.5.1996 / 14:35:04 / cg" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2031 |
"Modified: 29.5.1996 / 15:26:34 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2032 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2033 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2034 |
request:aString displayAt:aPoint centered:centered action:resultAction initialAnswer:initial onCancel:cancelValue |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2035 |
"launch a Dialog, which allows user to enter a string. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2036 |
If aPoint is nonNil, the box is shown there, optionally centered. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2037 |
If it is nil, it is shown at the current pointer position or at the screen center. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2038 |
Return the string or the value of cancelValue (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2039 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2040 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2041 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2042 |
displayAt:aPoint |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2043 |
centered:centered |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2044 |
action:resultAction |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2045 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2046 |
okLabel:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2047 |
cancelLabel:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2048 |
onCancel:cancelValue |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2049 |
|
100 | 2050 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2051 |
at topLeft (centering is suppressed, to make the box fully visible) |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2052 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2053 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2054 |
displayAt:0@0 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2055 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2056 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2057 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2058 |
onCancel:#foo |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2059 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2060 |
centered around 200@200: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2061 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2062 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2063 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2064 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2065 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2066 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2067 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2068 |
onCancel:#foo |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2069 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2070 |
topLeft of box at 200@200: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2071 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2072 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2073 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2074 |
displayAt:200@200 |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2075 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2076 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2077 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2078 |
onCancel:#foo |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2079 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2080 |
under mouse pointer: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2081 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2082 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2083 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2084 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2085 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2086 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2087 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2088 |
onCancel:#foo |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2089 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2090 |
centered on the screen: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2091 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2092 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2093 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2094 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2095 |
centered:true |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2096 |
action:[:result | result printNewline] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2097 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2098 |
onCancel:#foo |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2099 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2100 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2101 |
"Created: 7.12.1995 / 23:14:10 / cg" |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2102 |
"Modified: 29.5.1996 / 14:24:39 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2103 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2104 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2105 |
request:aString displayAt:aPoint initialAnswer:initial |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2106 |
"launch a Dialog, which allows user to enter something. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2107 |
The boxes topLeft is placed at aPoint, or under the mouse pointer (if aPoint is nil). |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2108 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2109 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2110 |
^ self |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2111 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2112 |
displayAt:aPoint |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2113 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2114 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2115 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2116 |
onCancel:'' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2117 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2118 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2119 |
Dialog |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2120 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2121 |
displayAt:(250 @ 250) |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2122 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2123 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2124 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2125 |
"Modified: 29.5.1996 / 14:29:51 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2126 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2127 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2128 |
request:aString initialAnswer:initial |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2129 |
"launch a Dialog, which allows user to enter something. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2130 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2131 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2132 |
^ self |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2133 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2134 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2135 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2136 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2137 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2138 |
onCancel:'' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2139 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2140 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2141 |
Dialog |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2142 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2143 |
initialAnswer:'the default' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2144 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2145 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2146 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2147 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2148 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2149 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2150 |
"launch a Dialog, which allows user to enter something. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2151 |
Return the entered string (may be empty string) |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2152 |
or cancelValue (if cancel was pressed)" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2153 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2154 |
^ self |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2155 |
request:aString |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2156 |
displayAt:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2157 |
centered:false |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2158 |
action:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2159 |
initialAnswer:initial |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2160 |
okLabel:okLabel |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2161 |
cancelLabel:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2162 |
title:titleString |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2163 |
onCancel:cancelAction |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2164 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2165 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2166 |
Dialog |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2167 |
request:'enter a string:' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2168 |
initialAnswer:'the default' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2169 |
onCancel:['foooo'] |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2170 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2171 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2172 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2173 |
"Created: 29.5.1996 / 14:59:57 / cg" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2174 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2175 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2176 |
request:aString initialAnswer:initial onCancel:cancelAction |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2177 |
"launch a Dialog, which allows user to enter something. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2178 |
Return the entered string (may be empty string) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2179 |
or cancelValue (if cancel was pressed)" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2180 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2181 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2182 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2183 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2184 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2185 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2186 |
initialAnswer:initial |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2187 |
onCancel:cancelAction |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2188 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2189 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2190 |
Dialog |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2191 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2192 |
initialAnswer:'the default' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2193 |
onCancel:['foooo'] |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2194 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2195 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2196 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2197 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2198 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2199 |
request:aString okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2200 |
"launch a Dialog, which allows user to enter something. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2201 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2202 |
Return the entered string (may be empty string) |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2203 |
or the empty string (if cancel was pressed)" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2204 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2205 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2206 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2207 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2208 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2209 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2210 |
initialAnswer:'' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2211 |
okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2212 |
cancelLabel:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2213 |
onCancel:'' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2214 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2215 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2216 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2217 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2218 |
okLabel:'yes' |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2219 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2220 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2221 |
"Modified: 29.5.1996 / 14:26:25 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2222 |
"Created: 29.5.1996 / 14:31:10 / cg" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2223 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2224 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2225 |
request:aString okLabel:okLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2226 |
"launch a Dialog, which allows user to enter something. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2227 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2228 |
Return the entered string (may be empty string) |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2229 |
or the value from evaluating cancelValue (if cancel was pressed)" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2230 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2231 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2232 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2233 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2234 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2235 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2236 |
initialAnswer:'' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2237 |
okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2238 |
cancelLabel:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2239 |
onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2240 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2241 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2242 |
Dialog |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2243 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2244 |
okLabel:'yes' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2245 |
onCancel:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2246 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2247 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2248 |
"Modified: 29.5.1996 / 14:32:00 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2249 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2250 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2251 |
request:aString okLabel:okLabel title:titleString onCancel:cancelValue |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2252 |
"launch a Dialog, which allows user to enter something. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2253 |
The okButton is labelled as okLabel. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2254 |
Return the entered string (may be empty string) |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2255 |
or the value from evaluating cancelValue (if cancel was pressed)" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2256 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2257 |
^ self |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2258 |
request:aString |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2259 |
displayAt:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2260 |
centered:false |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2261 |
action:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2262 |
initialAnswer:'' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2263 |
okLabel:okLabel |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2264 |
cancelLabel:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2265 |
title:titleString |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2266 |
onCancel:cancelValue |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2267 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2268 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2269 |
Dialog |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2270 |
request:'enter a string:' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2271 |
okLabel:'yes' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2272 |
title:'foo' |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2273 |
onCancel:nil |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2274 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2275 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2276 |
"Modified: 29.5.1996 / 14:32:00 / cg" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2277 |
"Created: 29.5.1996 / 14:57:02 / cg" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2278 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
2279 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2280 |
request:aString onCancel:cancelAction |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2281 |
"launch a Dialog, which allows user to enter something. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2282 |
Return the entered string (may be empty string) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2283 |
or the value of cancelAction (if cancel was pressed)." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2284 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2285 |
^ self |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2286 |
request:aString |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2287 |
displayAt:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2288 |
centered:false |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2289 |
action:nil |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2290 |
initialAnswer:'' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2291 |
onCancel:cancelAction |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2292 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2293 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2294 |
Dialog |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2295 |
request:'enter a string:' |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2296 |
onCancel:nil |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2297 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2298 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2299 |
"Created: 27.1.1996 / 14:31:45 / cg" |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
2300 |
"Modified: 29.5.1996 / 14:28:59 / cg" |
100 | 2301 |
! |
2302 |
||
197 | 2303 |
requestPassword:aString |
2304 |
"launch a Dialog, which allows user to enter something invisibly. |
|
2305 |
Return the entered string (may be empty string) |
|
2306 |
or nil (if cancel was pressed)" |
|
100 | 2307 |
|
197 | 2308 |
^ EnterBox requestPassword:aString |
133 | 2309 |
|
2310 |
" |
|
2311 |
Dialog |
|
197 | 2312 |
requestPassword:'enter secret:' |
133 | 2313 |
" |
197 | 2314 |
|
2315 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2316 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2317 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
2318 |
!DialogBox class methodsFor:'multiple choice dialogs'! |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2319 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2320 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2321 |
"launch a Dialog showing the message and list. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2322 |
The user can select an item and click ok; in this case, the corresponding value |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2323 |
from listValues is returned (doubleclick works as well). |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2324 |
The list may be suppressed (if the list arg is nil). |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2325 |
Below the list, an optional row of buttons is shown, which can also be |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2326 |
clicked upon, and a corresponding value from buttonValues is returned. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2327 |
If cancel is pressed, the value of cancelBlock is returned. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2328 |
Pressing ok without a selection is treated like cancel." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2329 |
|
1284 | 2330 |
|box listView panel answer| |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2331 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2332 |
box := Dialog new. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2333 |
(box addTextLabel:aString) adjust:#left. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2334 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2335 |
list notNil ifTrue:[ |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2336 |
maxLines > list size ifTrue:[ |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2337 |
listView := ScrollableView for:SelectionInListView. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2338 |
] ifFalse:[ |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2339 |
listView := SelectionInListView new. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2340 |
listView level:-1. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2341 |
]. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2342 |
listView list:list. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2343 |
listView doubleClickAction:[:line | box hide. ^ listValues at:line]. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2344 |
box addComponent:listView indent:(ViewSpacing // 2) withHeight:(listView heightForLines:maxLines). |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2345 |
box makeTabable:listView. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2346 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2347 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2348 |
buttonLabels notNil ifTrue:[ |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2349 |
panel := HorizontalPanelView new. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2350 |
panel horizontalLayout:#fitSpace. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2351 |
buttonLabels keysAndValuesDo:[:index :label | |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2352 |
|b| |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2353 |
|
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2354 |
b := Button label:label. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2355 |
b action:[box hide. ^ buttonValues at:index]. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2356 |
panel add:b. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2357 |
box makeTabable:b. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2358 |
]. |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2359 |
box addComponent:panel indent:0. "/ panel has its own idea of indenting |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2360 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2361 |
box addAbortButton. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2362 |
list notNil ifTrue:[box addOkButton]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
2363 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
2364 |
listView notNil ifTrue:[box stickAtBottomWithVariableHeight:listView]. |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
2365 |
panel notNil ifTrue:[box stickAtBottomWithFixHeight:panel]. |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
2366 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2367 |
box showAtPointer. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2368 |
box destroy. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2369 |
box accepted ifTrue:[ |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2370 |
(answer := listView selection) notNil ifTrue:[ |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2371 |
^ listValues at:answer |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2372 |
] |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2373 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2374 |
^ cancelBlock value |
197 | 2375 |
|
2376 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2377 |
full example: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2378 |
|
655 | 2379 |
Transcript showCR:( |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2380 |
Dialog |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2381 |
choose:'choose any' |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2382 |
fromList:#('one' 'two' 'three' 'four') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2383 |
values:#(1 2 3 4) |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2384 |
buttons:#('five' 'six' 'seven') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2385 |
values:#(5 6 7) |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2386 |
lines:10 |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2387 |
cancel:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2388 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2389 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2390 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2391 |
no buttons: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2392 |
|
655 | 2393 |
Transcript showCR:( |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2394 |
Dialog |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2395 |
choose:'choose any' |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2396 |
fromList:#('one' 'two' 'three' 'four') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2397 |
values:#(1 2 3 4) |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2398 |
buttons:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2399 |
values:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2400 |
lines:4 |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2401 |
cancel:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2402 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2403 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2404 |
|
558 | 2405 |
no list (lines argument is ignored): |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2406 |
|
655 | 2407 |
Transcript showCR:( |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2408 |
Dialog |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2409 |
choose:'choose any' |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2410 |
fromList:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2411 |
values:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2412 |
buttons:#('one' 'two' 'three' 'four') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2413 |
values:#(1 2 3 4) |
558 | 2414 |
lines:nil |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2415 |
cancel:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2416 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2417 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2418 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2419 |
full including cancel value: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2420 |
|
655 | 2421 |
Transcript showCR:( |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2422 |
Dialog |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2423 |
choose:'choose example' |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2424 |
fromList:#('one' 'two' 'three' 'four') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2425 |
values:#(1 2 3 4) |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2426 |
buttons:#('five' 'six' 'seven') |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2427 |
values:#(5 6 7) |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2428 |
lines:4 |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2429 |
cancel:[Transcript flash. #aborted] |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2430 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2431 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2432 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2433 |
degenerated: |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2434 |
|
655 | 2435 |
Transcript showCR:( |
557
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2436 |
Dialog |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2437 |
choose:'choose any' |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2438 |
fromList:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2439 |
values:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2440 |
buttons:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2441 |
values:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2442 |
lines:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2443 |
cancel:nil |
1fbfacd0fed1
suppress scrollBar in choose if there is nothing to scroll
Claus Gittinger <cg@exept.de>
parents:
552
diff
changeset
|
2444 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2445 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2446 |
|
133 | 2447 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2448 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2449 |
"Modified: 29.5.1996 / 15:27:22 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2450 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2451 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2452 |
choose:aString fromList:list values:listValues lines:maxLines cancel:cancelBlock |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2453 |
"launch a Dialog showing the message and list. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2454 |
The user can select an item and click ok; in this case, the corresponding value |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2455 |
from listValues is returned (doubleclick works as well). |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2456 |
If cancel is pressed, the value of cancelBlock is returned. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2457 |
Pressing ok without a selection is treated like cancel." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2458 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2459 |
^ self |
314
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2460 |
choose:aString |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2461 |
fromList:list |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2462 |
values:listValues |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2463 |
buttons:nil |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2464 |
values:nil |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2465 |
lines:maxLines |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2466 |
cancel:cancelBlock |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2467 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2468 |
" |
655 | 2469 |
Transcript showCR:( |
314
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2470 |
Dialog |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2471 |
choose:'choose any' |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2472 |
fromList:#('one' 'two' 'three' 'four') |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2473 |
values:#(1 2 3 4) |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2474 |
lines:4 |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2475 |
cancel:nil |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2476 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2477 |
|
655 | 2478 |
Transcript showCR:( |
314
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2479 |
Dialog |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2480 |
choose:'choose example' |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2481 |
fromList:#('one' 'two' 'three' 'four') |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2482 |
values:#(1 2 3 4) |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2483 |
lines:4 |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
2484 |
cancel:[Transcript flash. #aborted] |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2485 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2486 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2487 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2488 |
"Modified: 27.1.1996 / 14:17:07 / cg" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2489 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2490 |
|
803 | 2491 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2492 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2493 |
Returning a corresponding value from the values-array. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2494 |
The default entries button is marked as a return button and entering |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2495 |
return will choose that value. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2496 |
For a good userInterface style, we recommend this being the last |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2497 |
entry (to make the right-most button the default button)." |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2498 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2499 |
|box answer idx| |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2500 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2501 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
803 | 2502 |
windowLabel notNil ifTrue:[ |
2503 |
box label:windowLabel |
|
2504 |
]. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2505 |
box buttonTitles:(self classResources array:buttonLabels) |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2506 |
actions:(values collect:[:val | [answer := val]]). |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2507 |
answer := default. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2508 |
box buttons last isReturnButton:false. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2509 |
idx := values indexOf:default. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2510 |
idx ~~ 0 ifTrue:[box defaultButtonIndex:idx]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2511 |
box showAtPointer. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2512 |
box destroy. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2513 |
box actions:nil. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2514 |
^ answer |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2515 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2516 |
"no good style (default button is not the rightmost one) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2517 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2518 |
Dialog |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2519 |
choose:'choose any' |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2520 |
labels:#('one' 'two' 'three' 'four') |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2521 |
values:#(1 2 3 4) |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2522 |
default:2 |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2523 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2524 |
Dialog |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2525 |
choose:'choose any' |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2526 |
labels:#('cancel' 'foo' 'bar' 'baz') |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2527 |
values:#(nil foo bar baz) |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2528 |
default:#baz |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2529 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2530 |
Dialog |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2531 |
choose:'choose any' |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2532 |
labels:#('one' 'two' 'three' 'four') |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2533 |
values:#(1 2 3 4) |
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2534 |
default:nil |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2535 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2536 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2537 |
"Modified: 29.5.1996 / 15:27:32 / cg" |
803 | 2538 |
"Created: 22.7.1996 / 11:44:27 / cg" |
2539 |
! |
|
2540 |
||
2541 |
choose:aString labels:buttonLabels values:values default:default |
|
2542 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
2543 |
Returning a corresponding value from the values-array. |
|
2544 |
The default entries button is marked as a return button and entering |
|
2545 |
return will choose that value. |
|
2546 |
For a good userInterface style, we recommend this being the last |
|
2547 |
entry (to make the right-most button the default button)." |
|
2548 |
||
2549 |
^ self |
|
2550 |
choose:aString |
|
2551 |
label:nil |
|
2552 |
labels:buttonLabels |
|
2553 |
values:values |
|
2554 |
default:default |
|
2555 |
||
2556 |
||
2557 |
"no good style (default button is not the rightmost one) |
|
2558 |
||
2559 |
Dialog |
|
2560 |
choose:'choose any' |
|
2561 |
labels:#('one' 'two' 'three' 'four') |
|
2562 |
values:#(1 2 3 4) |
|
2563 |
default:2 |
|
2564 |
||
2565 |
Dialog |
|
2566 |
choose:'choose any' |
|
2567 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
2568 |
values:#(nil foo bar baz) |
|
2569 |
default:#baz |
|
2570 |
||
2571 |
Dialog |
|
2572 |
choose:'choose any' |
|
2573 |
labels:#('one' 'two' 'three' 'four') |
|
2574 |
values:#(1 2 3 4) |
|
2575 |
default:nil |
|
2576 |
" |
|
2577 |
||
2578 |
"Modified: 22.7.1996 / 11:46:09 / cg" |
|
100 | 2579 |
! ! |
2580 |
||
197 | 2581 |
!DialogBox methodsFor:'accessing-behavior'! |
2582 |
||
2583 |
abortAction:aBlock |
|
2584 |
"define the action to be performed when abort is pressed" |
|
2585 |
||
2586 |
abortAction := aBlock |
|
125 | 2587 |
! |
2588 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2589 |
acceptCheck:aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2590 |
"if nonNil, the acceptCheck-block is evaluated when the dialog is |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2591 |
accepted (ok-button or Return-key). If it returns true, the box is closed, |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2592 |
otherwise not." |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2593 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2594 |
acceptCheck := aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2595 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2596 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2597 |
acceptOnLeave:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2598 |
"define the behavior when the last input field is left via cursor keys. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2599 |
The default is to accept & close the dialog (i.e. true)." |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2600 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2601 |
acceptOnLeave := aBoolean. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2602 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2603 |
"Modified: 19.4.1996 / 17:05:12 / cg" |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2604 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2605 |
|
197 | 2606 |
acceptReturnAsOK:aBoolean |
2607 |
"turn on/off interpretation of return-key as ok. |
|
2608 |
Default is on" |
|
2609 |
||
2610 |
acceptReturnAsOK := aBoolean. |
|
2611 |
okButton notNil ifTrue:[ |
|
2612 |
okButton isReturnButton:aBoolean. |
|
2613 |
] |
|
2614 |
! |
|
2615 |
||
2616 |
action:aBlock |
|
2617 |
"set the action to be performed when user presses ok-button; |
|
2618 |
aBlock must be nil or a block. This method simply |
|
2619 |
reuses okAction: and has been added for a consistent action-setting |
|
2620 |
protocol." |
|
76 | 2621 |
|
197 | 2622 |
self okAction:aBlock |
2623 |
! |
|
2624 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2625 |
focusOnField:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2626 |
inputFieldGroup makeActive:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2627 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2628 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2629 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2630 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2631 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2632 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2633 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2634 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2635 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2636 |
focusToOKOnLeave:aBoolean |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2637 |
"define the behavior when the last input field is left via a return |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2638 |
or cursor key. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2639 |
The default is to shift the focus to the OK button (i.e. true). |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2640 |
If turned off, the OK is immediately performed, i.e. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2641 |
the dialog is accepted & closed." |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2642 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2643 |
focusToOKOnLeave := aBoolean. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2644 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2645 |
"Modified: 19.4.1996 / 17:05:12 / cg" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2646 |
"Created: 19.4.1996 / 17:13:36 / cg" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2647 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
2648 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2649 |
hideOnAccept:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2650 |
"control if the dialog should close when accepted. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2651 |
The default is true" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2652 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2653 |
hideOnAccept := aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2654 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2655 |
|
593 | 2656 |
makeTabable:aComponentOrSubcomponent |
2657 |
"add a component (usually a subcomponent, of which the dialog |
|
2658 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
2659 |
stepped through via FocusNext/FocusPrevious). |
|
2660 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
2661 |
||
2662 |
tabableElements isNil ifTrue:[ |
|
2663 |
tabableElements := OrderedCollection new |
|
2664 |
]. |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2665 |
(tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2666 |
tabableElements add:aComponentOrSubcomponent. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2667 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2668 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2669 |
self addToInputFieldGroup:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2670 |
]. |
593 | 2671 |
]. |
2672 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2673 |
"Modified: 31.5.1996 / 21:22:13 / cg" |
593 | 2674 |
! |
2675 |
||
2676 |
makeTabable:aComponentOrSubcomponent before:anotherComponent |
|
2677 |
"add a component (usually a subcomponent, of which the dialog |
|
2678 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
2679 |
stepped through via FocusNext/FocusPrevious). |
|
2680 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
2681 |
||
2682 |
tabableElements isNil ifTrue:[ |
|
2683 |
tabableElements := OrderedCollection new |
|
2684 |
]. |
|
989
ca2cdf005359
use #removeIdentical: - its faster.
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
2685 |
tabableElements removeIdentical:aComponentOrSubcomponent ifAbsent:nil. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
2686 |
|
593 | 2687 |
anotherComponent isNil ifTrue:[ |
2688 |
tabableElements addFirst:aComponentOrSubcomponent |
|
2689 |
] ifFalse:[ |
|
2690 |
tabableElements add:aComponentOrSubcomponent before:anotherComponent. |
|
2691 |
]. |
|
2692 |
||
2693 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
1355 | 2694 |
self addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
593 | 2695 |
]. |
2696 |
||
1355 | 2697 |
"Modified: 18.10.1997 / 03:08:20 / cg" |
2698 |
! |
|
2699 |
||
2700 |
makeUntabable:aComponentOrSubcomponent |
|
2701 |
(tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
2702 |
tabableElements removeIdentical:aComponentOrSubcomponent. |
|
2703 |
||
2704 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
2705 |
self removeFromInputFieldGroup:aComponentOrSubcomponent |
|
2706 |
]. |
|
2707 |
]. |
|
2708 |
||
2709 |
"Modified: 18.10.1997 / 02:50:05 / cg" |
|
593 | 2710 |
! |
2711 |
||
197 | 2712 |
okAction:aBlock |
2713 |
"define the action to be performed when ok is pressed" |
|
133 | 2714 |
|
197 | 2715 |
okAction := aBlock |
2716 |
! ! |
|
2717 |
||
2718 |
!DialogBox methodsFor:'accessing-components'! |
|
2719 |
||
2720 |
abortButton |
|
2721 |
"return the abortButton - this access is provided to allow |
|
2722 |
setting the buttons look (for example: colors or font)" |
|
2723 |
||
2724 |
^ abortButton |
|
76 | 2725 |
! |
2726 |
||
197 | 2727 |
okButton |
2728 |
"return the okButton - this access is provided to allow |
|
2729 |
setting the buttons look (for example: colors or font)" |
|
76 | 2730 |
|
197 | 2731 |
^ okButton |
2732 |
! ! |
|
155 | 2733 |
|
197 | 2734 |
!DialogBox methodsFor:'accessing-elements'! |
2735 |
||
2736 |
componentAt:name |
|
680 | 2737 |
"retrieve a component by name - to access it, it must have been |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2738 |
named previously with #name:as:" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2739 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2740 |
namedComponents isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2741 |
^ namedComponents at:name ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2742 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2743 |
"Modified: 16.1.1997 / 11:40:50 / cg" |
76 | 2744 |
! |
2745 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2746 |
inputFieldGroup |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2747 |
^ inputFieldGroup |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2748 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2749 |
|
197 | 2750 |
name:element as:name |
680 | 2751 |
"assign a name to a component. This can be done during construction, |
2752 |
to allow later access to the components (i.e. without a need to |
|
2753 |
remember them in some instVars)" |
|
2754 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2755 |
namedComponents isNil ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2756 |
namedComponents := Dictionary new. |
197 | 2757 |
]. |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2758 |
namedComponents at:name put:element |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2759 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2760 |
"Modified: 16.1.1997 / 11:41:03 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2761 |
! ! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2762 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2763 |
!DialogBox methodsFor:'accessing-look'! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2764 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2765 |
abortText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2766 |
"define the label in the abort-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2767 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2768 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2769 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2770 |
aString ~= abortButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2771 |
oldSize := abortButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2772 |
abortButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2773 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2774 |
abortButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2775 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2776 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2777 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2778 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2779 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2780 |
okText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2781 |
"define the text in the ok-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2782 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2783 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2784 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2785 |
aString ~= okButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2786 |
oldSize := okButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2787 |
okButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2788 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2789 |
okButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2790 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2791 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2792 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2793 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2794 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2795 |
okText:okString abortText:abortString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2796 |
"set both texts displayed in the buttons" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2797 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2798 |
(abortString ~= abortButton label |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2799 |
or:[okString ~= okButton label]) ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2800 |
okButton label:okString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2801 |
abortButton label:abortString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2802 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2803 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2804 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2805 |
] |
197 | 2806 |
! ! |
2807 |
||
2808 |
!DialogBox methodsFor:'accessing-models'! |
|
76 | 2809 |
|
197 | 2810 |
accept |
2811 |
"return the valueHolder holding true when the box |
|
2812 |
is accepted, false if closed via the windowManager or |
|
2813 |
the cancel button. |
|
2814 |
This is confusing: this method was originally called #acceptValue, |
|
2815 |
but renamed for compatibility with ST-80. |
|
2816 |
This looks like a bad name to me, since in most other situations, #accept |
|
2817 |
is used to force an accept, not to return some valueHolder ...)." |
|
2818 |
||
2819 |
^ acceptValue |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2820 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2821 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2822 |
acceptChannel:aValueHolder |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2823 |
"set the valueHolder which is set to true when the box |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2824 |
is accepted" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2825 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
2826 |
acceptValue := aValueHolder |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2827 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2828 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2829 |
aspectAt:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2830 |
"return the dataModel for some aspect, nil if no such dataModel was defined; |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2831 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2832 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2833 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2834 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2835 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2836 |
bindings isNil ifTrue:[bindings := IdentityDictionary new]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2837 |
bindings at:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2838 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2839 |
"Created: 16.1.1997 / 11:38:46 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2840 |
"Modified: 16.1.1997 / 11:41:28 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2841 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2842 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2843 |
aspectFor:anAspectSymbol |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2844 |
"return the dataModel for some aspect, nil if no such dataModel was defined; |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2845 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2846 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2847 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2848 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2849 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2850 |
bindings isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2851 |
^ bindings at:anAspectSymbol ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2852 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
2853 |
"Modified: 16.1.1997 / 11:41:34 / cg" |
76 | 2854 |
! ! |
2855 |
||
120 | 2856 |
!DialogBox methodsFor:'construction-adding'! |
2857 |
||
593 | 2858 |
addComponent:aComponent |
2859 |
"add any component with its preferred height and full width. |
|
2860 |
Returns the component." |
|
2861 |
||
2862 |
^ self addComponent:aComponent indent:nil tabable:false |
|
2863 |
||
2864 |
"Modified: 9.2.1996 / 22:22:41 / cg" |
|
2865 |
! |
|
2866 |
||
2867 |
addComponent:aComponent indent:indent |
|
2868 |
"add any component with its preferred height and full width. |
|
2869 |
The indent is temporarily changed to indent. |
|
2870 |
Returns the component." |
|
2871 |
||
2872 |
^ self addComponent:aComponent indent:indent tabable:false |
|
2873 |
||
2874 |
"Modified: 9.2.1996 / 22:22:44 / cg" |
|
2875 |
! |
|
2876 |
||
2877 |
addComponent:aComponent indent:indent tabable:tabable |
|
2878 |
"add any component with its preferred height and full width. |
|
2879 |
The indent is temporarily changed to indent. |
|
2880 |
Returns the component." |
|
2881 |
||
2882 |
|oldLeft oldRight result| |
|
2883 |
||
2884 |
oldLeft := leftIndent. |
|
2885 |
oldRight := rightIndent. |
|
2886 |
indent notNil ifTrue:[ |
|
2887 |
leftIndent := rightIndent := indent. |
|
2888 |
]. |
|
2889 |
result := self addComponent:aComponent tabable:tabable tabbedComponent:aComponent. |
|
2890 |
leftIndent := oldLeft. |
|
2891 |
rightIndent := oldRight. |
|
2892 |
^ result |
|
2893 |
||
2894 |
"Modified: 9.2.1996 / 22:22:50 / cg" |
|
2895 |
! |
|
2896 |
||
2897 |
addComponent:aComponent indent:indent withExtent:ext |
|
2898 |
"add any component with some given extent. |
|
2899 |
Returns the component." |
|
2900 |
||
2901 |
|fullSize lI rI| |
|
2902 |
||
2903 |
indent isNil ifTrue:[ |
|
2904 |
lI := leftIndent. |
|
2905 |
rI := rightIndent. |
|
2906 |
] ifFalse:[ |
|
2907 |
lI := rI := indent |
|
2908 |
]. |
|
2909 |
||
2910 |
self basicAddComponent:aComponent. |
|
2911 |
fullSize := ext + (lI + rI @ 0). |
|
2912 |
aComponent extent:fullSize. |
|
2913 |
aComponent origin:0.0@yPosition; |
|
2914 |
leftInset:lI; |
|
2915 |
rightInset:rI. |
|
2916 |
yPosition := yPosition + aComponent height + ViewSpacing. |
|
2917 |
width := fullSize x max:width. |
|
2918 |
needResize := true. |
|
2919 |
^ aComponent |
|
2920 |
||
2921 |
"Modified: 9.2.1996 / 22:22:54 / cg" |
|
2922 |
! |
|
2923 |
||
2924 |
addComponent:aComponent indent:indent withHeight:height |
|
2925 |
"add any component with some given height and full width. |
|
2926 |
Returns the component." |
|
2927 |
||
2928 |
|lI rI| |
|
2929 |
||
2930 |
indent isNil ifTrue:[ |
|
2931 |
lI := leftIndent. |
|
2932 |
rI := rightIndent. |
|
2933 |
] ifFalse:[ |
|
2934 |
lI := rI := indent |
|
2935 |
]. |
|
2936 |
self basicAddComponent:aComponent. |
|
2937 |
aComponent height:height. |
|
2938 |
aComponent origin:0.0@yPosition; |
|
2939 |
width:1.0; |
|
2940 |
leftInset:lI; |
|
2941 |
rightInset:rI. |
|
2942 |
yPosition := yPosition + "aComponent" height + ViewSpacing. |
|
2943 |
needResize := true. |
|
2944 |
^ aComponent |
|
2945 |
||
2946 |
"Modified: 9.2.1996 / 22:22:58 / cg" |
|
2947 |
! |
|
2948 |
||
2949 |
addComponent:aComponent tabable:tabable |
|
2950 |
"add any component with its preferred height and full width. |
|
2951 |
Returns the component." |
|
2952 |
||
2953 |
^ self addComponent:aComponent tabable:tabable tabbedComponent:aComponent |
|
2954 |
||
2955 |
"Modified: 9.2.1996 / 22:23:04 / cg" |
|
2956 |
! |
|
2957 |
||
2958 |
addComponent:aComponent tabable:tabable tabbedComponent:subComponent |
|
2959 |
"add any component with its preferred height and full width. |
|
2960 |
Returns the component." |
|
2961 |
||
2962 |
tabable ifTrue:[ |
|
2963 |
tabableElements isNil ifTrue:[ |
|
2964 |
tabableElements := OrderedCollection new |
|
2965 |
]. |
|
2966 |
tabableElements add:subComponent |
|
2967 |
]. |
|
2968 |
^ self addComponent:aComponent |
|
2969 |
withHeight:(aComponent preferredExtent y). |
|
2970 |
||
2971 |
"Modified: 9.2.1996 / 22:23:07 / cg" |
|
2972 |
! |
|
2973 |
||
2974 |
addComponent:aComponent withExtent:ext |
|
2975 |
"add any component with some given extent. |
|
2976 |
Returns the component." |
|
2977 |
||
2978 |
^ self addComponent:aComponent indent:nil withExtent:ext |
|
2979 |
||
2980 |
"Modified: 9.2.1996 / 22:23:11 / cg" |
|
2981 |
! |
|
2982 |
||
2983 |
addComponent:aComponent withHeight:height |
|
2984 |
"add any component with some given height and full width. |
|
2985 |
Returns the component." |
|
2986 |
||
2987 |
^ self addComponent:aComponent indent:nil withHeight:height |
|
2988 |
||
2989 |
"Modified: 9.2.1996 / 22:23:15 / cg" |
|
2990 |
! |
|
2991 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2992 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable from:leftX to:rightX separateAtX:relativeX |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2993 |
"add a label and some view side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2994 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2995 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2996 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2997 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2998 |
|
795 | 2999 |
^ self |
3000 |
addLabelledField:aView |
|
3001 |
label:labelString |
|
3002 |
adjust:labelAdjust |
|
3003 |
tabable:tabable |
|
3004 |
from:leftX to:rightX separateAtX:relativeX |
|
3005 |
nameAs:nil |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3006 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3007 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3008 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3009 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3010 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3011 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3012 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3013 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3014 |
field := dialog |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3015 |
addLabelledField:(EditField on:model) label:'input here:' |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3016 |
adjust:#left |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3017 |
tabable:true |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3018 |
separateAtX:0.3. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3019 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3020 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3021 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3022 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3023 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3024 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3025 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3026 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3027 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3028 |
model := SelectionInList new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3029 |
model list:#('foo' 'bar' 'baz'). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3030 |
model selectionIndex:2. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3031 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3032 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3033 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3034 |
field := dialog |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3035 |
addLabelledField:(PopUpList on:model) label:'select here:' |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3036 |
adjust:#left |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3037 |
tabable:true |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3038 |
separateAtX:0.3. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3039 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3040 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3041 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3042 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3043 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3044 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3045 |
"Created: 3.6.1996 / 11:03:24 / cg" |
795 | 3046 |
"Modified: 17.7.1996 / 15:04:07 / cg" |
3047 |
! |
|
3048 |
||
3049 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable from:leftX to:rightX separateAtX:relativeX nameAs:aName |
|
3050 |
"add a label and some view side-by-side. |
|
3051 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
3052 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
3053 |
The inputField gets model as its model. |
|
3054 |
Return the inputField." |
|
3055 |
||
3056 |
|y lbl max relW| |
|
3057 |
||
3058 |
y := self yPosition. |
|
3059 |
lbl := Label label:labelString. |
|
3060 |
max := lbl preferredExtent y max:(aView preferredExtent y). |
|
3061 |
||
3062 |
relW := rightX - leftX. |
|
3063 |
||
3064 |
self addComponent:lbl indent:leftIndent withHeight:max. |
|
3065 |
lbl rightInset:0. |
|
3066 |
lbl |
|
3067 |
width:(relW*relativeX); |
|
3068 |
left:leftX; |
|
3069 |
adjust:labelAdjust; borderWidth:0. |
|
3070 |
||
3071 |
self yPosition:y. |
|
3072 |
self addComponent:aView tabable:tabable. |
|
3073 |
aView |
|
3074 |
leftInset:ViewSpacing; |
|
3075 |
rightInset:ViewSpacing. |
|
3076 |
||
3077 |
aView |
|
3078 |
width:relW*(1.0 - relativeX); |
|
3079 |
left:leftX+(relW*relativeX). |
|
3080 |
||
3081 |
aView isInputField ifTrue:[ |
|
3082 |
self addToInputFieldGroup:aView |
|
3083 |
]. |
|
3084 |
||
3085 |
aName notNil ifTrue:[ |
|
3086 |
self name:lbl as:(aName , '.label'). |
|
3087 |
self name:aView as:aName |
|
3088 |
]. |
|
3089 |
^ aView |
|
3090 |
||
3091 |
" |
|
3092 |
|dialog model field| |
|
3093 |
||
3094 |
model := '' asValue. |
|
3095 |
||
3096 |
dialog := DialogBox new. |
|
3097 |
||
3098 |
field := dialog |
|
807 | 3099 |
addLabelledField:(EditField on:model) |
3100 |
label:'input here:' |
|
3101 |
adjust:#left |
|
3102 |
tabable:true |
|
3103 |
separateAtX:0.3. |
|
3104 |
||
3105 |
dialog addAbortButton; addOkButton. |
|
3106 |
dialog open. |
|
3107 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
3108 |
" |
|
3109 |
||
3110 |
" |
|
3111 |
|dialog model field| |
|
3112 |
||
3113 |
model := '' asValue. |
|
3114 |
||
3115 |
dialog := DialogBox new. |
|
3116 |
||
3117 |
field := dialog |
|
3118 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
|
3119 |
label:'select foo:' |
|
795 | 3120 |
adjust:#left |
3121 |
tabable:true |
|
3122 |
separateAtX:0.3. |
|
3123 |
||
3124 |
dialog addAbortButton; addOkButton. |
|
3125 |
dialog open. |
|
3126 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
3127 |
" |
|
3128 |
||
3129 |
" |
|
3130 |
|dialog model field| |
|
3131 |
||
3132 |
model := SelectionInList new. |
|
3133 |
model list:#('foo' 'bar' 'baz'). |
|
3134 |
model selectionIndex:2. |
|
3135 |
||
3136 |
dialog := DialogBox new. |
|
3137 |
||
3138 |
field := dialog |
|
807 | 3139 |
addLabelledField:(PopUpList on:model) |
3140 |
label:'select here:' |
|
795 | 3141 |
adjust:#left |
3142 |
tabable:true |
|
3143 |
separateAtX:0.3. |
|
3144 |
||
3145 |
dialog addAbortButton; addOkButton. |
|
3146 |
dialog open. |
|
3147 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
3148 |
" |
|
3149 |
||
3150 |
"Created: 17.7.1996 / 15:03:32 / cg" |
|
807 | 3151 |
"Modified: 26.7.1996 / 18:11:12 / cg" |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3152 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3153 |
|
593 | 3154 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX |
3155 |
"add a label and some view side-by-side. |
|
3156 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
3157 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
3158 |
The inputField gets model as its model. |
|
3159 |
Return the inputField." |
|
3160 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3161 |
^ self |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3162 |
addLabelledField:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3163 |
label:labelString |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3164 |
adjust:labelAdjust |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3165 |
tabable:tabable |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3166 |
from:0.0 to:1.0 |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3167 |
separateAtX:relativeX |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3168 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3169 |
"/ |y lbl max| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3170 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3171 |
"/ y := self yPosition. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3172 |
"/ lbl := Label label:labelString. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3173 |
"/ max := lbl preferredExtent y max:(aView preferredExtent y). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3174 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3175 |
"/ self addComponent:lbl indent:leftIndent withHeight:max. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3176 |
"/ lbl rightInset:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3177 |
"/ lbl width:relativeX; adjust:labelAdjust; borderWidth:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3178 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3179 |
"/ self yPosition:y. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3180 |
"/ self addComponent:aView tabable:tabable. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3181 |
"/ aView leftInset:ViewSpacing; rightInset:ViewSpacing. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3182 |
"/ aView width:(1.0 - relativeX); left:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3183 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3184 |
"/ aView isInputField ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3185 |
"/ self addToInputFieldGroup:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3186 |
"/ ]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3187 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3188 |
"/ ^ aView |
593 | 3189 |
|
3190 |
" |
|
3191 |
|dialog model field| |
|
3192 |
||
3193 |
model := '' asValue. |
|
3194 |
||
3195 |
dialog := DialogBox new. |
|
3196 |
||
3197 |
field := dialog |
|
3198 |
addLabelledField:(EditField on:model) label:'input here:' |
|
3199 |
adjust:#left |
|
3200 |
tabable:true |
|
3201 |
separateAtX:0.3. |
|
3202 |
||
3203 |
dialog addAbortButton; addOkButton. |
|
3204 |
dialog open. |
|
655 | 3205 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 3206 |
" |
3207 |
||
3208 |
" |
|
3209 |
|dialog model field| |
|
3210 |
||
3211 |
model := SelectionInList new. |
|
3212 |
model list:#('foo' 'bar' 'baz'). |
|
3213 |
model selectionIndex:2. |
|
3214 |
||
3215 |
dialog := DialogBox new. |
|
3216 |
||
3217 |
field := dialog |
|
3218 |
addLabelledField:(PopUpList on:model) label:'select here:' |
|
3219 |
adjust:#left |
|
3220 |
tabable:true |
|
3221 |
separateAtX:0.3. |
|
3222 |
||
3223 |
dialog addAbortButton; addOkButton. |
|
3224 |
dialog open. |
|
655 | 3225 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 3226 |
" |
3227 |
||
3228 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3229 |
"Modified: 3.6.1996 / 18:48:49 / cg" |
593 | 3230 |
! |
3231 |
||
3232 |
addTextLabel:aString |
|
3233 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
3234 |
however, ST/X labels allow image labels too. |
|
3235 |
Returns the label." |
|
3236 |
||
3237 |
|l| |
|
3238 |
||
3239 |
l := Label new label:aString. |
|
3240 |
l borderWidth:0. |
|
3241 |
self addComponent:l. |
|
3242 |
^ l |
|
3243 |
||
3244 |
" |
|
3245 |
|b| |
|
3246 |
||
3247 |
b := DialogBox new. |
|
3248 |
b addTextLabel:'hello'. |
|
3249 |
b showAtPointer |
|
3250 |
" |
|
3251 |
" |
|
3252 |
|b| |
|
3253 |
||
3254 |
b := DialogBox new. |
|
3255 |
b leftIndent:100. |
|
3256 |
b addTextLabel:'hello'. |
|
3257 |
b leftIndent:0. |
|
3258 |
b addTextLabel:'world'. |
|
3259 |
b showAtPointer |
|
3260 |
" |
|
3261 |
" |
|
3262 |
|b| |
|
3263 |
||
3264 |
b := DialogBox new. |
|
3265 |
b addTextLabel:'hello'. |
|
3266 |
b addTextLabel:'world'. |
|
3267 |
b addOkButton. |
|
3268 |
b showAtPointer |
|
3269 |
" |
|
3270 |
" |
|
3271 |
|b| |
|
3272 |
||
3273 |
b := DialogBox new. |
|
3274 |
b addTextLabel:'hello'. |
|
3275 |
(b addTextLabel:'world') foregroundColor:Color red. |
|
3276 |
b addOkButton. |
|
3277 |
b showAtPointer |
|
3278 |
" |
|
3279 |
" |
|
3280 |
|b| |
|
3281 |
||
3282 |
b := DialogBox new. |
|
3283 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
3284 |
b addOkButton. |
|
3285 |
b showAtPointer |
|
3286 |
" |
|
3287 |
" |
|
3288 |
|b| |
|
3289 |
||
3290 |
b := DialogBox new. |
|
3291 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
3292 |
b addTextLabel:'not bad'. |
|
3293 |
b addAbortButton. |
|
3294 |
b addOkButton. |
|
3295 |
b showAtPointer |
|
3296 |
" |
|
3297 |
! |
|
3298 |
||
3299 |
addToInputFieldGroup:aComponentOrSubcomponent |
|
3300 |
"add a component to the input group. |
|
3301 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
3302 |
a topLevel component." |
|
3303 |
||
1355 | 3304 |
self |
3305 |
addToInputFieldGroup:aComponentOrSubcomponent before:nil |
|
3306 |
||
3307 |
"Modified: 18.10.1997 / 03:09:17 / cg" |
|
3308 |
! |
|
3309 |
||
3310 |
addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
|
3311 |
"add a component to the input group. |
|
3312 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
3313 |
a topLevel component." |
|
3314 |
||
593 | 3315 |
inputFieldGroup isNil ifTrue:[ |
3316 |
inputFieldGroup := EnterFieldGroup new. |
|
3317 |
inputFieldGroup leaveAction:[self lastFieldLeft]. |
|
3318 |
aComponentOrSubcomponent hasKeyboardFocus:true. |
|
3319 |
]. |
|
1355 | 3320 |
inputFieldGroup add:aComponentOrSubcomponent before:anotherComponent. |
593 | 3321 |
self delegate:(KeyboardForwarder to:inputFieldGroup condition:#noFocus). |
3322 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3323 |
"/ inputFields isNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3324 |
"/ inputFields := OrderedCollection new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3325 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3326 |
"/ "/ the very first field gets the focus initially |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3327 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3328 |
"/ aComponentOrSubcomponent showCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3329 |
"/ aComponentOrSubcomponent hasKeyboardFocus:true. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3330 |
"/ ] ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3331 |
"/ aComponentOrSubcomponent hideCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3332 |
"/ aComponentOrSubcomponent hasKeyboardFocus:false. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3333 |
"/ ]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3334 |
"/ inputFields add:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3335 |
|
1355 | 3336 |
"Modified: 18.10.1997 / 02:47:20 / cg" |
3337 |
"Created: 18.10.1997 / 03:08:51 / cg" |
|
3338 |
! |
|
3339 |
||
3340 |
removeFromInputFieldGroup:aComponentOrSubcomponent |
|
3341 |
"remove a component from the input group. |
|
3342 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
3343 |
a topLevel component." |
|
3344 |
||
3345 |
inputFieldGroup isNil ifTrue:[^ self]. |
|
3346 |
inputFieldGroup remove:aComponentOrSubcomponent. |
|
3347 |
||
3348 |
"Created: 18.10.1997 / 02:51:30 / cg" |
|
593 | 3349 |
! ! |
3350 |
||
3351 |
!DialogBox methodsFor:'construction-buttons'! |
|
3352 |
||
197 | 3353 |
addAbortButton |
3354 |
"create an abortButton - to be sent from redefined initialize |
|
162 | 3355 |
methods in subclasses or when creating a box programmatically. |
3356 |
Returns the button." |
|
3357 |
||
197 | 3358 |
^ self addAbortButtonLabelled:nil |
122 | 3359 |
! |
120 | 3360 |
|
162 | 3361 |
addAbortButton:aButton |
3362 |
"add an already created abortButton - to be sent from redefined initialize |
|
3363 |
methods in subclasses or when creating a box programmatically. |
|
3364 |
Returns the button." |
|
3365 |
||
3366 |
abortButton := aButton. |
|
3367 |
aButton model:self; change:#abortPressed. |
|
3368 |
^ self addButton:aButton. |
|
3369 |
||
3370 |
"Created: 17.9.1995 / 20:17:26 / claus" |
|
3371 |
! |
|
3372 |
||
122 | 3373 |
addAbortButtonLabelled:buttonLabel |
3374 |
"create an abortButton with a label - to be sent from redefined initialize |
|
3375 |
methods in subclasses or when creating a box programmatically. |
|
3376 |
A nil argument creates one with the default label. |
|
3377 |
Returns the button." |
|
3378 |
||
162 | 3379 |
|aButton| |
3380 |
||
3381 |
aButton := Button abortButton. |
|
3382 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
3383 |
^ self addAbortButton:aButton |
|
3384 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3385 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3386 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3387 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3388 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3389 |
dialog addAbortButtonLabelled:'get out of here'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3390 |
dialog addOkButtonLabelled:'yes thats ok'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3391 |
dialog open. |
655 | 3392 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3393 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3394 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3395 |
"Modified: 9.2.1996 / 22:09:40 / cg" |
120 | 3396 |
! |
76 | 3397 |
|
197 | 3398 |
addButton:aButton |
3399 |
"add a button into the buttonPanel. |
|
122 | 3400 |
Returns the button." |
120 | 3401 |
|
197 | 3402 |
^ self addButton:aButton after:nil |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3403 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3404 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3405 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3406 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3407 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3408 |
dialog addAbortButton. |
655 | 3409 |
dialog addButton:(Button label:'foo' action:[Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3410 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3411 |
dialog open. |
655 | 3412 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3413 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3414 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3415 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3416 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3417 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3418 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3419 |
dialog addAbortButton. |
655 | 3420 |
dialog addButton:(Button label:'foo' action:[dialog hide. Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3421 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3422 |
dialog open. |
655 | 3423 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3424 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3425 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3426 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3427 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3428 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3429 |
dialog := DialogBox new. |
655 | 3430 |
dialog addButton:(Button label:'foo' action:[dialog hide. Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3431 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3432 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3433 |
dialog open. |
655 | 3434 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3435 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3436 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3437 |
"Modified: 9.2.1996 / 22:14:17 / cg" |
197 | 3438 |
! |
3439 |
||
3440 |
addButton:aButton after:someOtherButtonOrNil |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3441 |
"add a button into the buttonPanel. |
197 | 3442 |
If the argument someOtherButtonOrNil is nil, the button is |
3443 |
added at the end." |
|
3444 |
||
3445 |
|h| |
|
3446 |
||
3447 |
buttonPanel addSubView:aButton after:someOtherButtonOrNil. |
|
3448 |
buttonPanel subViews size > 1 ifTrue:[ |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3449 |
buttonPanel horizontalLayout:#fitSpace. |
197 | 3450 |
]. |
3451 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3452 |
buttonPanel topInset:h negated |
197 | 3453 |
]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
3454 |
needResize := true. |
197 | 3455 |
^ aButton |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
3456 |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3457 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3458 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3459 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3460 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3461 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3462 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3463 |
dialog addButton:(Button |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3464 |
label:'foo' |
655 | 3465 |
action:[dialog hide. Transcript showCR:'foo']) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3466 |
after:(dialog okButton). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3467 |
dialog open. |
655 | 3468 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3469 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3470 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3471 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3472 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3473 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3474 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3475 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3476 |
dialog addButton:(Button |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3477 |
label:'foo' |
655 | 3478 |
action:[dialog hide. Transcript showCR:'foo']) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3479 |
after:(dialog abortButton). |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3480 |
dialog open. |
655 | 3481 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3482 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3483 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3484 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3485 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3486 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3487 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3488 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3489 |
dialog addButton:(Button |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3490 |
label:'foo' |
655 | 3491 |
action:[dialog hide. Transcript showCR:'foo']) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3492 |
after:nil. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3493 |
dialog open. |
655 | 3494 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3495 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3496 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3497 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
197 | 3498 |
! |
3499 |
||
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3500 |
addButton:aButton before:someOtherButtonOrNil |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3501 |
"add a button into the buttonPanel. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3502 |
If the argument someOtherButtonOrNil is nil, the button is |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3503 |
added upFront." |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3504 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3505 |
|h| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3506 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3507 |
buttonPanel addSubView:aButton before:someOtherButtonOrNil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3508 |
buttonPanel subViews size > 1 ifTrue:[ |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3509 |
buttonPanel horizontalLayout:#fitSpace. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3510 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3511 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3512 |
buttonPanel topInset:h negated |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3513 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3514 |
needResize := true. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3515 |
^ aButton |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3516 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3517 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3518 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3519 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3520 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3521 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3522 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3523 |
dialog addButton:(Button |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3524 |
label:'foo' |
655 | 3525 |
action:[dialog hide. Transcript showCR:'foo']) |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3526 |
before:(dialog okButton). |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3527 |
dialog open. |
655 | 3528 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3529 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3530 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3531 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3532 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3533 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3534 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3535 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3536 |
dialog addButton:(Button |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3537 |
label:'foo' |
655 | 3538 |
action:[dialog hide. Transcript showCR:'foo']) |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3539 |
before:nil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3540 |
dialog open. |
655 | 3541 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3542 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3543 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3544 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3545 |
"Created: 10.2.1996 / 16:04:35 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3546 |
! |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
3547 |
|
593 | 3548 |
addHelpButtonFor:pathToHelpText |
3549 |
"add a help button to the buttonPanel. |
|
3550 |
The argument, pathToHelpText should specify the path to the help |
|
3551 |
text under either the doc/online/<language> or the help/<language> |
|
3552 |
directory." |
|
3553 |
||
3554 |
|helpButton| |
|
3555 |
||
3556 |
helpButton := Button label:(resources string:'help'). |
|
3557 |
helpButton action:[ |
|
659 | 3558 |
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:pathToHelpText]]. |
593 | 3559 |
^ self addButton:helpButton before:nil. |
3560 |
||
3561 |
" |
|
3562 |
|box| |
|
3563 |
||
3564 |
box := DialogBox new. |
|
3565 |
box |
|
831
8af010be0a02
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
807
diff
changeset
|
3566 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
593 | 3567 |
addAbortButton; |
3568 |
addOkButton. |
|
3569 |
||
3570 |
box open |
|
3571 |
" |
|
3572 |
||
659 | 3573 |
"Modified: 20.5.1996 / 20:30:55 / cg" |
831
8af010be0a02
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
807
diff
changeset
|
3574 |
"Modified: 9.9.1996 / 22:40:21 / stefan" |
593 | 3575 |
! |
3576 |
||
3577 |
addOkButton |
|
3578 |
"create an okButton - to be sent from redefined initialize |
|
3579 |
methods in subclasses or when creating a box programmatically. |
|
3580 |
Returns the button." |
|
3581 |
||
3582 |
^ self addOkButtonLabelled:nil |
|
3583 |
||
3584 |
" |
|
3585 |
|dialog| |
|
3586 |
||
3587 |
dialog := DialogBox new. |
|
3588 |
dialog addOkButton. |
|
3589 |
dialog open. |
|
655 | 3590 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 3591 |
" |
3592 |
||
3593 |
"Modified: 9.2.1996 / 21:37:02 / cg" |
|
3594 |
! |
|
3595 |
||
3596 |
addOkButton:aButton |
|
3597 |
"add an already created okButton - to be sent from redefined initialize |
|
3598 |
methods in subclasses or when creating a box programmatically. |
|
3599 |
Returns the button." |
|
3600 |
||
3601 |
okButton := aButton. |
|
3602 |
aButton model:self; change:#okPressed. |
|
3603 |
^ self addButton:aButton. |
|
3604 |
||
3605 |
" |
|
3606 |
|dialog b| |
|
3607 |
||
3608 |
b := Button label:((Image fromFile:'garfield.gif') magnifiedBy:0.5). |
|
3609 |
||
3610 |
dialog := DialogBox new. |
|
3611 |
dialog addOkButton:b. |
|
3612 |
dialog open. |
|
655 | 3613 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 3614 |
" |
3615 |
||
3616 |
"Modified: 17.9.1995 / 20:20:41 / claus" |
|
3617 |
"Modified: 9.2.1996 / 21:38:48 / cg" |
|
3618 |
! |
|
3619 |
||
3620 |
addOkButtonLabelled:buttonLabel |
|
3621 |
"create an okButton with a label - to be sent from redefined initialize |
|
3622 |
methods in subclasses or when creating a box programmatically. |
|
3623 |
A nil argument creates one with the default text. |
|
3624 |
Returns the button." |
|
3625 |
||
3626 |
|aButton| |
|
3627 |
||
3628 |
aButton := Button okButton. |
|
3629 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
3630 |
aButton isReturnButton:acceptReturnAsOK. |
|
3631 |
^ self addOkButton:aButton. |
|
3632 |
||
3633 |
" |
|
3634 |
|dialog| |
|
3635 |
||
3636 |
dialog := DialogBox new. |
|
3637 |
dialog addOkButtonLabelled:'get out of here'. |
|
3638 |
dialog open. |
|
655 | 3639 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 3640 |
" |
3641 |
||
3642 |
"Modified: 9.2.1996 / 21:39:34 / cg" |
|
3643 |
! ! |
|
3644 |
||
3645 |
!DialogBox methodsFor:'construction-check & comboboxes'! |
|
3646 |
||
197 | 3647 |
addCheckBox:label on:aModel |
3648 |
"create a checkBox with label on aModel and add it. |
|
3649 |
Returns the box." |
|
3650 |
||
3651 |
^ self addCheckBox:label on:aModel tabable:true |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3652 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3653 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3654 |
|dialog check| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3655 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3656 |
check := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3657 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3658 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3659 |
dialog addCheckBox:'on or off' on:check. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3660 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3661 |
dialog open. |
655 | 3662 |
dialog accepted ifTrue:[Transcript showCR:check value]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3663 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3664 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3665 |
"Modified: 9.2.1996 / 22:15:38 / cg" |
197 | 3666 |
! |
3667 |
||
600 | 3668 |
addCheckBox:label on:aModel tabable:tabable |
3669 |
"create a checkBox with label on aModel and add it. |
|
3670 |
Returns the box." |
|
3671 |
||
3672 |
|b| |
|
3673 |
||
3674 |
b := CheckBox on:aModel. |
|
3675 |
b label:label. |
|
3676 |
self addComponent:b tabable:tabable. |
|
3677 |
^ b |
|
3678 |
||
3679 |
" |
|
3680 |
|dialog check1 check2 check3| |
|
3681 |
||
3682 |
check1 := true asValue. |
|
3683 |
check2 := false asValue. |
|
3684 |
check3 := true asValue. |
|
3685 |
||
3686 |
dialog := DialogBox new. |
|
3687 |
dialog addCheckBox:'on or off' on:check1 tabable:false. |
|
3688 |
dialog addHorizontalLine. |
|
3689 |
||
3690 |
dialog addCheckBox:'on or off' on:check2 tabable:true. |
|
3691 |
dialog addCheckBox:'on or off' on:check3 tabable:true. |
|
3692 |
dialog addOkButton. |
|
3693 |
dialog open. |
|
3694 |
" |
|
3695 |
||
3696 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
3697 |
! |
|
3698 |
||
593 | 3699 |
addComboBoxOn:aModel |
3700 |
"create a comboBoxView on aModel and add it. |
|
3701 |
Returns the comboBoxView." |
|
3702 |
||
3703 |
^ self addComboBoxOn:aModel tabable:true |
|
3704 |
||
3705 |
" |
|
3706 |
without a list, the comboBox is disabled: |
|
3707 |
||
3708 |
|box val| |
|
3709 |
||
3710 |
val := 'some input' asValue. |
|
3711 |
||
3712 |
box := Dialog new. |
|
3713 |
||
3714 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3715 |
box addVerticalSpace. |
|
3716 |
(box addComboBoxOn:val). |
|
3717 |
box addOkButton. |
|
3718 |
box open. |
|
3719 |
box accepted ifTrue:[ |
|
655 | 3720 |
Transcript showCR:val value |
593 | 3721 |
]. |
3722 |
" |
|
3723 |
||
3724 |
"with a list, it can be pulled: |
|
3725 |
||
3726 |
|box val| |
|
3727 |
||
3728 |
val := '' asValue. |
|
3729 |
||
3730 |
box := Dialog new. |
|
3731 |
||
3732 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3733 |
box addVerticalSpace. |
|
3734 |
(box addComboBoxOn:val) list:#('one' 'two' 'three' 'four'). |
|
3735 |
box addOkButton. |
|
3736 |
box open. |
|
3737 |
box accepted ifTrue:[ |
|
655 | 3738 |
Transcript showCR:val value |
593 | 3739 |
]. |
3740 |
" |
|
3741 |
||
3742 |
"Modified: 28.2.1996 / 15:17:39 / cg" |
|
3743 |
"Created: 4.3.1996 / 17:21:45 / cg" |
|
3744 |
! |
|
3745 |
||
3746 |
addComboBoxOn:aModel tabable:tabable |
|
3747 |
"create a comboBoxView on aModel and add it. |
|
3748 |
Returns the comboBoxView." |
|
3749 |
||
3750 |
|f| |
|
3751 |
||
3752 |
f := ComboBoxView new. |
|
3753 |
f model:aModel. |
|
3754 |
self addComponent:f tabable:tabable. |
|
3755 |
tabable ifTrue:[ |
|
3756 |
self addToInputFieldGroup:f editor. |
|
3757 |
]. |
|
3758 |
^ f |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3759 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3760 |
" |
593 | 3761 |
without a list, the comboBox is disabled: |
3762 |
||
3763 |
|box val| |
|
3764 |
||
3765 |
val := 'some input' asValue. |
|
3766 |
||
3767 |
box := Dialog new. |
|
3768 |
||
3769 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3770 |
box addVerticalSpace. |
|
3771 |
(box addComboBoxOn:val tabable:true). |
|
3772 |
box addOkButton. |
|
3773 |
box open. |
|
3774 |
box accepted ifTrue:[ |
|
655 | 3775 |
Transcript showCR:val value |
593 | 3776 |
]. |
3777 |
" |
|
3778 |
||
3779 |
"with a list, it can be pulled: |
|
3780 |
||
3781 |
|box val| |
|
3782 |
||
3783 |
val := '' asValue. |
|
3784 |
||
3785 |
box := Dialog new. |
|
3786 |
||
3787 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3788 |
box addVerticalSpace. |
|
3789 |
(box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
3790 |
box addOkButton. |
|
3791 |
box open. |
|
3792 |
box accepted ifTrue:[ |
|
655 | 3793 |
Transcript showCR:val value |
593 | 3794 |
]. |
3795 |
" |
|
3796 |
||
3797 |
"Modified: 4.3.1996 / 17:21:57 / cg" |
|
3798 |
! |
|
3799 |
||
3800 |
addComboListOn:aModel |
|
3801 |
"create a comboListView on aModel and add it. |
|
3802 |
Returns the comboListView." |
|
3803 |
||
3804 |
^ self addComboListOn:aModel tabable:true |
|
3805 |
||
3806 |
"without a list, the comboList is disabled: |
|
3807 |
||
3808 |
|box val| |
|
3809 |
||
3810 |
val := 'some input' asValue. |
|
3811 |
||
3812 |
box := Dialog new. |
|
3813 |
||
3814 |
(box addTextLabel:'combo list example') adjust:#left. |
|
3815 |
box addVerticalSpace. |
|
3816 |
(box addComboListOn:val). |
|
3817 |
box addOkButton. |
|
3818 |
box open. |
|
3819 |
box accepted ifTrue:[ |
|
655 | 3820 |
Transcript showCR:val value |
593 | 3821 |
]. |
3822 |
" |
|
3823 |
||
3824 |
"with a list, it can be pulled: |
|
3825 |
||
3826 |
|box val| |
|
3827 |
||
3828 |
val := '' asValue. |
|
3829 |
||
3830 |
box := Dialog new. |
|
3831 |
||
3832 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3833 |
box addVerticalSpace. |
|
3834 |
(box addComboListOn:val) list:#('one' 'two' 'three' 'four'). |
|
3835 |
box addOkButton. |
|
3836 |
box open. |
|
3837 |
box accepted ifTrue:[ |
|
655 | 3838 |
Transcript showCR:val value |
593 | 3839 |
]. |
3840 |
" |
|
3841 |
||
3842 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
3843 |
"Modified: 4.3.1996 / 17:22:59 / cg" |
|
3844 |
! |
|
3845 |
||
3846 |
addComboListOn:aModel tabable:tabable |
|
3847 |
"create a comboListView on aModel and add it. |
|
3848 |
Returns the comboListView." |
|
3849 |
||
3850 |
|f| |
|
3851 |
||
3852 |
f := ComboListView new. |
|
3853 |
f model:aModel. |
|
3854 |
self addComponent:f tabable:tabable. |
|
3855 |
^ f |
|
3856 |
||
3857 |
"without a list, the comboList is disabled: |
|
3858 |
||
3859 |
|box val| |
|
3860 |
||
3861 |
val := 'some input' asValue. |
|
3862 |
||
3863 |
box := Dialog new. |
|
3864 |
||
3865 |
(box addTextLabel:'combo list example') adjust:#left. |
|
3866 |
box addVerticalSpace. |
|
3867 |
(box addComboListOn:val tabable:true). |
|
3868 |
box addOkButton. |
|
3869 |
box open. |
|
3870 |
box accepted ifTrue:[ |
|
655 | 3871 |
Transcript showCR:val value |
593 | 3872 |
]. |
3873 |
" |
|
3874 |
||
3875 |
"with a list, it can be pulled: |
|
3876 |
||
3877 |
|box val| |
|
3878 |
||
3879 |
val := '' asValue. |
|
3880 |
||
3881 |
box := Dialog new. |
|
3882 |
||
3883 |
(box addTextLabel:'combo box example') adjust:#left. |
|
3884 |
box addVerticalSpace. |
|
3885 |
(box addComboListOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
3886 |
box addOkButton. |
|
3887 |
box open. |
|
3888 |
box accepted ifTrue:[ |
|
655 | 3889 |
Transcript showCR:val value |
593 | 3890 |
]. |
3891 |
" |
|
3892 |
||
3893 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
3894 |
"Modified: 4.3.1996 / 17:23:38 / cg" |
|
3895 |
! ! |
|
3896 |
||
3897 |
!DialogBox methodsFor:'construction-inputfields'! |
|
3898 |
||
3899 |
addFilenameInputFieldOn:aModel in:aDirectory tabable:tabable |
|
3900 |
"create a fileName input field on aModel and add it. |
|
3901 |
Returns the field. This is much like a normal input field, |
|
3902 |
but supports filename completion." |
|
3903 |
||
3904 |
|f| |
|
3905 |
||
3906 |
f := FilenameEditField new. |
|
3907 |
aDirectory notNil ifTrue:[f directory:aDirectory]. |
|
3908 |
f model:aModel. |
|
3909 |
self addInputField:f tabable:tabable. |
|
3910 |
^ f |
|
3911 |
! |
|
3912 |
||
3913 |
addInputField:aField |
|
3914 |
"add an already created input field. |
|
3915 |
Returns the field." |
|
3916 |
||
3917 |
^ self addInputField:aField tabable:true |
|
3918 |
||
3919 |
"Modified: 9.2.1996 / 20:46:16 / cg" |
|
3920 |
! |
|
3921 |
||
3922 |
addInputField:aField tabable:tabable |
|
3923 |
"add an already created input field. |
|
3924 |
If tabable is true, the field is put into a group, to allow |
|
3925 |
stepping through the fields with #Cursor/#Return keys. |
|
3926 |
Returns the field." |
|
3927 |
||
3928 |
self addComponent:aField tabable:tabable. |
|
3929 |
tabable ifTrue:[ |
|
3930 |
self addToInputFieldGroup:aField. |
|
3931 |
]. |
|
3932 |
^ aField |
|
3933 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
3934 |
"Modified: 31.5.1996 / 21:22:29 / cg" |
593 | 3935 |
! |
3936 |
||
3937 |
addInputFieldOn:aModel |
|
3938 |
"create an input field on aModel and add it. |
|
3939 |
Returns the field." |
|
3940 |
||
3941 |
^ self addInputFieldOn:aModel tabable:true |
|
3942 |
||
3943 |
" |
|
3944 |
|dialog model field| |
|
3945 |
||
3946 |
model := '' asValue. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3947 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
3948 |
dialog := DialogBox new. |
593 | 3949 |
(dialog addTextLabel:'enter a string') adjust:#left. |
3950 |
||
3951 |
field := dialog addInputFieldOn:model. |
|
3952 |
||
3953 |
dialog addAbortButton; addOkButton. |
|
3954 |
dialog open. |
|
655 | 3955 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 3956 |
" |
3957 |
||
3958 |
"Modified: 9.2.1996 / 21:34:14 / cg" |
|
3959 |
! |
|
3960 |
||
3961 |
addInputFieldOn:aModel tabable:tabable |
|
3962 |
"create an input field on aModel and add it. |
|
3963 |
If tabable is false, the field cannot be tabbed into |
|
3964 |
and return does not close the box. |
|
3965 |
(pointer must be moved into it). |
|
3966 |
Returns the field." |
|
3967 |
||
3968 |
|f| |
|
3969 |
||
913 | 3970 |
f := EditField model:aModel. |
593 | 3971 |
self addInputField:f tabable:tabable. |
3972 |
^ f |
|
3973 |
||
3974 |
" a non-tabable field: |
|
3975 |
||
3976 |
|dialog model field| |
|
3977 |
||
3978 |
model := '' asValue. |
|
3979 |
||
3980 |
dialog := DialogBox new. |
|
3981 |
(dialog addTextLabel:'enter a string') adjust:#left. |
|
3982 |
||
3983 |
field := dialog addInputFieldOn:model tabable:false. |
|
3984 |
||
3985 |
dialog addAbortButton; addOkButton. |
|
3986 |
dialog open. |
|
655 | 3987 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 3988 |
" |
3989 |
||
3990 |
"Modified: 9.2.1996 / 21:36:16 / cg" |
|
913 | 3991 |
"Modified: 3.1.1997 / 10:24:04 / stefan" |
593 | 3992 |
! |
3993 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3994 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable from:leftX to:rightX separateAtX:relativeX |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3995 |
"add a label and an inputField side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3996 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3997 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3998 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
3999 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4000 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4001 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4002 |
^ self |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4003 |
addLabelledField:(EditField on:model) label:labelString |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4004 |
adjust:labelAdjust |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4005 |
tabable:tabable |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4006 |
from:leftX to:rightX |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4007 |
separateAtX:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4008 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4009 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4010 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4011 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4012 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4013 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4014 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4015 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4016 |
field := dialog |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4017 |
addLabelledInputField:'enter a string' |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4018 |
adjust:#left |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4019 |
on:model |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4020 |
tabable:true |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4021 |
separateAtX:0.3. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4022 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4023 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4024 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4025 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4026 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4027 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4028 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4029 |
|dialog model1 model2 field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4030 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4031 |
model1 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4032 |
model2 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4033 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4034 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4035 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4036 |
dialog addTextLabel:'a two-input box'. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4037 |
dialog addHorizontalLine. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4038 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4039 |
field := dialog |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4040 |
addLabelledInputField:'string1:' |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4041 |
adjust:#right |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4042 |
on:model1 |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4043 |
tabable:true |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4044 |
separateAtX:0.4. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4045 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4046 |
field := dialog |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4047 |
addLabelledInputField:'string2:' |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4048 |
adjust:#right |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4049 |
on:model2 |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4050 |
tabable:true |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4051 |
separateAtX:0.4. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4052 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4053 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4054 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4055 |
dialog accepted ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4056 |
Transcript showCR:model1 value. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4057 |
Transcript showCR:model2 value. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4058 |
]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4059 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4060 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4061 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4062 |
"Created: 3.6.1996 / 11:04:23 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4063 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
4064 |
|
593 | 4065 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable separateAtX:relativeX |
4066 |
"add a label and an inputField side-by-side. |
|
4067 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
4068 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
4069 |
The inputField gets model as its model. |
|
4070 |
Return the inputField." |
|
4071 |
||
4072 |
||
4073 |
^ self |
|
4074 |
addLabelledField:(EditField on:model) label:labelString |
|
4075 |
adjust:labelAdjust |
|
4076 |
tabable:tabable |
|
4077 |
separateAtX:relativeX. |
|
4078 |
||
4079 |
" |
|
4080 |
|dialog model field| |
|
4081 |
||
4082 |
model := '' asValue. |
|
4083 |
||
4084 |
dialog := DialogBox new. |
|
4085 |
||
4086 |
field := dialog |
|
4087 |
addLabelledInputField:'enter a string' |
|
4088 |
adjust:#left |
|
4089 |
on:model |
|
4090 |
tabable:true |
|
4091 |
separateAtX:0.3. |
|
4092 |
||
4093 |
dialog addAbortButton; addOkButton. |
|
4094 |
dialog open. |
|
655 | 4095 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 4096 |
" |
4097 |
||
4098 |
" |
|
4099 |
|dialog model1 model2 field| |
|
4100 |
||
4101 |
model1 := '' asValue. |
|
4102 |
model2 := '' asValue. |
|
4103 |
||
4104 |
dialog := DialogBox new. |
|
4105 |
||
4106 |
dialog addTextLabel:'a two-input box'. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4107 |
dialog addHorizontalLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4108 |
|
593 | 4109 |
field := dialog |
4110 |
addLabelledInputField:'string1:' |
|
4111 |
adjust:#right |
|
4112 |
on:model1 |
|
4113 |
tabable:true |
|
4114 |
separateAtX:0.4. |
|
4115 |
||
4116 |
field := dialog |
|
4117 |
addLabelledInputField:'string2:' |
|
4118 |
adjust:#right |
|
4119 |
on:model2 |
|
4120 |
tabable:true |
|
4121 |
separateAtX:0.4. |
|
4122 |
||
4123 |
dialog addAbortButton; addOkButton. |
|
4124 |
dialog open. |
|
4125 |
dialog accepted ifTrue:[ |
|
655 | 4126 |
Transcript showCR:model1 value. |
4127 |
Transcript showCR:model2 value. |
|
593 | 4128 |
]. |
4129 |
" |
|
4130 |
||
4131 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
4132 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
|
4133 |
! ! |
|
4134 |
||
4135 |
!DialogBox methodsFor:'construction-layout'! |
|
4136 |
||
4137 |
addHorizontalLine |
|
4138 |
"add a horizontal line as separator" |
|
4139 |
||
4140 |
^ self addComponent:(Separator new extent:1.0 @ 5). |
|
4141 |
||
4142 |
" |
|
4143 |
|dialog| |
|
4144 |
||
4145 |
dialog := DialogBox new. |
|
4146 |
dialog |
|
4147 |
addTextLabel:'some title string'; |
|
4148 |
addHorizontalLine; |
|
4149 |
addTextLabel:'more text'; |
|
4150 |
addOkButton; |
|
4151 |
open. |
|
4152 |
" |
|
4153 |
||
4154 |
" |
|
4155 |
|dialog| |
|
4156 |
||
4157 |
dialog := DialogBox new. |
|
4158 |
dialog |
|
4159 |
addTextLabel:'some title string'; |
|
4160 |
addHorizontalLine; |
|
4161 |
addTextLabel:'more text'. |
|
4162 |
(dialog addHorizontalLine) width:20. |
|
4163 |
dialog addTextLabel:'more text'. |
|
4164 |
(dialog addHorizontalLine) width:20. |
|
4165 |
dialog |
|
4166 |
addTextLabel:'more text'; |
|
4167 |
addHorizontalLine; |
|
4168 |
addOkButton; |
|
4169 |
open. |
|
4170 |
" |
|
4171 |
||
4172 |
"Modified: 19.4.1996 / 15:11:30 / cg" |
|
4173 |
! |
|
4174 |
||
4175 |
addVerticalSpace |
|
4176 |
"add a default vertical space (1 mm)" |
|
4177 |
||
4178 |
self addVerticalSpace:(ViewSpacing). |
|
4179 |
||
4180 |
" |
|
4181 |
|dialog| |
|
4182 |
||
4183 |
dialog := DialogBox new. |
|
4184 |
dialog addTextLabel:'some title string'. |
|
4185 |
dialog addVerticalSpace. |
|
4186 |
dialog addTextLabel:'more text'. |
|
4187 |
||
4188 |
dialog addOkButton. |
|
4189 |
dialog open. |
|
4190 |
" |
|
4191 |
||
4192 |
"Modified: 9.2.1996 / 21:41:10 / cg" |
|
4193 |
! |
|
4194 |
||
4195 |
addVerticalSpace:nPixel |
|
4196 |
"add some pixels of space to the next component" |
|
4197 |
||
4198 |
yPosition := yPosition + nPixel. |
|
4199 |
needResize := true. |
|
4200 |
||
4201 |
" |
|
4202 |
|dialog| |
|
4203 |
||
4204 |
dialog := DialogBox new. |
|
4205 |
dialog addTextLabel:'some title string'. |
|
4206 |
dialog addVerticalSpace:50. |
|
4207 |
dialog addTextLabel:'more text'. |
|
4208 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4209 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4210 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4211 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4212 |
|
593 | 4213 |
"Modified: 9.2.1996 / 21:41:23 / cg" |
4214 |
! |
|
4215 |
||
4216 |
leftIndent |
|
4217 |
"return the current indent |
|
4218 |
(current x position - thats where the next component will be located)." |
|
4219 |
||
4220 |
^ leftIndent |
|
4221 |
||
4222 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
4223 |
! |
|
4224 |
||
4225 |
leftIndent:aNumber |
|
4226 |
"set the left indent (current x position - thats where the next component |
|
4227 |
will be located)." |
|
4228 |
||
4229 |
leftIndent := aNumber. |
|
4230 |
needResize := true. |
|
4231 |
||
4232 |
" |
|
4233 |
|dialog| |
|
4234 |
||
4235 |
dialog := DialogBox new. |
|
4236 |
(dialog addTextLabel:'label1') adjust:#left. |
|
4237 |
dialog leftIndent:20. |
|
4238 |
(dialog addTextLabel:'label2') adjust:#left. |
|
4239 |
dialog leftIndent:40. |
|
4240 |
(dialog addTextLabel:'label3') adjust:#left. |
|
4241 |
dialog leftIndent:60. |
|
4242 |
(dialog addTextLabel:'label4') adjust:#left. |
|
4243 |
||
4244 |
dialog addOkButton. |
|
4245 |
dialog open. |
|
4246 |
" |
|
4247 |
||
4248 |
"Modified: 9.2.1996 / 21:42:20 / cg" |
|
4249 |
! |
|
4250 |
||
4251 |
rightIndent |
|
4252 |
"return the current right indent." |
|
4253 |
||
4254 |
^ rightIndent |
|
4255 |
||
4256 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
4257 |
! |
|
4258 |
||
4259 |
rightIndent:aNumber |
|
4260 |
"set the right indent" |
|
4261 |
||
4262 |
rightIndent := aNumber. |
|
4263 |
needResize := true. |
|
4264 |
||
4265 |
" |
|
4266 |
|dialog| |
|
4267 |
||
4268 |
dialog := DialogBox new. |
|
4269 |
(dialog addTextLabel:'label1') adjust:#right. |
|
4270 |
dialog rightIndent:20. |
|
4271 |
(dialog addTextLabel:'label2') adjust:#right. |
|
4272 |
dialog rightIndent:40. |
|
4273 |
(dialog addTextLabel:'label3') adjust:#right. |
|
4274 |
dialog rightIndent:60. |
|
4275 |
(dialog addTextLabel:'label4') adjust:#right. |
|
4276 |
||
4277 |
dialog addOkButton. |
|
4278 |
dialog open. |
|
4279 |
" |
|
4280 |
||
4281 |
"Modified: 9.2.1996 / 21:42:46 / cg" |
|
4282 |
! |
|
4283 |
||
4284 |
stickAtBottomWithFixHeight:aComponent |
|
4285 |
"arrange for a component to be positioned at a constant offset |
|
4286 |
from the bottom of the box and its height to remain the same. |
|
4287 |
This will keep the component at a constant distance from the bottom |
|
4288 |
(without this setup, it would stay at a constant offset from the top)" |
|
4289 |
||
4290 |
self resize. |
|
4291 |
||
4292 |
aComponent |
|
4293 |
topInset:(self height - aComponent top) negated; |
|
4294 |
bottomInset:(self height - aComponent bottom); |
|
4295 |
origin:0.0 @ 1.0; corner:1.0 @ 1.0. |
|
4296 |
||
4297 |
" |
|
4298 |
compare the resizing behavior of: |
|
4299 |
||
4300 |
|box| |
|
4301 |
||
4302 |
box := Dialog new. |
|
4303 |
box addTextLabel:'hello'. |
|
4304 |
box addTextLabel:'hello2'. |
|
4305 |
box addOkButton. |
|
4306 |
box show |
|
4307 |
||
4308 |
with: |
|
4309 |
||
4310 |
|box l2| |
|
4311 |
||
4312 |
box := Dialog new. |
|
4313 |
box addTextLabel:'hello'. |
|
4314 |
l2 := box addTextLabel:'hello2'. |
|
4315 |
box addOkButton. |
|
4316 |
box stickAtBottomWithFixHeight:l2. |
|
4317 |
box show |
|
4318 |
" |
|
4319 |
||
4320 |
"Created: 27.1.1996 / 17:17:41 / cg" |
|
4321 |
"Modified: 27.1.1996 / 18:29:03 / cg" |
|
4322 |
! |
|
4323 |
||
4324 |
stickAtBottomWithVariableHeight:aComponent |
|
4325 |
"arrange for a component to be positioned at a constant offset |
|
4326 |
from the bottom of the box and its height to be adjusted. |
|
4327 |
This will resize the component for a constant distance from the top, |
|
4328 |
and the bottom. |
|
4329 |
(without this setup, its height would remain constant)" |
|
4330 |
||
4331 |
self resize. |
|
4332 |
||
4333 |
aComponent |
|
4334 |
bottomInset:(self height - aComponent bottom); |
|
4335 |
corner:1.0@1.0. |
|
4336 |
||
4337 |
" |
|
4338 |
compare the resizing behavior of: |
|
4339 |
||
4340 |
|box| |
|
4341 |
||
4342 |
box := Dialog new. |
|
4343 |
box addTextLabel:'hello'. |
|
4344 |
(box addComponent:(SelectionInListView new)) level:-1. |
|
4345 |
box addOkButton. |
|
4346 |
box show |
|
4347 |
||
4348 |
with: |
|
4349 |
||
4350 |
|box list| |
|
4351 |
||
4352 |
box := Dialog new. |
|
4353 |
box addTextLabel:'hello'. |
|
4354 |
list := (box addComponent:(SelectionInListView new)) level:-1. |
|
4355 |
box addOkButton. |
|
4356 |
box stickAtBottomWithVariableHeight:list. |
|
4357 |
box show |
|
4358 |
" |
|
4359 |
||
4360 |
"Modified: 27.4.1996 / 18:34:20 / cg" |
|
4361 |
! |
|
4362 |
||
4363 |
yPosition |
|
4364 |
"return the current y position (thats where the next component |
|
4365 |
will be located)." |
|
4366 |
||
4367 |
^ yPosition |
|
120 | 4368 |
! |
4369 |
||
593 | 4370 |
yPosition:aNumber |
4371 |
"set the current y position (thats where the next component |
|
4372 |
will be located)." |
|
4373 |
||
4374 |
yPosition := aNumber. |
|
4375 |
needResize := true. |
|
4376 |
||
4377 |
" |
|
4378 |
|dialog pos| |
|
4379 |
||
4380 |
dialog := DialogBox new. |
|
4381 |
pos := dialog yPosition. |
|
4382 |
(dialog addTextLabel:'label1') width:0.5. |
|
4383 |
dialog yPosition:pos. |
|
4384 |
(dialog addTextLabel:'label2') width:0.5; left:0.5. |
|
4385 |
||
4386 |
dialog addOkButton. |
|
4387 |
dialog open. |
|
4388 |
" |
|
4389 |
||
4390 |
" |
|
4391 |
|dialog pos| |
|
4392 |
||
4393 |
dialog := DialogBox new. |
|
4394 |
pos := dialog yPosition. |
|
4395 |
#('one' 'two' 'three' 'four') |
|
4396 |
with:#(0.0 0.25 0.5 0.75) do:[:lbl :x | |
|
4397 |
dialog yPosition:pos. |
|
4398 |
(dialog addComponent:(Button label:lbl) tabable:true) |
|
4399 |
width:0.25; left:x. |
|
4400 |
]. |
|
4401 |
||
4402 |
dialog addOkButton. |
|
4403 |
dialog open. |
|
4404 |
" |
|
4405 |
||
4406 |
"Modified: 9.2.1996 / 21:46:40 / cg" |
|
4407 |
! ! |
|
4408 |
||
4409 |
!DialogBox methodsFor:'construction-lists'! |
|
4410 |
||
4411 |
addListBoxOn:aModel |
|
4412 |
"add a selectionInListView to the box. |
|
4413 |
The listViews ScrollWrapper is returned" |
|
4414 |
||
4415 |
^ self |
|
4416 |
addListBoxOn:aModel |
|
4417 |
withNumberOfLines:nil |
|
4418 |
hScrollable:false |
|
4419 |
vScrollable:true. |
|
4420 |
||
4421 |
" |
|
4422 |
|dialog model listView| |
|
4423 |
||
4424 |
model := SelectionInList new. |
|
4425 |
model list:#('one' 'two' 'three' 'four'). |
|
4426 |
model selectionIndex:2. |
|
4427 |
||
4428 |
dialog := DialogBox new. |
|
4429 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4430 |
||
4431 |
listView := dialog addListBoxOn:model. |
|
4432 |
||
4433 |
dialog addAbortButton; addOkButton. |
|
4434 |
dialog open. |
|
4435 |
||
655 | 4436 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 4437 |
" |
4438 |
||
4439 |
"Modified: 27.4.1996 / 18:27:58 / cg" |
|
4440 |
! |
|
4441 |
||
4442 |
addListBoxOn:aModel class:aListViewClass |
|
4443 |
"create & add an instance of aListViewClass to the box. |
|
4444 |
The listViews ScrollWrapper is returned" |
|
4445 |
||
4446 |
^ self |
|
4447 |
addListBoxOn:aModel |
|
4448 |
class:aListViewClass |
|
4449 |
withNumberOfLines:nil |
|
4450 |
hScrollable:false |
|
4451 |
vScrollable:true. |
|
4452 |
||
4453 |
"Created: 19.4.1996 / 13:06:14 / cg" |
|
4454 |
"Modified: 27.4.1996 / 18:27:53 / cg" |
|
4455 |
! |
|
4456 |
||
4457 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines |
|
4458 |
"create and add an instance of aListViewClass to the box. |
|
4459 |
The list has numLines (if nonNil) number of lines shown. |
|
4460 |
The listViews ScrollWrapper is returned" |
|
4461 |
||
4462 |
^ self |
|
4463 |
addListBoxOn:aModel |
|
4464 |
class:aListViewClass |
|
4465 |
withNumberOfLines:numLines |
|
4466 |
hScrollable:false |
|
4467 |
vScrollable:true. |
|
4468 |
||
4469 |
"Created: 19.4.1996 / 13:05:05 / cg" |
|
4470 |
"Modified: 27.4.1996 / 18:27:48 / cg" |
|
4471 |
! |
|
4472 |
||
4473 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
766 | 4474 |
"add an instance of aListViewClass (selectionInListView) to the box. |
593 | 4475 |
The list has numLines (if nonNil) number of lines shown. |
4476 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
4477 |
||
766 | 4478 |
|l| |
4479 |
||
4480 |
l := self addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs. |
|
593 | 4481 |
l doubleClickAction:[:name | self okPressed]. |
766 | 4482 |
^ l |
593 | 4483 |
|
4484 |
" |
|
4485 |
|dialog listView| |
|
4486 |
||
4487 |
dialog := DialogBox new. |
|
4488 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4489 |
||
4490 |
listView := dialog |
|
4491 |
addListBoxOn:nil |
|
4492 |
class:FileSelectionList |
|
4493 |
withNumberOfLines:10 |
|
4494 |
hScrollable:false |
|
4495 |
vScrollable:false. |
|
4496 |
||
4497 |
listView directory:'/etc'. |
|
4498 |
||
4499 |
dialog addAbortButton; addOkButton. |
|
4500 |
dialog open. |
|
4501 |
||
655 | 4502 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView selectionValue]. |
593 | 4503 |
" |
4504 |
||
4505 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
4506 |
"Modified: 27.4.1996 / 18:26:15 / cg" |
|
766 | 4507 |
"Modified: 15.6.1996 / 00:31:20 / stefan" |
593 | 4508 |
! |
4509 |
||
4510 |
addListBoxOn:aModel withNumberOfLines:numLines |
|
4511 |
"add a selectionInListView to the box. |
|
4512 |
The list has numLines (if nonNil) number of lines shown. |
|
4513 |
The listViews ScrollWrapper is returned" |
|
4514 |
||
4515 |
^ self |
|
4516 |
addListBoxOn:aModel |
|
4517 |
withNumberOfLines:numLines |
|
4518 |
hScrollable:false |
|
4519 |
vScrollable:true. |
|
4520 |
||
4521 |
" |
|
4522 |
|dialog model listView| |
|
4523 |
||
4524 |
model := SelectionInList new. |
|
4525 |
model list:#('one' 'two' 'three' 'four'). |
|
4526 |
model selectionIndex:2. |
|
4527 |
||
4528 |
dialog := DialogBox new. |
|
4529 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4530 |
||
4531 |
listView := dialog addListBoxOn:model withNumberOfLines:3. |
|
4532 |
||
4533 |
dialog addAbortButton; addOkButton. |
|
4534 |
dialog open. |
|
4535 |
||
655 | 4536 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 4537 |
" |
4538 |
||
4539 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
4540 |
"Modified: 27.4.1996 / 18:27:42 / cg" |
|
4541 |
! |
|
4542 |
||
4543 |
addListBoxOn:aModel withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
4544 |
"add a selectionInListView to the box. |
|
4545 |
The list has numLines (if nonNil) number of lines shown. |
|
4546 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
4547 |
||
4548 |
^ self |
|
4549 |
addListBoxOn:aModel |
|
4550 |
class:SelectionInListView |
|
4551 |
withNumberOfLines:numLines |
|
4552 |
hScrollable:hs |
|
4553 |
vScrollable:vs |
|
4554 |
||
4555 |
" |
|
4556 |
|dialog model listView| |
|
4557 |
||
4558 |
model := SelectionInList new. |
|
4559 |
model list:#('one' 'two' 'three' 'four'). |
|
4560 |
model selectionIndex:2. |
|
4561 |
||
4562 |
dialog := DialogBox new. |
|
4563 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4564 |
||
4565 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:true vScrollable:true. |
|
4566 |
||
4567 |
dialog addAbortButton; addOkButton. |
|
4568 |
dialog open. |
|
4569 |
||
655 | 4570 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 4571 |
" |
4572 |
||
4573 |
" |
|
4574 |
|dialog model listView| |
|
4575 |
||
4576 |
model := SelectionInList new. |
|
4577 |
model list:#('one' 'two' 'three' 'four'). |
|
4578 |
model selectionIndex:2. |
|
4579 |
||
4580 |
dialog := DialogBox new. |
|
4581 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4582 |
||
4583 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:false vScrollable:false. |
|
4584 |
||
4585 |
dialog addAbortButton; addOkButton. |
|
4586 |
dialog open. |
|
4587 |
||
655 | 4588 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 4589 |
" |
4590 |
||
4591 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
4592 |
"Modified: 27.4.1996 / 18:26:36 / cg" |
|
4593 |
! |
|
4594 |
||
4595 |
addPopUpList:labelString on:aModel |
|
4596 |
"create a popUpList with a label on aModel and add it. |
|
4597 |
Returns the box." |
|
4598 |
||
4599 |
^ self addPopUpList:labelString on:aModel tabable:true |
|
4600 |
! |
|
4601 |
||
4602 |
addPopUpList:labelString on:aModel tabable:tabable |
|
4603 |
"create a popUpList on aModel and add it. |
|
4604 |
Returns the popUpList." |
|
4605 |
||
4606 |
|p box l| |
|
4607 |
||
4608 |
p := PopUpList on:aModel. |
|
4609 |
p resize; sizeFixed:true. |
|
4610 |
labelString notNil ifTrue:[ |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4611 |
box := HorizontalPanelView new. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
4612 |
box borderWidth:0; horizontalLayout:#rightSpace. |
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4613 |
box add:(l := Label label:labelString). |
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4614 |
l borderWidth:0. |
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4615 |
box add:p. |
593 | 4616 |
] ifFalse:[ |
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4617 |
box := p. |
593 | 4618 |
]. |
4619 |
self addComponent:box tabable:tabable tabbedComponent:p. |
|
4620 |
^ p |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
4621 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
4622 |
"Modified: 31.5.1996 / 21:25:17 / cg" |
593 | 4623 |
! |
4624 |
||
4625 |
addPopUpListOn:aModel |
|
4626 |
"create a popUpList on aModel and add it. |
|
4627 |
Returns the box." |
|
4628 |
||
4629 |
^ self addPopUpList:nil on:aModel tabable:true |
|
4630 |
! |
|
4631 |
||
4632 |
addPopUpListOn:aModel tabable:tabable |
|
4633 |
"create a popUpList on aModel and add it. |
|
4634 |
Returns the popUpList." |
|
4635 |
||
4636 |
^ self addPopUpList:nil on:aModel tabable:tabable |
|
766 | 4637 |
! |
4638 |
||
4639 |
addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
4640 |
"add an instance of aListViewClass to the box. |
|
4641 |
The list has numLines (if nonNil) number of lines shown. |
|
4642 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
4643 |
||
4644 |
|l scr h dH| |
|
4645 |
||
4646 |
l := aListViewClass new. |
|
4647 |
l model:aModel. |
|
4648 |
||
877 | 4649 |
(vs or:[hs]) ifTrue:[ |
766 | 4650 |
hs ifTrue:[ |
4651 |
scr := HVScrollableView forView:l miniScrollerH:true . |
|
4652 |
] ifFalse:[ |
|
4653 |
scr := ScrollableView forView:l |
|
4654 |
]. |
|
4655 |
scr resize. |
|
4656 |
"/ Transcript show:scr height; show:' '; showCR:l height. |
|
4657 |
dH := scr height - l height. |
|
4658 |
] ifFalse:[ |
|
4659 |
l level:-1. |
|
4660 |
scr := l. |
|
4661 |
dH := 0. |
|
4662 |
]. |
|
4663 |
||
4664 |
numLines notNil ifTrue:[ |
|
4665 |
h := l heightForLines:numLines. |
|
4666 |
] ifFalse:[ |
|
4667 |
h := l preferredExtent y |
|
4668 |
]. |
|
4669 |
self addComponent:scr withHeight:(h + dH). |
|
4670 |
^ scr |
|
4671 |
||
4672 |
" |
|
4673 |
|dialog listView| |
|
4674 |
||
4675 |
dialog := DialogBox new. |
|
4676 |
(dialog addTextLabel:'select any') adjust:#left. |
|
4677 |
||
4678 |
listView := dialog |
|
4679 |
addTextBoxOn:nil |
|
4680 |
class:EditTextView |
|
4681 |
withNumberOfLines:10 |
|
4682 |
hScrollable:true |
|
4683 |
vScrollable:true. |
|
4684 |
||
4685 |
||
4686 |
dialog addAbortButton; addOkButton. |
|
4687 |
dialog open. |
|
4688 |
||
4689 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView contents]. |
|
4690 |
" |
|
4691 |
||
4692 |
"Created: 14.6.1996 / 23:33:47 / stefan" |
|
877 | 4693 |
"Modified: 8.11.1996 / 15:31:15 / cg" |
593 | 4694 |
! ! |
4695 |
||
4696 |
!DialogBox methodsFor:'construction-rows & columns'! |
|
4697 |
||
130 | 4698 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock |
4699 |
"add some elements in a vertical column. |
|
4700 |
Equally space elements as returned from aBlock." |
|
4701 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4702 |
self |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4703 |
addColumn:aRow |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4704 |
fromX:leftX toX:rightX |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4705 |
collect:aBlock |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4706 |
tabable:false |
130 | 4707 |
|
4708 |
" |
|
4709 |
|dialog| |
|
4710 |
||
4711 |
dialog := Dialog new. |
|
4712 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4713 |
addColumn:#('label1' 'label2' 'lbl3' 'l4' 'label5') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4714 |
fromX:0.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4715 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4716 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4717 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4718 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4719 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4720 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4721 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4722 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4723 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4724 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4725 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4726 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4727 |
addColumn:#('label1' 'label2' 'label3' 'label4' 'label5') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4728 |
fromX:0.25 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4729 |
toX:0.75 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4730 |
collect:[:label | (Label label:label) adjust:#left]. |
130 | 4731 |
|
4732 |
dialog addOkButton. |
|
4733 |
dialog open. |
|
4734 |
" |
|
4735 |
||
4736 |
" |
|
4737 |
|dialog y| |
|
4738 |
||
4739 |
dialog := Dialog new. |
|
4740 |
y := dialog yPosition. |
|
4741 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4742 |
addColumn:#('a1' 'b1' 'c1' 'd1') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4743 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4744 |
toX:(1/3) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4745 |
collect:[:label | Label label:label]. |
130 | 4746 |
|
4747 |
dialog yPosition:y. |
|
4748 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4749 |
addColumn:#('a2' 'b2' 'c2' 'd2') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4750 |
fromX:(1/3) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4751 |
toX:(2/3) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4752 |
collect:[:label | Label label:label]. |
130 | 4753 |
|
4754 |
dialog yPosition:y. |
|
4755 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4756 |
addColumn:#('a3' 'b3' 'c3' 'd3') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4757 |
fromX:(2/3) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4758 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4759 |
collect:[:label | Label label:label]. |
130 | 4760 |
|
4761 |
dialog addOkButton. |
|
4762 |
dialog open. |
|
4763 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4764 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4765 |
"Modified: 9.2.1996 / 22:22:12 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4766 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4767 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4768 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4769 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4770 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4771 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4772 |
self |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4773 |
addColumn:aRow |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4774 |
fromX:leftX toX:rightX |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4775 |
collect:aBlock |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4776 |
tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4777 |
horizontalLayout:#fitSpace |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4778 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4779 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4780 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4781 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4782 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4783 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4784 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4785 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4786 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4787 |
addColumn:#('one' 'two' 'three' 'four') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4788 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4789 |
toX:0.3 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4790 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4791 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4792 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4793 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4794 |
addColumn:values |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4795 |
fromX:0.3 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4796 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4797 |
collect:[:value | EditField on:value] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4798 |
tabable:true. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4799 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4800 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4801 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4802 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4803 |
dialog accepted ifTrue:[ |
655 | 4804 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4805 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4806 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4807 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4808 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4809 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4810 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4811 |
values := #(true true false false false true false true) collect:[:val | val asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4812 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4813 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4814 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4815 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4816 |
addColumn:(1 to:4) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4817 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4818 |
toX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4819 |
collect:[:idx | CheckToggle on:(values at:idx)] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4820 |
tabable:true |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4821 |
horizontalLayout:#center. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4822 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4823 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4824 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4825 |
addColumn:(5 to:8) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4826 |
fromX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4827 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4828 |
collect:[:idx | CheckToggle on:(values at:idx)] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4829 |
tabable:true |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4830 |
horizontalLayout:#center. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4831 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4832 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4833 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4834 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4835 |
dialog accepted ifTrue:[ |
655 | 4836 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4837 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4838 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4839 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4840 |
"Created: 9.2.1996 / 21:51:47 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4841 |
"Modified: 9.2.1996 / 22:22:02 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4842 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4843 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4844 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable horizontalLayout:hLayout |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4845 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4846 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4847 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4848 |
|helper component| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4849 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4850 |
helper := VerticalPanelView new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4851 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4852 |
aRow do:[:el | |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4853 |
component := aBlock value:el. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4854 |
helper add:component. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4855 |
component resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4856 |
tabable ifTrue:[self makeTabable:component]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4857 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4858 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4859 |
helper resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4860 |
self addComponent:helper. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4861 |
width < helper preferredExtent x ifTrue:[ |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4862 |
self width:helper preferredExtent x. |
655 | 4863 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4864 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4865 |
helper horizontalLayout:hLayout. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4866 |
helper left:leftX asFloat; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4867 |
right:rightX asFloat; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4868 |
leftInset:leftIndent; |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4869 |
rightInset:rightIndent. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4870 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4871 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4872 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4873 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4874 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4875 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4876 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4877 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4878 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4879 |
addColumn:#('one' 'two' 'three' 'four') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4880 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4881 |
toX:0.3 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4882 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4883 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4884 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4885 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4886 |
addColumn:values |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4887 |
fromX:0.3 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4888 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4889 |
collect:[:value | EditField on:value] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4890 |
tabable:true. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4891 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4892 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4893 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4894 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4895 |
dialog accepted ifTrue:[ |
655 | 4896 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4897 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4898 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4899 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4900 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4901 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4902 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4903 |
values := #(true true false false false true false true) collect:[:val | val asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4904 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4905 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4906 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4907 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4908 |
addColumn:(1 to:4) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4909 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4910 |
toX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4911 |
collect:[:idx | CheckToggle on:(values at:idx)]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4912 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4913 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4914 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4915 |
addColumn:(5 to:8) |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4916 |
fromX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4917 |
toX:1.0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4918 |
collect:[:idx | CheckToggle on:(values at:idx)] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4919 |
tabable:true. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4920 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4921 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4922 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4923 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4924 |
dialog accepted ifTrue:[ |
655 | 4925 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4926 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4927 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4928 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4929 |
"Modified: 9.2.1996 / 22:02:22 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4930 |
"Created: 9.2.1996 / 22:20:31 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4931 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4932 |
|
130 | 4933 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock |
4934 |
"add some elements in a horizontal row. |
|
4935 |
Equally space elements as returned from aBlock. |
|
4936 |
Advance y." |
|
4937 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4938 |
self |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4939 |
addRow:aCol |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4940 |
fromX:leftX toX:rightX |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4941 |
collect:aBlock |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4942 |
tabable:true |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4943 |
horizontalLayout:#spread |
130 | 4944 |
|
4945 |
" |
|
4946 |
|dialog| |
|
4947 |
||
4948 |
dialog := Dialog new. |
|
4949 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4950 |
addRow:#('a' 'b' 'c' 'd') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4951 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4952 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4953 |
collect:[:label | Label label:label]. |
130 | 4954 |
|
4955 |
dialog addOkButton. |
|
4956 |
dialog open. |
|
4957 |
" |
|
4958 |
||
4959 |
" |
|
4960 |
|dialog| |
|
4961 |
||
4962 |
dialog := Dialog new. |
|
4963 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4964 |
addRow:#('a1' 'b1' 'c1' 'd1') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4965 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4966 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4967 |
collect:[:label | Label label:label]. |
130 | 4968 |
|
4969 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4970 |
addRow:#('a2' 'b2' 'c2' 'd2') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4971 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4972 |
toX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4973 |
collect:[:label | Label label:label]. |
130 | 4974 |
|
4975 |
dialog |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4976 |
addRow:#('a3' 'b3' 'c3' 'd3') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4977 |
fromX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4978 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4979 |
collect:[:label | Label label:label]. |
130 | 4980 |
|
4981 |
dialog addOkButton. |
|
4982 |
dialog open. |
|
4983 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4984 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4985 |
"Modified: 9.2.1996 / 22:25:16 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4986 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4987 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4988 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4989 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4990 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4991 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4992 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4993 |
self |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4994 |
addRow:aCol |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4995 |
fromX:leftX toX:rightX |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4996 |
collect:aBlock |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4997 |
tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4998 |
horizontalLayout:#spread |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
4999 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5000 |
"Created: 9.2.1996 / 22:25:35 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5001 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5002 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5003 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable horizontalLayout:hLayout |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5004 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5005 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5006 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5007 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5008 |
^ self |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5009 |
addRow:aCol |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5010 |
fromX:leftX toX:rightX |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5011 |
collect:aBlock |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5012 |
tabable:tabable |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5013 |
horizontalLayout:hLayout |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5014 |
verticalLayout:#fit |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5015 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5016 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5017 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5018 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5019 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5020 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5021 |
addRow:#('a' 'b' 'c' 'd') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5022 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5023 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5024 |
collect:[:label | Label label:label] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5025 |
tabable:false |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5026 |
horizontalLayout:#fit. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5027 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5028 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5029 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5030 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5031 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5032 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5033 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5034 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5035 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5036 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5037 |
addRow:#('one' 'two' 'three' 'four') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5038 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5039 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5040 |
collect:[:label | Button label:label] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5041 |
tabable:false |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5042 |
horizontalLayout:#fit. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5043 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5044 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5045 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5046 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5047 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5048 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5049 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5050 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5051 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5052 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5053 |
addRow:#('a1' 'b1' 'c1' 'd1') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5054 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5055 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5056 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5057 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5058 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5059 |
addRow:#('a2' 'b2' 'c2' 'd2') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5060 |
fromX:0 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5061 |
toX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5062 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5063 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5064 |
dialog |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5065 |
addRow:#('a3' 'b3' 'c3' 'd3') |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5066 |
fromX:0.5 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5067 |
toX:1 |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5068 |
collect:[:label | Label label:label]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5069 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5070 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5071 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5072 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5073 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
5074 |
"Created: 9.2.1996 / 22:24:31 / cg" |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5075 |
"Modified: 31.5.1996 / 20:46:00 / cg" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5076 |
! |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5077 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5078 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable horizontalLayout:hLayout verticalLayout:vLayout |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5079 |
"add some elements in a horizontal row. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5080 |
Equally space elements as returned from aBlock. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5081 |
Advance y." |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5082 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5083 |
|helper component| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5084 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5085 |
helper := HorizontalPanelView new. |
792 | 5086 |
helper borderWidth:0. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5087 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5088 |
aCol do:[:el | |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5089 |
component := aBlock value:el. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5090 |
component resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5091 |
helper add:component. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5092 |
tabable ifTrue:[self makeTabable:component] |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5093 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5094 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5095 |
helper resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5096 |
self addComponent:helper. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5097 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5098 |
width < helper preferredExtent x ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5099 |
self width:helper preferredExtent x. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5100 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5101 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5102 |
hLayout notNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5103 |
helper horizontalLayout:hLayout. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5104 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5105 |
vLayout notNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5106 |
helper verticalLayout:vLayout. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5107 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5108 |
helper left:leftX asFloat; |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5109 |
right:rightX asFloat. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5110 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5111 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5112 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5113 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5114 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5115 |
dialog |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5116 |
addRow:#('a' 'b' 'c' 'd') |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5117 |
fromX:0 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5118 |
toX:1 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5119 |
collect:[:label | Label label:label] |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5120 |
tabable:false |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5121 |
horizontalLayout:#fit. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5122 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5123 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5124 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5125 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5126 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5127 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5128 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5129 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5130 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5131 |
dialog |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5132 |
addRow:#('one' 'two' 'three' 'four') |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5133 |
fromX:0 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5134 |
toX:1 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5135 |
collect:[:label | Button label:label] |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5136 |
tabable:false |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5137 |
horizontalLayout:#fit. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5138 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5139 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5140 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5141 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5142 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5143 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5144 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5145 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5146 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5147 |
dialog |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5148 |
addRow:#('a1' 'b1' 'c1' 'd1') |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5149 |
fromX:0 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5150 |
toX:1 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5151 |
collect:[:label | Label label:label]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5152 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5153 |
dialog |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5154 |
addRow:#('a2' 'b2' 'c2' 'd2') |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5155 |
fromX:0 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5156 |
toX:0.5 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5157 |
collect:[:label | Label label:label]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5158 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5159 |
dialog |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5160 |
addRow:#('a3' 'b3' 'c3' 'd3') |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5161 |
fromX:0.5 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5162 |
toX:1 |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5163 |
collect:[:label | Label label:label]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5164 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5165 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5166 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5167 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5168 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5169 |
"Created: 31.5.1996 / 20:45:31 / cg" |
792 | 5170 |
"Modified: 17.7.1996 / 12:06:08 / cg" |
76 | 5171 |
! ! |
5172 |
||
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5173 |
!DialogBox methodsFor:'explicit focus control'! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5174 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5175 |
focusOnOk |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5176 |
windowGroup focusView:okButton |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5177 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5178 |
"Modified: 19.4.1996 / 16:57:58 / cg" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5179 |
! ! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5180 |
|
76 | 5181 |
!DialogBox methodsFor:'initialization'! |
5182 |
||
197 | 5183 |
focusSequence |
5184 |
"return the elements through which we can step via |
|
5185 |
NextField/PreviousField keys. |
|
5186 |
Here we return all tabable fields followed by all buttons in |
|
5187 |
the panel." |
|
5188 |
||
5189 |
|fields buttons| |
|
5190 |
||
5191 |
tabableElements isNil ifTrue:[ |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5192 |
fields := #() |
197 | 5193 |
] ifFalse:[ |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5194 |
fields := tabableElements |
197 | 5195 |
]. |
5196 |
buttonPanel notNil ifTrue:[ |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5197 |
buttons := buttonPanel subViews. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5198 |
buttons notNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5199 |
fields := fields , buttonPanel subViews |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5200 |
] |
197 | 5201 |
]. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5202 |
^ fields select:[:aField | aField realized]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5203 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
5204 |
"Modified: 31.5.1996 / 22:05:58 / cg" |
197 | 5205 |
! |
5206 |
||
76 | 5207 |
initialize |
5208 |
|mm| |
|
5209 |
||
5210 |
super initialize. |
|
5211 |
||
573 | 5212 |
"/ label := 'Dialog'. |
948 | 5213 |
acceptValue := ValueHolder newBoolean. |
76 | 5214 |
|
5215 |
mm := ViewSpacing. |
|
5216 |
||
5217 |
acceptReturnAsOK := true. |
|
125 | 5218 |
acceptOnLeave := true. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5219 |
focusToOKOnLeave := true. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5220 |
hideOnAccept := true. |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5221 |
autoAccept := true. |
76 | 5222 |
|
5223 |
buttonPanel := HorizontalPanelView in:self. |
|
118 | 5224 |
buttonPanel |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5225 |
origin:(0.0 @ 1.0) corner:(1.0 @ 1.0); |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5226 |
bottomInset:mm; |
1317 | 5227 |
topInset:(font height + mm * 4) negated; |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5228 |
borderWidth:0; |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5229 |
horizontalLayout:#spread. |
118 | 5230 |
|
122 | 5231 |
yPosition := ViewSpacing. |
312
008267b920d9
allow more control over the indent when adding components
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
5232 |
leftIndent := rightIndent := (ViewSpacing // 2). |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5233 |
needResize := true. |
76 | 5234 |
|
5235 |
" |
|
5236 |
|b| |
|
5237 |
b := DialogBox new. |
|
118 | 5238 |
b addAbortButton; |
5239 |
addOkButton; |
|
5240 |
showAtPointer |
|
76 | 5241 |
" |
5242 |
" |
|
5243 |
|b| |
|
5244 |
b := DialogBox new. |
|
118 | 5245 |
b addOkButton; |
5246 |
showAtPointer |
|
5247 |
" |
|
76 | 5248 |
" |
118 | 5249 |
|b| |
5250 |
b := DialogBox new. |
|
5251 |
b addTextLabel:'hello world'; |
|
5252 |
addOkButton; |
|
5253 |
showAtPointer |
|
5254 |
" |
|
5255 |
" |
|
5256 |
|b| |
|
5257 |
b := DialogBox new. |
|
5258 |
b addTextLabel:'hello world'; |
|
5259 |
addVerticalSpace:50; |
|
5260 |
addOkButton; |
|
5261 |
showAtPointer |
|
5262 |
" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5263 |
|
1317 | 5264 |
"Modified: 7.9.1997 / 22:59:33 / cg" |
76 | 5265 |
! |
5266 |
||
5267 |
reAdjustGeometry |
|
5268 |
"sent late in snapin processing - gives me a chance |
|
5269 |
to resize for changed font dimensions." |
|
5270 |
||
5271 |
super reAdjustGeometry. |
|
5272 |
okButton notNil ifTrue:[okButton resize]. |
|
5273 |
abortButton notNil ifTrue:[abortButton resize]. |
|
5274 |
self resize |
|
5275 |
! ! |
|
5276 |
||
197 | 5277 |
!DialogBox methodsFor:'private'! |
5278 |
||
5279 |
basicAddComponent:aComponent |
|
5280 |
"add a component, dont change its size" |
|
5281 |
||
5282 |
addedComponents isNil ifTrue:[ |
|
5283 |
addedComponents := OrderedCollection new. |
|
5284 |
]. |
|
5285 |
addedComponents add:aComponent. |
|
5286 |
self addSubView:aComponent. |
|
5287 |
! |
|
5288 |
||
5289 |
hideAndEvaluate:aBlock |
|
5290 |
"if I am modal, make myself invisible and evaluate aBlock. |
|
5291 |
If nonModal, stay up, but also evaluate the block." |
|
5292 |
||
5293 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
5294 |
self hide. |
|
5295 |
]. |
|
5296 |
aBlock notNil ifTrue:[aBlock value] |
|
5297 |
||
5298 |
"Modified: 5.9.1995 / 19:06:33 / claus" |
|
5299 |
! |
|
5300 |
||
5301 |
realize |
|
5302 |
"if any inputFields where added, activate the first one" |
|
5303 |
||
5304 |
inputFieldGroup notNil ifTrue:[ |
|
5305 |
inputFieldGroup activateFirst |
|
5306 |
]. |
|
5307 |
super realize |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5308 |
! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5309 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5310 |
resize |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5311 |
needResize ifTrue:[ |
314
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
5312 |
needResize := false. |
705185e7001d
no border for textLabels in 2D styles
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
5313 |
super resize |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5314 |
] |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5315 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5316 |
"Created: 27.1.1996 / 17:22:33 / cg" |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5317 |
"Modified: 27.1.1996 / 18:25:40 / cg" |
197 | 5318 |
! ! |
5319 |
||
120 | 5320 |
!DialogBox methodsFor:'queries'! |
118 | 5321 |
|
121 | 5322 |
accepted |
128 | 5323 |
"after the box has closed: |
5324 |
return true if accepted, false if canceled" |
|
125 | 5325 |
|
128 | 5326 |
^ acceptValue value |
121 | 5327 |
! |
5328 |
||
120 | 5329 |
positionOffset |
5330 |
"return the delta, by which the box should be displayed |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5331 |
from the mouse pointer. Here, an offset is returned, which |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5332 |
makes the center of the first return-Button in the panel |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5333 |
appear under the cursor. If there is no such button, |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5334 |
use my superclasses offset." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5335 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5336 |
|idx butt buttons| |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5337 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5338 |
buttonPanel notNil ifTrue:[ |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5339 |
buttons := buttonPanel subViews. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5340 |
buttons size > 0 ifTrue:[ |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5341 |
idx := buttons findFirst:[:b | b isReturnButton]. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5342 |
idx ~~ 0 ifTrue:[ |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5343 |
butt := buttons at:idx. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5344 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5345 |
"get our size (preferredExtent) and compute |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5346 |
origin and extent of buttonPanel and okButton. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5347 |
This is normally done on view realization." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5348 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5349 |
self resize. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5350 |
buttonPanel pixelOrigin:buttonPanel computeOrigin. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5351 |
buttonPanel pixelExtent:buttonPanel computeExtent. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5352 |
buttonPanel setChildPositionsIfChanged. |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5353 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5354 |
^ (butt originRelativeTo:self) + (butt extent // 2) |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5355 |
] |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5356 |
] |
118 | 5357 |
]. |
913 | 5358 |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5359 |
^ super positionOffset |
912
310c4970e613
Fix #positionOffset to show 'senders' box with cursor on ok-button.
Stefan Vogel <sv@exept.de>
parents:
884
diff
changeset
|
5360 |
|
913 | 5361 |
"Modified: 3.1.1997 / 10:41:58 / stefan" |
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
5362 |
"Modified: 16.1.1997 / 22:00:23 / cg" |
118 | 5363 |
! |
5364 |
||
130 | 5365 |
preferredExtent |
132 | 5366 |
"return my preferred extent. |
5367 |
That is the max component width, or my current width (default); |
|
5368 |
whichever is larger, by the sum of the components heights." |
|
118 | 5369 |
|
120 | 5370 |
|w h p| |
118 | 5371 |
|
797 | 5372 |
"/ If I have an explicit preferredExtent .. |
5373 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
5374 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
5375 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
5376 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
5377 |
|
120 | 5378 |
addedComponents notNil ifTrue:[ |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5379 |
w := addedComponents |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5380 |
inject:0 |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5381 |
into:[:max :element | |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5382 |
|eExt prefWidth scale rel relX| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5383 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5384 |
prefWidth := element preferredExtent x. |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5385 |
|
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5386 |
"/ special (for your convenience) |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5387 |
"/ if the element has been added with a relative width, |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5388 |
"/ scale it to get at least its preferred width |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5389 |
|
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5390 |
(rel := element relativeExtent) notNil ifTrue:[ |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5391 |
relX := rel x. |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5392 |
(relX isNil or:[relX isInteger]) ifFalse:[ |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5393 |
prefWidth := (prefWidth * (1 / relX)) rounded |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5394 |
]. |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5395 |
]. |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
5396 |
eExt := prefWidth + (element borderWidth * 2). "/ max:element extent x. |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5397 |
max max:(eExt + element leftInset + element rightInset)]. |
120 | 5398 |
] ifFalse:[ |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5399 |
w := super preferredExtent x. |
120 | 5400 |
]. |
132 | 5401 |
w := w max:width. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5402 |
h := yPosition + ViewSpacing. |
118 | 5403 |
|
130 | 5404 |
buttonPanel subViews size ~~ 0 ifTrue:[ |
354
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5405 |
p := buttonPanel preferredExtent. |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5406 |
w := w max:p x. |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5407 |
h := h |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5408 |
+ p y |
dcad6936bfa6
when computing the preferredExtent, take care of relative-sized components (scale)
Claus Gittinger <cg@exept.de>
parents:
353
diff
changeset
|
5409 |
+ ViewSpacing. |
120 | 5410 |
]. |
118 | 5411 |
|
120 | 5412 |
"/ okButton isNil ifTrue:[ |
130 | 5413 |
"/ ^ super preferredExtent |
120 | 5414 |
"/ ]. |
130 | 5415 |
"/ p := buttonPanel preferredExtent. |
120 | 5416 |
"/ w := p x. |
5417 |
"/ h := ViewSpacing |
|
5418 |
"/ + p y |
|
5419 |
"/ + ViewSpacing. |
|
5420 |
"/ |
|
5421 |
^ w @ h |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5422 |
|
797 | 5423 |
"Modified: 19.7.1996 / 20:43:52 / cg" |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5424 |
! ! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5425 |
|
197 | 5426 |
!DialogBox methodsFor:'user actions'! |
76 | 5427 |
|
197 | 5428 |
abortPressed |
5429 |
"sent by the cancel button; user pressed abort button |
|
5430 |
- hide myself and evaluate okAction" |
|
121 | 5431 |
|
197 | 5432 |
abortButton turnOffWithoutRedraw. |
5433 |
acceptValue value:false. |
|
121 | 5434 |
|
197 | 5435 |
"/ actually, only hides if I have been opened modal |
5436 |
self hideAndEvaluate:abortAction |
|
121 | 5437 |
! |
5438 |
||
197 | 5439 |
doAccept |
5440 |
"let all components accept (i.e. update their model from the values), |
|
5441 |
then set my accept value to true. |
|
5442 |
This is confusing: this method was originally called #accept, |
|
5443 |
but renamed for compatibility with ST-80, where #accept returns the |
|
5444 |
accept-valueHolder (which looks like a bad name to me ...)." |
|
76 | 5445 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5446 |
autoAccept ifTrue:[ |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5447 |
addedComponents notNil ifTrue:[ |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5448 |
addedComponents do:[:aComponent | |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5449 |
(aComponent respondsTo:#accept) ifTrue:[ |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5450 |
aComponent accept |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5451 |
] |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5452 |
] |
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5453 |
]. |
197 | 5454 |
]. |
5455 |
acceptValue value:true. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5456 |
|
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
5457 |
"Modified: 4.3.1996 / 12:14:56 / cg" |
128 | 5458 |
! |
5459 |
||
197 | 5460 |
keyPress:aKey x:x y:y |
5461 |
"return-key dublicates ok-function if acceptReturnAsOK is true" |
|
76 | 5462 |
|
490 | 5463 |
<resource: #keyboard (#Return)> |
5464 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5465 |
(aKey == #Return) ifTrue:[ |
490 | 5466 |
(okButton notNil and:[okButton isReturnButton]) ifTrue:[ |
5467 |
^ self okPressed |
|
5468 |
]. |
|
5469 |
(abortButton notNil and:[abortButton isReturnButton]) ifTrue:[ |
|
5470 |
^ self abortPressed |
|
5471 |
]. |
|
197 | 5472 |
]. |
5473 |
super keyPress:aKey x:x y:y |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5474 |
|
490 | 5475 |
"Modified: 7.3.1996 / 13:15:09 / cg" |
76 | 5476 |
! |
5477 |
||
197 | 5478 |
lastFieldLeft |
5479 |
"if the dialog involves input fields, this is called |
|
5480 |
when the last field is left by Return-key or NextField-key" |
|
120 | 5481 |
|
197 | 5482 |
acceptOnLeave ifTrue:[ |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
5483 |
acceptReturnAsOK ifTrue:[ |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5484 |
focusToOKOnLeave ifTrue:[ |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5485 |
self focusOnOk. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5486 |
^ self. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5487 |
]. |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
5488 |
self okPressed |
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
5489 |
] |
197 | 5490 |
]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5491 |
inputFieldGroup activateFirst |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
5492 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
5493 |
"Modified: 19.4.1996 / 17:09:02 / cg" |
76 | 5494 |
! |
5495 |
||
197 | 5496 |
okPressed |
5497 |
"sent by the okButton; user pressed ok-button |
|
5498 |
- make myself invisible and if an action was specified do it" |
|
128 | 5499 |
|
197 | 5500 |
okButton notNil ifTrue:[okButton turnOffWithoutRedraw]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5501 |
|
197 | 5502 |
self doAccept. |
5503 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5504 |
acceptCheck notNil ifTrue:[ |
302 | 5505 |
acceptCheck value ifFalse:[^ self] |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5506 |
]. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5507 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5508 |
hideOnAccept ifTrue:[ |
302 | 5509 |
"/ actually, only hides if I have been opened modal |
5510 |
self hideAndEvaluate:okAction. |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5511 |
] ifFalse:[ |
302 | 5512 |
okAction value |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
5513 |
] |
128 | 5514 |
! ! |
240 | 5515 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
5516 |
!DialogBox class methodsFor:'documentation'! |
240 | 5517 |
|
5518 |
version |
|
1355 | 5519 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.108 1997-10-21 18:27:24 cg Exp $' |
240 | 5520 |
! ! |
498 | 5521 |
DialogBox initialize! |