author | Claus Gittinger <cg@exept.de> |
Mon, 23 Jan 2012 11:53:51 +0100 | |
changeset 4352 | 9fc90b8f931c |
parent 4351 | bb13cb4b60c2 |
child 4353 | f49df92ebf0a |
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 |
" |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
13 |
|
76 | 14 |
ModalBox subclass:#DialogBox |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
15 |
instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
16 |
acceptReturnAsOK yPosition leftIndent rightIndent addedComponents |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
17 |
inputFieldGroup acceptOnLeave acceptValue tabableElements |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
18 |
hideOnAccept acceptCheck needResize autoAccept focusToOKOnLeave |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
19 |
bindings namedComponents verticalPanel' |
2439 | 20 |
classVariableNames:'DefaultFocusToOKOnLeave AboutToOpenBoxNotificationSignal' |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
21 |
poolDictionaries:'' |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
22 |
category:'Views-DialogBoxes' |
76 | 23 |
! |
24 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
25 |
!DialogBox class methodsFor:'documentation'! |
76 | 26 |
|
197 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
76 | 39 |
! |
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
this class implements the common behavior of dialogboxes. |
|
44 |
||
647 | 45 |
DialogBox is also a superclass of many other boxes - see InfoBox, |
76 | 46 |
WarningBox, YesNoBox etc. for concrete examples. |
47 |
Most of them simply add buttons or other elements. |
|
48 |
||
121 | 49 |
For programmatically created boxes, instances support adding of components |
50 |
in a top-to-bottom fashion, and also keep track of added text-fields and, |
|
51 |
since they are most common, automatically create an EnterFieldGroup for |
|
52 |
them. |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
53 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
54 |
Caveat: |
3935 | 55 |
more adding support is required - especially for row-wise construction. |
56 |
The programmatic interface is best suited for row-wise |
|
57 |
arranged components; laying out elements in columns is a bit |
|
58 |
complicate - for complicated dialogs, it may be better to not use |
|
59 |
the automatic arrangement, but instead give explicit layouts to |
|
60 |
the components (in a subclass) or better use the UIPainter. |
|
122 | 61 |
|
600 | 62 |
Compatibility note: |
3935 | 63 |
For ST-80 compatibility, DialogBox is also accessable under |
64 |
the global named 'Dialog' (which is the name of an ST-80 class, |
|
65 |
providing a very similar protocol). |
|
66 |
This may lead to confusion, if DialogBox is recompiled - you have |
|
67 |
to manually assign Dialog again to refer to the new DialogBox class. |
|
68 |
In future versions of ST/X, DialogBox may be renamed to Dialog. |
|
600 | 69 |
|
183 | 70 |
Historic note: |
3935 | 71 |
originally, ST/X had separate classes for the various entry methods; |
72 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
73 |
ST-80 has all this defined in the common Dialog. |
|
74 |
Therefore, for compatibility, many ST/X methods defined here in Dialogs |
|
75 |
class protocol simply dispatch to some other boxes class method. |
|
76 |
In the future, those existing subclasses' functionality is going to |
|
77 |
be moved full into Dialog, and the subclasses will be replaced by dummy |
|
78 |
delegators. (They will be kept for backward compatibility, though). |
|
183 | 79 |
|
121 | 80 |
|
585 | 81 |
[instance variables:] |
76 | 82 |
|
3935 | 83 |
buttonPanel <PanelView> contains the button(s) |
84 |
||
85 |
okButton <Button> the ok-Button |
|
86 |
||
87 |
okAction <Block> the action to be performed when ok is pressed, |
|
88 |
or return is pressed. |
|
89 |
||
90 |
acceptReturnAsOK <Boolean> if true, pressing the return-key counts |
|
91 |
as if ok was pressed. Default is true. |
|
92 |
||
93 |
abortButton <Button> the cancel-Button |
|
94 |
||
95 |
abortAction <Block> the action to be performed when cancel is |
|
96 |
pressed. |
|
97 |
||
98 |
yPosisition <Integer> current y position when adding components |
|
99 |
||
100 |
leftIndent <Integer> left inset to use when adding components |
|
101 |
||
102 |
rightIndent <Integer> right inset to use when adding components |
|
103 |
||
104 |
addedComponents <Collection> programmatically added components |
|
105 |
||
106 |
inputFieldGroup <EnterFieldGroup> |
|
107 |
for added input fields |
|
108 |
||
109 |
acceptOnLeave <Boolean> if true (the default) and there are |
|
110 |
tabable inputFields, accept and close when |
|
111 |
the last field is left. If false, the ok |
|
112 |
button must be pressed to close the box. |
|
113 |
||
114 |
acceptedValue v(<Boolean>) valueHolder on a boolean |
|
115 |
after close: holds true if box was accepted |
|
116 |
(i.e. ok-Button was pressed), false if box was |
|
117 |
closed via cancel or window manager. |
|
118 |
||
119 |
autoAccept Boolean if true, pressing ok (or return) |
|
120 |
sends #accept to all subcomponents. |
|
121 |
I.e. all subfields update their models |
|
122 |
first. The default is true. |
|
123 |
||
124 |
variablePanel nil|VPanel an optional additional panel to be filled dynamically |
|
125 |
in an aboutToOpenNotification hook. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
126 |
|
100 | 127 |
For compatibility with ST-80, this class is also available under |
128 |
the global names DialogView and Dialog (see patches file). |
|
585 | 129 |
|
130 |
[author:] |
|
3935 | 131 |
Claus Gittinger |
593 | 132 |
|
133 |
[see also:] |
|
3935 | 134 |
Button CheckToggle Toggle |
135 |
EditField SelectionInListView FileSelectionList |
|
136 |
FramedBox Separator |
|
137 |
( introduction to view programming :html: programming/viewintro.html ) |
|
76 | 138 |
" |
139 |
! |
|
140 |
||
141 |
examples |
|
142 |
" |
|
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
|
143 |
historically, DialogBox was used as an abstract class as a base for InfoBox, |
600 | 144 |
YesNoBox etc. |
145 |
However, the programmatic construction protocol (#addComponent:) |
|
146 |
now allows those classes to be easily replaced and future versions of |
|
147 |
ST/X may do this and make those subclasses obsolete. |
|
148 |
However, dummy stubs will remain to exist for backward compatibility |
|
149 |
(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
|
150 |
|
125 | 151 |
For most simple standard dialogs, there are ready to use |
152 |
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
|
153 |
|
125 | 154 |
For example: |
155 |
||
156 |
info & warnings: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
157 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
158 |
Dialog information:'hi there' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
159 |
[exEnd] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
160 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
161 |
Dialog warn:'oops' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
162 |
[exEnd] |
125 | 163 |
|
164 |
||
165 |
yes/no questions: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
166 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
167 |
(Dialog confirm:'is this simple ?') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
168 |
ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
169 |
Transcript showCR:'thats what I expected' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
170 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
171 |
Transcript showCR:'read more examples and documentation' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
172 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
173 |
[exEnd] |
125 | 174 |
|
175 |
||
176 |
yes/no question with cancel option: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
177 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
178 |
|answer| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
179 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
180 |
answer := Dialog confirmWithCancel:'is this simple ?'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
181 |
answer isNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
182 |
Transcript showCR:'no easy decision' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
183 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
184 |
answer ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
185 |
Transcript showCR:'thats what I expected' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
186 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
187 |
Transcript showCR:'read more examples and documentation' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
188 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
189 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
190 |
[exEnd] |
125 | 191 |
|
192 |
||
193 |
asking for a string: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
194 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
195 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
196 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
197 |
s := Dialog request:'enter your name, please:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
198 |
s notEmpty ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
199 |
Transcript showCR:'you entered: ' , s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
200 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
201 |
[exEnd] |
125 | 202 |
|
203 |
||
204 |
asking for a string with given default: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
205 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
206 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
207 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
208 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
209 |
request:'enter your name, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
210 |
initialAnswer:(OperatingSystem getLoginName). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
211 |
s notEmpty ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
212 |
Transcript showCR:'you entered: ' , s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
213 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
214 |
[exEnd] |
125 | 215 |
|
216 |
||
217 |
asking for a filename: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
218 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
219 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
220 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
221 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
222 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
223 |
default:''. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
224 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
225 |
[exEnd] |
125 | 226 |
|
227 |
||
1030 | 228 |
with a namefiler pattern: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
229 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
230 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
231 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
232 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
233 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
234 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
235 |
pattern:'*.rc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
236 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
237 |
[exEnd] |
1030 | 238 |
|
239 |
||
240 |
another namefiler pattern: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
241 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
242 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
243 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
244 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
245 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
246 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
247 |
pattern:'*.rc;*.st;*.h'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
248 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
249 |
[exEnd] |
1030 | 250 |
|
251 |
||
125 | 252 |
with changed button label and pattern: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
253 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
254 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
255 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
256 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
257 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
258 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
259 |
ok:'show' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
260 |
abort:'cancel' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
261 |
pattern:'*.rc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
262 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
263 |
[exEnd] |
125 | 264 |
|
302 | 265 |
|
266 |
asking for a password: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
267 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
268 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
269 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
270 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
271 |
requestPassword:'enter your secret, please:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
272 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
273 |
[exEnd] |
302 | 274 |
|
645 | 275 |
multiple choice dialogs: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
276 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
277 |
Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
278 |
choose:'choose any' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
279 |
fromList:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
280 |
values:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
281 |
buttons:#('one' 'two' 'three' 'four') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
282 |
values:#(1 2 3 4) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
283 |
lines:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
284 |
cancel:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
285 |
[exEnd] |
645 | 286 |
|
287 |
multiple choice dialog, with list & buttons: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
288 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
289 |
Transcript showCR:( |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
290 |
Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
291 |
choose:'choose example' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
292 |
fromList:#('one' 'two' 'three' 'four') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
293 |
values:#(1 2 3 4) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
294 |
buttons:#('five' 'six' 'seven') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
295 |
values:#(5 6 7) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
296 |
lines:4 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
297 |
cancel:[Transcript flash. #aborted] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
298 |
) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
299 |
[exEnd] |
645 | 300 |
|
301 |
You can (and often have to) construct custom dialogs programmatically, |
|
302 |
from individual components. As shown in the following examples: |
|
91 | 303 |
|
121 | 304 |
basic (unusable) example: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
305 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
306 |
DialogBox new open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
307 |
[exEnd] |
76 | 308 |
|
121 | 309 |
still unusable - only an ok-button: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
310 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
311 |
DialogBox new addOkButton; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
312 |
[exEnd] |
121 | 313 |
|
314 |
both ok- and abortButtons: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
315 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
316 |
DialogBox new addAbortButton; addOkButton; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
317 |
[exEnd] |
121 | 318 |
|
122 | 319 |
with different ok-label: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
320 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
321 |
DialogBox new addAbortButton; addOkButtonLabelled:'yeah'; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
322 |
[exEnd] |
122 | 323 |
|
645 | 324 |
adding a (centered by default) textlabel gives an infoBox: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
325 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
326 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
327 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
328 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
329 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
330 |
[exEnd] |
121 | 331 |
|
332 |
a textlabel with abort- and okButton gives a yesNoBox: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
333 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
334 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
335 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
336 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
337 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
338 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
339 |
[exEnd] |
121 | 340 |
|
341 |
the same, adjusting the labels contents to the left: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
342 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
343 |
|box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
344 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
345 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
346 |
(box addTextLabel:'hello') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
347 |
box addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
348 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
349 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
350 |
[exEnd] |
121 | 351 |
|
122 | 352 |
with modified buttons: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
353 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
354 |
|box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
355 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
356 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
357 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
358 |
box addAbortButtonLabelled:'not really'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
359 |
(box addOkButtonLabelled:'yes, absolutely') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
360 |
activeBackgroundColor:Color red. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
361 |
box open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
362 |
[exEnd] |
122 | 363 |
|
364 |
||
645 | 365 |
mswindows style (different up/down bitmaps in buttons): |
366 |
((try tabbing ...) |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
367 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
368 |
|b box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
369 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
370 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
371 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
372 |
b := Button new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
373 |
b activeLogo:(Image fromFile:'cancel_down.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
374 |
b passiveLogo:(Image fromFile:'cancel_up.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
375 |
b focusLogo:(Image fromFile:'cancel_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
376 |
b beImageButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
377 |
box addAbortButton:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
378 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
379 |
b := Button new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
380 |
b activeLogo:(Image fromFile:'ok_down.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
381 |
b passiveLogo:(Image fromFile:'ok_up.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
382 |
b focusLogo:(Image fromFile:'ok_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
383 |
b beImageButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
384 |
box addOkButton:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
385 |
box open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
386 |
[exEnd] |
162 | 387 |
|
388 |
||
121 | 389 |
two textlabels: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
390 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
391 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
392 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
393 |
addTextLabel:'world'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
394 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
395 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
396 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
397 |
[exEnd] |
118 | 398 |
|
121 | 399 |
fixing the dialogs size (suppres it calculating its size from the |
130 | 400 |
preferredExtents of its components): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
401 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
402 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
403 |
label:'a simple dialog'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
404 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
405 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
406 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
407 |
extent:200@200; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
408 |
sizeFixed:true; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
409 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
410 |
[exEnd] |
118 | 411 |
|
121 | 412 |
asking the box if it was closed via ok: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
413 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
414 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
415 |
label:'a simple dialog'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
416 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
417 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
418 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
419 |
extent:200@200; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
420 |
sizeFixed:true; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
421 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
422 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
423 |
Transcript showCR:'yes' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
424 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
425 |
Transcript showCR:'no' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
426 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
427 |
[exEnd] |
118 | 428 |
|
121 | 429 |
textLabels are not limited to strings (although, the name which is |
430 |
used for ST-80 compatibility, suggests it): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
431 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
432 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
433 |
addTextLabel:(Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages'); |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
434 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
435 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
436 |
[exEnd] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
437 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
438 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
439 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
440 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
441 |
addTextLabel:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
442 |
magnifiedTo:200@150); |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
443 |
addTextLabel:'world'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
444 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
445 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
446 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
447 |
[exEnd] |
120 | 448 |
|
121 | 449 |
adding an input field (on a string model): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
450 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
451 |
|stringModel| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
452 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
453 |
stringModel := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
454 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
455 |
addTextLabel:'Please enter a string:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
456 |
addInputFieldOn:stringModel; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
457 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
458 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
459 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
460 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
461 |
Transcript showCR:'entered: ', stringModel value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
462 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
463 |
[exEnd] |
120 | 464 |
|
465 |
||
121 | 466 |
multiple input fields (notice, that the dialog connects the fields |
467 |
in a group, so stepping is allowed via Cursor and Return keys): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
468 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
469 |
|firstName lastName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
470 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
471 |
firstName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
472 |
lastName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
473 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
474 |
addTextLabel:'Please enter your name:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
475 |
addInputFieldOn:firstName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
476 |
addVerticalSpace; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
477 |
addInputFieldOn:lastName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
478 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
479 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
480 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
481 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
482 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
483 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
484 |
[exEnd] |
121 | 485 |
|
486 |
||
487 |
of course, the model may contain a value initially: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
488 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
489 |
|firstName lastName p line i name| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
490 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
491 |
firstName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
492 |
lastName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
493 |
p := PipeStream readingFrom:'finger ' , OperatingSystem getLoginName. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
494 |
p notNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
495 |
line := p nextLine. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
496 |
(i := line findString:'Name:') ~~ 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
497 |
name := line copyFrom:(i + 'Name:' size). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
498 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
499 |
(i := line findString:'real life:') == 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
500 |
line := p nextLine. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
501 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
502 |
(i := line findString:'real life:') ~~ 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
503 |
name := line copyFrom:(i + 'real life:' size). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
504 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
505 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
506 |
name notNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
507 |
firstName value: name asCollectionOfWords first. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
508 |
lastName value: name asCollectionOfWords last. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
509 |
Transcript showCR:'initially ' , firstName value , ' ' , lastName value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
510 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
511 |
p close. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
512 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
513 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
514 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
515 |
addTextLabel:'Please enter your name:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
516 |
addInputFieldOn:firstName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
517 |
addVerticalSpace; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
518 |
addInputFieldOn:lastName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
519 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
520 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
521 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
522 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
523 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
524 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
525 |
[exEnd] |
121 | 526 |
|
120 | 527 |
|
302 | 528 |
validated password entry: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
529 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
530 |
|box firstEntry secondEntry| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
531 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
532 |
firstEntry := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
533 |
secondEntry := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
534 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
535 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
536 |
(box addTextLabel:'Please enter your secret:') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
537 |
(box addInputFieldOn:firstEntry) passwordCharacter:$*. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
538 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
539 |
(box addInputFieldOn:secondEntry) passwordCharacter:$*. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
540 |
box addAbortButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
541 |
box addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
542 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
543 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
544 |
firstEntry value ~= secondEntry value ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
545 |
Transcript showCR:'wrong input - try again' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
546 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
547 |
Transcript showCR:'entered: ', firstEntry value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
548 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
549 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
550 |
[exEnd] |
593 | 551 |
|
552 |
input fields with a label: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
553 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
554 |
|box firstNameHolder middleNameHolder lastNameHolder| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
555 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
556 |
firstNameHolder := 'John' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
557 |
middleNameHolder := 'F' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
558 |
lastNameHolder := 'Peters' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
559 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
560 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
561 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
562 |
addLabelledInputField:'first name:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
563 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
564 |
on:firstNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
565 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
566 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
567 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
568 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
569 |
addLabelledInputField:'middle initial:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
570 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
571 |
on:middleNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
572 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
573 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
574 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
575 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
576 |
addLabelledInputField:'last name:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
577 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
578 |
on:lastNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
579 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
580 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
581 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
582 |
box addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
583 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
584 |
[exEnd] |
593 | 585 |
|
586 |
||
587 |
constructing a dialog from other elements: |
|
121 | 588 |
adding a fileSelectionList: |
589 |
(since the dialog adds the component with its preferred extent, |
|
590 |
ignoring the 300-height, this looks ugly ... |
|
591 |
... especially when resized vertically) |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
592 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
593 |
|top l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
594 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
595 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
596 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
597 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
598 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
599 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
600 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
601 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
602 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
603 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
604 |
scr extent:(1.0 @ 300). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
605 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
606 |
top addComponent:scr. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
607 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
608 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
609 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
610 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
611 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
612 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
613 |
[exEnd] |
121 | 614 |
|
615 |
same, looks better, since the height is made larger (not using |
|
616 |
fileLists preferredExtent): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
617 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
618 |
|top l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
619 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
620 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
621 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
622 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
623 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
624 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
625 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
626 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
627 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
628 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
629 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
630 |
top addComponent:scr withExtent:300@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
631 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
632 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
633 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
634 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
635 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
636 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
637 |
[exEnd] |
121 | 638 |
|
639 |
||
640 |
again, setting the boxes initial size and fixing it |
|
130 | 641 |
(let it ignore the components' preferredExtent): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
642 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
643 |
|top fixFrame l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
644 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
645 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
646 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
647 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
648 |
top extent:300@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
649 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
650 |
fixFrame := View new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
651 |
fixFrame extent:(1.0 @ 300). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
652 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
653 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
654 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
655 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
656 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
657 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
658 |
scr origin:0.0@0.0 corner:1.0@1.0. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
659 |
fixFrame add:scr. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
660 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
661 |
top addComponent:fixFrame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
662 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
663 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
664 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
665 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
666 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
667 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
668 |
[exEnd] |
118 | 669 |
|
670 |
||
671 |
adding a panel with checkBoxes: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
672 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
673 |
|top panel b value1 value2 value3 value4| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
674 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
675 |
value1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
676 |
value2 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
677 |
value3 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
678 |
value4 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
679 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
680 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
681 |
top extent:200@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
682 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
683 |
panel := VerticalPanelView new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
684 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
685 |
b := CheckBox on:value1. b label:'check1'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
686 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
687 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
688 |
b := CheckBox on:value2. b label:'check2'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
689 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
690 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
691 |
b := CheckBox on:value3. b label:'check3'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
692 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
693 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
694 |
b := CheckBox on:value4. b label:'check4'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
695 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
696 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
697 |
top addComponent:panel. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
698 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
699 |
top open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
700 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
701 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
702 |
Transcript show:'value1: '; showCR:value1 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
703 |
Transcript show:'value2: '; showCR:value2 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
704 |
Transcript show:'value3: '; showCR:value3 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
705 |
Transcript show:'value4: '; showCR:value4 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
706 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
707 |
[exEnd] |
118 | 708 |
|
120 | 709 |
same, using a more convenient interface: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
710 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
711 |
|box value1 value2 value3 value4| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
712 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
713 |
value1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
714 |
value2 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
715 |
value3 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
716 |
value4 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
717 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
718 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
719 |
box extent:200@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
720 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
721 |
box addCheckBox:'check1' on:value1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
722 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
723 |
box addCheckBox:'check2' on:value2. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
724 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
725 |
box addCheckBox:'check3' on:value3. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
726 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
727 |
box addCheckBox:'check4' on:value4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
728 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
729 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
730 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
731 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
732 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
733 |
Transcript show:'value1: '; showCR:value1 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
734 |
Transcript show:'value2: '; showCR:value2 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
735 |
Transcript show:'value3: '; showCR:value3 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
736 |
Transcript show:'value4: '; showCR:value4 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
737 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
738 |
[exEnd] |
344
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 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
741 |
same, using an even better interface: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
742 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
743 |
|box values labels| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
744 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
745 |
values := #(true false false true) collect:[:val | val asValue]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
746 |
labels := #('check1' 'check2' 'check3' 'check4'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
747 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
748 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
749 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
750 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
751 |
addColumn:(1 to:labels size) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
752 |
fromX:0.0 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
753 |
toX:1.0 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
754 |
collect:[:index | CheckBox label:(labels at:index) model:(values at:index)] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
755 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
756 |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
757 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
758 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
759 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
760 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
761 |
values with:labels do:[:val :lbl | |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
762 |
Transcript show:(lbl , ': '); showCR:val value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
763 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
764 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
765 |
[exEnd] |
126 | 766 |
|
767 |
||
164 | 768 |
adding two panels in a frame: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
769 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
770 |
|box frame vPanel1 vPanel2 m1 m2 m3 m4 chk ef| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
771 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
772 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
773 |
box label:'example'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
774 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
775 |
frame := FramedBox label:'frame'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
776 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
777 |
vPanel1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
778 |
vPanel1 horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
779 |
vPanel1 verticalLayout:#spreadSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
780 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
781 |
vPanel2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
782 |
vPanel2 horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
783 |
vPanel2 verticalLayout:#spreadSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
784 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
785 |
m1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
786 |
m2 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
787 |
m3 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
788 |
m4 := 'hello' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
789 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
790 |
vPanel1 add:(Label label:'check1'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
791 |
vPanel1 add:(Label label:'m2'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
792 |
vPanel1 add:(Label label:'m3'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
793 |
vPanel1 add:(Label label:'enter'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
794 |
vPanel1 add:(Label label:'lbl1'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
795 |
vPanel1 add:(Label label:'lbl2'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
796 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
797 |
vPanel2 add:(chk := CheckToggle on:m1). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
798 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
799 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
800 |
vPanel2 add:(chk := CheckToggle on:m2). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
801 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
802 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
803 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
804 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
805 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
806 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
807 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
808 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
809 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
810 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
811 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
812 |
vPanel2 add:(ef := EditField on:m4). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
813 |
ef immediateAccept:true. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
814 |
box makeTabable:ef. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
815 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
816 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
817 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
818 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
819 |
box openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
820 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
821 |
Transcript showCR:'accepted with:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
822 |
Transcript showCR:' m1: ' , m1 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
823 |
Transcript showCR:' m2: ' , m2 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
824 |
Transcript showCR:' m3: ' , m3 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
825 |
Transcript showCR:' m4: ' , m4 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
826 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
827 |
[exEnd] |
593 | 828 |
|
829 |
||
830 |
||
831 |
a full example (combined settings dialog - as in launcher): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
832 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
833 |
|box warnSTX allowUnderscore immutableArrays logDoits |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
834 |
listOfLanguages listOfStyles styleNames |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
835 |
frame panel c resourceDir dir | |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
836 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
837 |
warnSTX := Compiler warnSTXSpecials asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
838 |
allowUnderscore := Compiler allowUnderscoreInIdentifier asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
839 |
immutableArrays := Compiler arraysAreImmutable asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
840 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
841 |
logDoits := Smalltalk logDoits asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
842 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
843 |
listOfLanguages := SelectionInList with:#('english' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
844 |
'french' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
845 |
'german' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
846 |
'italian' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
847 |
'spanish' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
848 |
). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
849 |
listOfLanguages selection:(Language asString). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
850 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
851 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
852 |
resourceDir := Smalltalk getSystemFileName:'resources'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
853 |
dir := FileDirectory directoryNamed:resourceDir. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
854 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
855 |
styleNames := dir select:[:aFileName | aFileName endsWith:'.style']. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
856 |
styleNames := styleNames collect:[:aFileName | aFileName copyWithoutLast:6]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
857 |
listOfStyles := SelectionInList with:styleNames sort. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
858 |
listOfStyles selection:(View defaultStyle asString). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
859 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
860 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
861 |
box label:'Settings'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
862 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
863 |
frame := FramedBox label:'Compiler'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
864 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
865 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
866 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
867 |
panel add:((CheckBox on:warnSTX) label:'warn about ST/X language extensions'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
868 |
panel add:((CheckBox on:allowUnderscore) label:'allow underscore in identifiers'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
869 |
panel add:((CheckBox on:immutableArrays) label:'literal arrays are immutable'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
870 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
871 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
872 |
frame := FramedBox label:'Misc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
873 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
874 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
875 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
876 |
panel add:((CheckBox on:logDoits) label:'log doIts in changes file'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
877 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
878 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
879 |
frame := FramedBox label:'Language'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
880 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
881 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
882 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
883 |
panel add:((PopUpList on:listOfLanguages) width:0.5). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
884 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
885 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
886 |
frame := FramedBox label:'Style'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
887 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
888 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
889 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
890 |
panel add:((PopUpList on:listOfStyles) width:0.5). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
891 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
892 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
893 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
894 |
box showAtPointer. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
895 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
896 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
897 |
Transcript topView withCursor:Cursor wait do:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
898 |
Compiler warnSTXSpecials:warnSTX value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
899 |
Compiler allowUnderscoreInIdentifier:allowUnderscore value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
900 |
Compiler arraysAreImmutable:immutableArrays value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
901 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
902 |
Smalltalk logDoits:logDoits value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
903 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
904 |
Transcript showCR:'change language to ' , listOfLanguages selection , ' ...'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
905 |
Smalltalk at:#Language put:listOfLanguages selection asSymbol. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
906 |
Smalltalk changed:#Language. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
907 |
ResourcePack flushCachedResourcePacks. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
908 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
909 |
Transcript showCR:'change style to ' , listOfStyles selection , ' ...'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
910 |
View defaultStyle:listOfStyles selection asSymbol. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
911 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
912 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
913 |
[exEnd] |
625 | 914 |
an example from Hopkins/Horan: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
915 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
916 |
|aText index| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
917 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
918 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
919 |
index := aText findString:'Smalltalk/X' startingAt:1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
920 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
921 |
to:'Smalltalk/X' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
922 |
with:#bold. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
923 |
index := aText findString:'Introduction' startingAt:index. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
924 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
925 |
to:'Introduction' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
926 |
with:#italic. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
927 |
Dialog warn:aText |
625 | 928 |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
929 |
[exEnd] |
625 | 930 |
the same, with colors: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
931 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
932 |
|aText index| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
933 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
934 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
935 |
index := aText findString:'Smalltalk/X' startingAt:1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
936 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
937 |
to:'Smalltalk/X' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
938 |
with:(Array with:#bold with:#underline with:(#color->Color red)). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
939 |
index := aText findString:'Introduction' startingAt:index. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
940 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
941 |
to:'Introduction' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
942 |
with:#italic. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
943 |
Dialog warn:aText |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
944 |
[exEnd] |
76 | 945 |
" |
551
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 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
948 |
inputFocus |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
949 |
" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
950 |
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
|
951 |
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
|
952 |
|
600 | 953 |
The default is to shift the focus to the ok-button - thus, another return |
954 |
has to be entered (as confirmation) to close & accept the box. |
|
955 |
||
956 |
This can be changed to force an automatic OK with: |
|
1401 | 957 |
aBox focusToOKOnLeave:false |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
958 |
|
600 | 959 |
Then, leaving the last field with return, automatically accepts the box, |
960 |
as if ok was pressed. (useful for simple - single entry dialogs). |
|
961 |
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
|
962 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
963 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
964 |
With: |
1401 | 965 |
aBox acceptReturnAsOK:false |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
966 |
|
600 | 967 |
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
|
968 |
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
|
969 |
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
|
970 |
(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
|
971 |
to be handled somehow). |
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 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
974 |
Simply leaving the group with a cursor movement may also be either |
600 | 975 |
interpreted as a return (the default), or again wrap back to the top |
976 |
of the group. |
|
977 |
||
978 |
With: |
|
1401 | 979 |
aBox acceptOnLeave:false |
600 | 980 |
this is turned off, so that with cursor-down, the focus is moved back |
981 |
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
|
982 |
" |
76 | 983 |
! ! |
984 |
||
2768 | 985 |
!DialogBox class methodsFor:'Compatibility-VW'! |
1371 | 986 |
|
987 |
choose:aString fromList:list values:listValues lines:maxLines cancel:cancelBlock for:aView |
|
988 |
"launch a Dialog showing the message and list. |
|
989 |
The user can select an item and click ok; in this case, the corresponding value |
|
990 |
from listValues is returned (doubleclick works as well). |
|
991 |
If cancel is pressed, the value of cancelBlock is returned. |
|
992 |
Pressing ok without a selection is treated like cancel. |
|
993 |
This is a new VW2.5 interface - passing an addtional argument. |
|
994 |
In ST/X, this is not needed and ignored" |
|
995 |
||
996 |
^ self |
|
1401 | 997 |
choose:aString |
998 |
fromList:list |
|
999 |
values:listValues |
|
1000 |
lines:maxLines |
|
1001 |
cancel:cancelBlock |
|
1371 | 1002 |
|
1003 |
" |
|
1004 |
Transcript showCR:( |
|
1401 | 1005 |
Dialog |
1006 |
choose:'choose any' |
|
1007 |
fromList:#('one' 'two' 'three' 'four') |
|
1008 |
values:#(1 2 3 4) |
|
1009 |
lines:4 |
|
1010 |
cancel:nil |
|
1371 | 1011 |
) |
1012 |
||
1013 |
Transcript showCR:( |
|
1401 | 1014 |
Dialog |
1015 |
choose:'choose example' |
|
1016 |
fromList:#('one' 'two' 'three' 'four') |
|
1017 |
values:#(1 2 3 4) |
|
1018 |
lines:4 |
|
1019 |
cancel:[Transcript flash. #aborted] |
|
1371 | 1020 |
) |
1021 |
" |
|
1022 |
||
1023 |
"Created: / 1.11.1997 / 13:21:32 / cg" |
|
1024 |
"Modified: / 1.11.1997 / 13:21:54 / cg" |
|
1025 |
! |
|
1102 | 1026 |
|
1027 |
confirm:aMessageString for:ignoredView |
|
1371 | 1028 |
"VW compatibility - confirm using the same viewStyle as in the view |
1102 | 1029 |
argument; not supported in ST/X (who mixes styles ?)" |
1030 |
||
3456 | 1031 |
^ self |
1032 |
confirm:aMessageString |
|
1033 |
title:nil |
|
1034 |
yesLabel:nil noLabel:nil |
|
1035 |
initialAnswer:true. |
|
1036 |
||
1037 |
"Created: / 06-03-1997 / 15:45:54 / cg" |
|
1038 |
"Modified: / 02-03-2007 / 15:25:15 / cg" |
|
1371 | 1039 |
! |
1040 |
||
1041 |
request:aString for:aView |
|
1042 |
"launch a Dialog, which allows user to enter something. |
|
1043 |
Return the entered string (may be empty string) |
|
1044 |
or the empty string (if cancel was pressed), |
|
1045 |
This is a new VW2.5 interface - passing an addtional argument. |
|
1046 |
In ST/X, this is not needed and ignored" |
|
1047 |
||
1048 |
^ self |
|
1401 | 1049 |
request:aString |
1371 | 1050 |
|
1051 |
"Created: / 31.10.1997 / 03:26:32 / cg" |
|
1052 |
"Modified: / 31.10.1997 / 11:53:50 / cg" |
|
1053 |
! |
|
1054 |
||
1055 |
request:aString initialAnswer:initial for:aView |
|
1056 |
"launch a Dialog, which allows user to enter something. |
|
1057 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
1058 |
This is a new VW2.5 interface - passing an addtional argument. |
|
1059 |
In ST/X, this is not needed and ignored" |
|
1060 |
||
1061 |
^ self |
|
1401 | 1062 |
request:aString |
1063 |
initialAnswer:initial |
|
1371 | 1064 |
|
1065 |
"Modified: / 29.5.1996 / 14:30:05 / cg" |
|
1066 |
"Created: / 1.11.1997 / 13:18:29 / cg" |
|
1067 |
! |
|
1068 |
||
1069 |
requestFileName:title default:default version:versionSym ifFail:failBlock for:aViewOrNil |
|
1070 |
"new VW2.5 interface - passing an addtional argument. |
|
1071 |
In ST/X, this is not needed and ignored" |
|
1072 |
||
1073 |
^ self |
|
1401 | 1074 |
requestFileName:title default:default version:versionSym ifFail:failBlock |
1371 | 1075 |
|
1076 |
"Created: / 31.10.1997 / 02:00:42 / cg" |
|
1077 |
"Modified: / 31.10.1997 / 11:52:53 / cg" |
|
1102 | 1078 |
! |
1079 |
||
1080 |
warn:aMessageString for:ignoredView |
|
1371 | 1081 |
"VW compatibility - warn using the same viewStyle as in the view |
1102 | 1082 |
argument; not supported in ST/X (who mixes styles ?)" |
1083 |
||
1084 |
^ self warn:aMessageString |
|
1085 |
||
1371 | 1086 |
"Created: / 6.3.1997 / 15:46:02 / cg" |
1087 |
"Modified: / 31.10.1997 / 11:54:35 / cg" |
|
1102 | 1088 |
! ! |
1089 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1090 |
!DialogBox class methodsFor:'class initialization'! |
498 | 1091 |
|
1092 |
initialize |
|
528
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1093 |
self == DialogBox ifTrue:[ |
1757 | 1094 |
Dialog := self |
1095 |
]. |
|
1096 |
||
1097 |
DefaultFocusToOKOnLeave := false. |
|
3902
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1098 |
|
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1099 |
"/ for backward whitebox compatibility (customer subclasses which access the classVar directly) |
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1100 |
AboutToOpenBoxNotificationSignal := SimpleView aboutToOpenBoxNotificationSignal |
498 | 1101 |
! ! |
1102 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1103 |
!DialogBox class methodsFor:'common dialogs'! |
100 | 1104 |
|
2479 | 1105 |
about:text label:label icon:image |
1106 |
"opens an standard about box for an application." |
|
1107 |
||
1108 |
|box| |
|
1109 |
||
1110 |
AboutBox isNil ifTrue:[ |
|
1111 |
"/ this handles bad installations of ST/X, |
|
1112 |
"/ where the AboutBox is missing. |
|
1113 |
"/ (May vanish in the future) |
|
1114 |
^ self information:text |
|
1115 |
]. |
|
1116 |
||
1117 |
box := AboutBox title:text. |
|
1118 |
||
2672 | 1119 |
box image:image. |
2479 | 1120 |
box label:label. |
1121 |
box autoHideAfter:10 with:[]. |
|
3548
7cc719de254f
aboutToObenBoxNotification for aboutBox
Claus Gittinger <cg@exept.de>
parents:
3538
diff
changeset
|
1122 |
self showAndThenDestroyBox:box. |
7cc719de254f
aboutToObenBoxNotification for aboutBox
Claus Gittinger <cg@exept.de>
parents:
3538
diff
changeset
|
1123 |
"/ box open. |
2479 | 1124 |
|
1125 |
"Created: / 17.11.2001 / 23:04:53 / cg" |
|
1126 |
"Modified: / 17.11.2001 / 23:06:06 / cg" |
|
1127 |
! |
|
1128 |
||
2499 | 1129 |
aboutClass:aClass |
4132
783ba5afbcf0
comment/format in: #aboutClass:
Claus Gittinger <cg@exept.de>
parents:
4104
diff
changeset
|
1130 |
"opens a standard (simple) aboutBox for aClass." |
2499 | 1131 |
|
1132 |
|rev clsRev msg resources| |
|
1133 |
||
1134 |
rev := ''. |
|
1135 |
||
1136 |
(clsRev := aClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1137 |
resources := aClass classResources. |
|
1138 |
||
1139 |
msg := '\' withCRs , aClass name asBoldText, rev. |
|
1140 |
||
1141 |
self |
|
1142 |
about:(resources string:msg) |
|
1143 |
label:(resources string:'About ' , aClass nameWithoutPrefix) |
|
3629
e4ff4d031bbc
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
3622
diff
changeset
|
1144 |
icon:aClass defaultIconForAboutBox |
2499 | 1145 |
! |
1146 |
||
1703
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1147 |
informUser:aString during:aBlock |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1148 |
"show a message-box while executing aBlock" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1149 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1150 |
|box| |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1151 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1152 |
[ |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1153 |
box := InfoBox title:aString. |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1154 |
box hideButtons. |
2439 | 1155 |
self showBox:box. "/ box showAtPointer. |
1704
304ccbc56ec4
fixed #informUser:during: in case of timeSlicer not running.
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1156 |
] forkAt:(Processor activePriority + 1). |
2522
d80496af7eaf
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
2517
diff
changeset
|
1157 |
aBlock ensure:[box destroy] |
1703
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1158 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1159 |
" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1160 |
Dialog informUser:'wait a second...' during:[Delay waitForSeconds:1] |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1161 |
Dialog informUser:'wait a few seconds...' during:[10000 factorial] |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1162 |
" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1163 |
! |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1164 |
|
2622 | 1165 |
informUser:aString during:aBlock cancel:canCancel |
1166 |
"show a message-box while executing aBlock" |
|
1167 |
||
1168 |
|box subProcess| |
|
1169 |
||
1170 |
box := InfoBox title:aString. |
|
1171 |
canCancel ifTrue:[ |
|
2640
2672ec342e7e
Do not refer to uninitialized ClassResources
Stefan Vogel <sv@exept.de>
parents:
2637
diff
changeset
|
1172 |
box okText:(self classResources string:'Abort'). |
2622 | 1173 |
] ifFalse:[ |
1174 |
box hideButtons. |
|
1175 |
]. |
|
1176 |
||
1177 |
subProcess := [ |
|
1178 |
aBlock ensure:[box destroy] |
|
1179 |
] forkAt:(Processor activePriority - 1). |
|
1180 |
||
1181 |
self showBox:box. |
|
1182 |
subProcess terminate. |
|
1183 |
||
1184 |
||
1185 |
" |
|
1186 |
Dialog informUser:'don''t wait ...' during:[true] cancel:true |
|
3137 | 1187 |
Dialog informUser:'please wait a second...' during:[Delay waitForSeconds:1] cancel:true |
1188 |
Dialog informUser:'please wait, while I compute 30000 factorial...' during:[30000 factorial] cancel:true |
|
2622 | 1189 |
" |
1190 |
! |
|
1191 |
||
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
|
1192 |
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
|
1193 |
"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
|
1194 |
|
2493 | 1195 |
|currentScreen| |
1196 |
||
2781 | 1197 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
2493 | 1198 |
^ currentScreen |
1199 |
nativeInformationOK:aString |
|
1200 |
title:aString |
|
1201 |
]. |
|
2439 | 1202 |
self showAndThenDestroyBox:(InfoBox title:aString) |
197 | 1203 |
|
1204 |
" |
|
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
|
1205 |
Dialog information:'help' |
197 | 1206 |
" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1207 |
|
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1208 |
"Modified: 29.5.1996 / 15:23:03 / cg" |
197 | 1209 |
! |
1210 |
||
4208 | 1211 |
information:aString title:windowTitle |
1212 |
"launch a Dialog to tell user something" |
|
1213 |
||
1214 |
|currentScreen| |
|
1215 |
||
1216 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1217 |
^ currentScreen |
|
1218 |
nativeInformationOK:aString |
|
1219 |
title:windowTitle |
|
1220 |
]. |
|
1221 |
self showAndThenDestroyBox:(InfoBox title:aString label:windowTitle) |
|
1222 |
||
1223 |
" |
|
1224 |
Dialog information:'help' title:'Attention' |
|
1225 |
" |
|
1226 |
||
1227 |
"Created: / 22-12-2010 / 19:33:23 / cg" |
|
1228 |
! |
|
1229 |
||
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
|
1230 |
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
|
1231 |
"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
|
1232 |
|
2493 | 1233 |
|currentScreen| |
1234 |
||
2781 | 1235 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
2493 | 1236 |
^ currentScreen |
1237 |
nativeWarnOK:aString |
|
1238 |
title:aString |
|
1239 |
]. |
|
2439 | 1240 |
self showAndThenDestroyBox:(WarningBox title:aString) |
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
|
1241 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1242 |
" |
625 | 1243 |
Dialog warn:'some warning message' |
1244 |
||
1245 |
Dialog warn:('some text with italic emphasis' asText |
|
2439 | 1246 |
emphasizeFrom:16 to:22 with:#italic) |
625 | 1247 |
|
1248 |
Dialog warn:('some warning message' asText |
|
2439 | 1249 |
emphasizeAllWith:(#color->Color red)) |
625 | 1250 |
|
1251 |
Dialog warn:('some text with color emphasis' asText |
|
2439 | 1252 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
1253 |
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
|
1254 |
" |
625 | 1255 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1256 |
"Modified: 29.5.1996 / 15:23:14 / cg" |
4351 | 1257 |
! |
1258 |
||
1259 |
warn:aString title:windowTitle |
|
1260 |
"launch a Dialog to warn user" |
|
1261 |
||
1262 |
|currentScreen| |
|
1263 |
||
1264 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1265 |
^ currentScreen |
|
1266 |
nativeWarnOK:aString |
|
1267 |
title:windowTitle |
|
1268 |
]. |
|
1269 |
self showAndThenDestroyBox:(WarningBox title:aString label:windowTitle) |
|
1270 |
||
1271 |
" |
|
1272 |
Dialog warn:'some warning message' |
|
1273 |
||
1274 |
Dialog warn:('some text with italic emphasis' asText |
|
1275 |
emphasizeFrom:16 to:22 with:#italic) |
|
1276 |
||
1277 |
Dialog warn:('some warning message' asText |
|
1278 |
emphasizeAllWith:(#color->Color red)) |
|
1279 |
||
1280 |
Dialog warn:('some text with color emphasis' asText |
|
1281 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
|
1282 |
emphasizeFrom:16 to:20 with:(#color->Color red)) |
|
1283 |
" |
|
1284 |
||
1285 |
"Modified: / 29-05-1996 / 15:23:14 / cg" |
|
1286 |
"Created: / 20-01-2012 / 15:54:26 / 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
|
1287 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1288 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1289 |
!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
|
1290 |
|
197 | 1291 |
confirm:aString |
3355 | 1292 |
"open a modal yes-no dialog. |
1293 |
Return true for yes, false for no" |
|
197 | 1294 |
|
498 | 1295 |
^ self |
3456 | 1296 |
confirm:aString |
1297 |
title:nil |
|
1298 |
yesLabel:nil noLabel:nil |
|
1299 |
initialAnswer:true. |
|
498 | 1300 |
|
197 | 1301 |
" |
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
|
1302 |
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
|
1303 |
|
655 | 1304 |
Transcript showCR:( |
2298 | 1305 |
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
|
1306 |
) |
197 | 1307 |
" |
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
|
1308 |
|
3456 | 1309 |
"Modified: / 02-03-2007 / 15:25:34 / cg" |
197 | 1310 |
! |
1311 |
||
2317 | 1312 |
confirm:aString default:what |
1313 |
"launch a Dialog, which allows user to enter yes or no. |
|
1314 |
return true for yes, false for no. |
|
1315 |
InitialAnswer must be true or false and defines which button is to be |
|
1316 |
the default (i.e. return-) button" |
|
1317 |
||
3456 | 1318 |
^ self |
1319 |
confirm:aString |
|
1320 |
title:nil |
|
1321 |
yesLabel:nil noLabel:nil |
|
1322 |
initialAnswer:what. |
|
2453 | 1323 |
|
1324 |
" |
|
1325 |
Dialog confirm:'Are you happy' default:true |
|
1326 |
||
1327 |
Dialog confirm:'Are you happy' default:false |
|
1328 |
" |
|
3456 | 1329 |
|
1330 |
"Modified: / 02-03-2007 / 15:25:23 / cg" |
|
2317 | 1331 |
! |
1332 |
||
197 | 1333 |
confirm:aString initialAnswer:what |
1334 |
"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
|
1335 |
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
|
1336 |
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
|
1337 |
the default (i.e. return-) button" |
197 | 1338 |
|
2439 | 1339 |
^ self |
1340 |
confirm:aString |
|
1341 |
title:nil |
|
3456 | 1342 |
yesLabel:nil noLabel:nil |
2439 | 1343 |
initialAnswer:what. |
197 | 1344 |
|
1345 |
" |
|
1346 |
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
|
1347 |
|
655 | 1348 |
Transcript showCR:( |
2361 | 1349 |
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
|
1350 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1351 |
|
655 | 1352 |
Transcript showCR:( |
2361 | 1353 |
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
|
1354 |
) |
197 | 1355 |
" |
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
|
1356 |
|
3456 | 1357 |
"Modified: / 02-03-2007 / 15:24:52 / cg" |
197 | 1358 |
! |
1359 |
||
2618 | 1360 |
confirm:aString initialAnswer:what noLabel:noText |
1361 |
"launch a Dialog, which allows user to enter yes or no. |
|
1362 |
return true for yes, false for no. |
|
1363 |
InitialAnswer must be true or false and defines which button is to be |
|
1364 |
the default (i.e. return-) button" |
|
1365 |
||
1366 |
^ self |
|
1367 |
confirm:aString |
|
1368 |
title:nil |
|
3456 | 1369 |
yesLabel:nil noLabel:noText |
2618 | 1370 |
initialAnswer:what. |
3456 | 1371 |
|
1372 |
"Modified: / 02-03-2007 / 15:24:49 / cg" |
|
2618 | 1373 |
! |
1374 |
||
2079 | 1375 |
confirm:aString noLabel:noText |
1376 |
"launch a Dialog, which allows user to enter yes or no. |
|
1377 |
return true for yes, false for no. |
|
1378 |
The no-button is labeled noText (for example, if you need a 'cancel' there)" |
|
1379 |
||
1380 |
^ self |
|
1381 |
confirm:aString |
|
2493 | 1382 |
title:nil |
3456 | 1383 |
yesLabel:nil noLabel:noText |
1384 |
initialAnswer:true |
|
2079 | 1385 |
|
1386 |
" |
|
1387 |
Dialog confirm:'really ?' |
|
1388 |
||
2493 | 1389 |
Dialog confirm:'really ?' noLabel:'Cancel' |
2079 | 1390 |
" |
3456 | 1391 |
|
1392 |
"Modified: / 02-03-2007 / 15:24:43 / cg" |
|
1393 |
! |
|
1394 |
||
1395 |
confirm:aString title:title |
|
1396 |
"open a modal yes-no dialog. |
|
1397 |
Return true for yes, false for no" |
|
1398 |
||
1399 |
^ self |
|
1400 |
confirm:aString |
|
1401 |
title:nil |
|
1402 |
yesLabel:nil noLabel:nil |
|
1403 |
initialAnswer:true |
|
1404 |
||
1405 |
" |
|
1406 |
Dialog confirm:'really ?' |
|
1407 |
||
1408 |
Transcript showCR:( |
|
1409 |
Dialog confirm:'are you certain ?' |
|
1410 |
) |
|
1411 |
" |
|
1412 |
||
1413 |
"Created: / 02-03-2007 / 15:21:25 / cg" |
|
2079 | 1414 |
! |
1415 |
||
1416 |
confirm:aString title:title noLabel:noText |
|
1417 |
"launch a Dialog, which allows user to enter yes or no. |
|
1418 |
return true for yes, false for no. |
|
1419 |
The no buttons label is defined by noText (for example, to make it 'cancel')." |
|
1420 |
||
1421 |
^ self |
|
2493 | 1422 |
confirm:aString |
1423 |
title:title |
|
1424 |
yesLabel:nil noLabel:noText |
|
3456 | 1425 |
initialAnswer:true |
2079 | 1426 |
|
1427 |
" |
|
1428 |
Dialog |
|
1429 |
confirm:'really ?' |
|
1430 |
title:'fooBar' |
|
2493 | 1431 |
noLabel:'Nope' |
2079 | 1432 |
" |
1433 |
||
1434 |
" |
|
1435 |
Dialog |
|
1436 |
confirm:'really ?' |
|
1437 |
title:nil |
|
2493 | 1438 |
noLabel:'Cancel' |
2079 | 1439 |
" |
3456 | 1440 |
|
1441 |
"Modified: / 02-03-2007 / 15:23:55 / cg" |
|
2079 | 1442 |
! |
1443 |
||
498 | 1444 |
confirm:aString title:title yesLabel:yesText noLabel:noText |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1445 |
"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
|
1446 |
return true for yes, false for no. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1447 |
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
|
1448 |
|
2493 | 1449 |
^ self |
1450 |
confirm:aString |
|
1451 |
title:title |
|
1452 |
yesLabel:yesText noLabel:noText |
|
1453 |
initialAnswer:true |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1454 |
|
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1455 |
" |
498 | 1456 |
Dialog |
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1457 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1458 |
title:'fooBar' |
2493 | 1459 |
yesLabel:'Oh well' |
1460 |
noLabel:'Nope' |
|
498 | 1461 |
" |
1462 |
||
881 | 1463 |
" |
1464 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1465 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1466 |
title:nil |
2493 | 1467 |
yesLabel:'Oh well' |
1468 |
noLabel:'Nope' |
|
881 | 1469 |
" |
1470 |
||
1471 |
" |
|
1472 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1473 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1474 |
title:'' |
2493 | 1475 |
yesLabel:'Oh well' |
1476 |
noLabel:'Nope' |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1477 |
" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1478 |
|
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1479 |
"Created: / 21.2.1996 / 01:10:14 / cg" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1480 |
"Modified: / 18.4.1998 / 19:25:21 / cg" |
498 | 1481 |
! |
1482 |
||
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1483 |
confirm:aString title:title yesLabel:yesText noLabel:noText initialAnswer:what |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1484 |
"launch a Dialog, which allows user to enter yes or no. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1485 |
return true for yes, false for no. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1486 |
The yes/no buttons labels are defined by yesText/noText." |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1487 |
|
3456 | 1488 |
|box answer t currentScreen| |
1489 |
||
1490 |
t := title. |
|
1491 |
t isNil ifTrue:[ t := self classResources string:'Confirm' ]. |
|
1492 |
||
1493 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1494 |
"/ experimental |
|
1495 |
^ currentScreen |
|
1496 |
nativeConfirmYesNo:aString |
|
1497 |
title:t |
|
1498 |
initialAnswer:what |
|
1499 |
]. |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1500 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1501 |
box := YesNoBox title:aString. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1502 |
yesText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1503 |
box yesLabel:yesText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1504 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1505 |
noText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1506 |
box noLabel:noText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1507 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1508 |
answer := false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1509 |
box yesAction:[answer := true]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1510 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1511 |
box label:t. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1512 |
what == false ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1513 |
box okButton isReturnButton:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1514 |
box acceptReturnAsOK:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1515 |
box cancelButton beReturnButton. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1516 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1517 |
|
2439 | 1518 |
self showAndThenDestroyBox:box. |
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1519 |
box yesAction:nil noAction:nil. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1520 |
^ answer |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1521 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1522 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1523 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1524 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1525 |
title:'fooBar' |
2493 | 1526 |
yesLabel:'Oh well' |
1527 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1528 |
initialAnswer:true |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1529 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1530 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1531 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1532 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1533 |
title:'fooBar' |
2493 | 1534 |
yesLabel:'Oh well' |
1535 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1536 |
initialAnswer:false |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1537 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1538 |
|
3456 | 1539 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1540 |
"Modified: / 02-03-2007 / 15:23:31 / cg" |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1541 |
! |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1542 |
|
2710 | 1543 |
confirm:msg withCancel:aBoolean |
1544 |
"launch a Dialog, which allows user to enter yes, no and optionally: cancel. |
|
1545 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1546 |
||
1547 |
aBoolean ifTrue:[ |
|
1548 |
^ Dialog confirmWithCancel:msg. |
|
1549 |
] ifFalse:[ |
|
1550 |
^ Dialog confirm:msg. |
|
1551 |
]. |
|
1552 |
||
1553 |
" |
|
1554 |
Dialog confirm:'really ?' withCancel:false |
|
1555 |
Dialog confirm:'really ?' withCancel:true |
|
1556 |
" |
|
1557 |
! |
|
1558 |
||
3357
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1559 |
confirm:msg withCancel:aBoolean default:default |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1560 |
"launch a Dialog, which allows user to enter yes, no and optionally: cancel. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1561 |
return true for 'yes', false for 'no', nil for 'cancel'" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1562 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1563 |
aBoolean ifTrue:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1564 |
^ Dialog confirmWithCancel:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1565 |
] ifFalse:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1566 |
^ Dialog confirm:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1567 |
]. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1568 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1569 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1570 |
Dialog confirm:'really ?' withCancel:false |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1571 |
Dialog confirm:'really ?' withCancel:true |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1572 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1573 |
! |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1574 |
|
3382 | 1575 |
confirm:aString yesLabel:yesText |
1576 |
"launch a Dialog, which allows user to enter yes or no. |
|
1577 |
return true for yes, false for no. |
|
1578 |
The yes button's label is defined by yesText." |
|
1579 |
||
1580 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:nil |
|
1581 |
||
1582 |
" |
|
1583 |
Dialog |
|
1584 |
confirm:'really ?' |
|
1585 |
yesLabel:'Oh well' |
|
1586 |
" |
|
1587 |
||
1588 |
"Created: / 04-09-2006 / 11:18:50 / cg" |
|
1589 |
! |
|
1590 |
||
498 | 1591 |
confirm:aString yesLabel:yesText noLabel:noText |
1592 |
"launch a Dialog, which allows user to enter yes or no. |
|
1593 |
return true for yes, false for no. |
|
3382 | 1594 |
The yes/no buttons' labels are defined by yesText/noText." |
498 | 1595 |
|
1596 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText |
|
1597 |
||
1598 |
" |
|
2493 | 1599 |
Dialog |
1600 |
confirm:'really ?' |
|
1601 |
yesLabel:'Oh well' |
|
1602 |
noLabel:'Nope' |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1603 |
" |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1604 |
|
3382 | 1605 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1606 |
"Modified: / 04-09-2006 / 11:19:00 / cg" |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1607 |
! |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1608 |
|
3255 | 1609 |
confirm:aString yesLabel:yesText noLabel:noText initialAnswer:what |
1610 |
"launch a Dialog, which allows user to enter yes or no. |
|
1611 |
return true for yes, false for no. |
|
1612 |
The yes/no buttons labels are defined by yesText/noText." |
|
1613 |
||
1614 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText initialAnswer:what |
|
1615 |
||
1616 |
" |
|
1617 |
Dialog |
|
1618 |
confirm:'really ?' |
|
1619 |
yesLabel:'Oh well' |
|
1620 |
noLabel:'Nope' |
|
1621 |
initialAnswer:false |
|
1622 |
" |
|
1623 |
||
1624 |
"Created: 21.2.1996 / 01:10:14 / cg" |
|
1625 |
"Modified: 8.3.1996 / 21:15:06 / cg" |
|
1626 |
! |
|
1627 |
||
2790 | 1628 |
confirmOKCancel:aString |
1629 |
"launch a Dialog, which allows user to enter OK or Cancel. |
|
1630 |
return true for OK, false for Cancel." |
|
1631 |
||
1632 |
|resources| |
|
1633 |
||
1634 |
resources := self classResources. |
|
1635 |
^ self |
|
1636 |
confirm:aString |
|
1637 |
yesLabel:(resources string:'OK') |
|
1638 |
noLabel:(resources string:'Cancel') |
|
1639 |
||
1640 |
" |
|
1641 |
Dialog confirmOKCancel:'really ?' |
|
1642 |
" |
|
1643 |
! |
|
1644 |
||
197 | 1645 |
confirmWithCancel:aString |
1646 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1647 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1648 |
||
3456 | 1649 |
^ self |
1650 |
confirmWithCancel:aString |
|
1651 |
default:nil |
|
1652 |
title:nil |
|
1004 | 1653 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1654 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1655 |
Dialog confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1656 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1657 |
|
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1658 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1659 |
Transcript showCR:( |
3456 | 1660 |
Dialog confirmWithCancel:'really ?' |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1661 |
) |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1662 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1663 |
|
3456 | 1664 |
"Modified: / 02-03-2007 / 15:26:05 / cg" |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1665 |
! |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1666 |
|
1004 | 1667 |
confirmWithCancel:aString default:default |
1668 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1669 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1670 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1671 |
||
3456 | 1672 |
^ self |
2415 | 1673 |
confirmWithCancel:aString |
3456 | 1674 |
default:default |
1675 |
title:nil |
|
2790 | 1676 |
|
1004 | 1677 |
" |
1678 |
Dialog confirmWithCancel:'really ?' default:false |
|
2437 | 1679 |
Dialog confirmWithCancel:'really ?' default:true |
1004 | 1680 |
" |
3456 | 1681 |
|
1682 |
"Modified: / 02-03-2007 / 15:26:13 / cg" |
|
1004 | 1683 |
! |
1684 |
||
2788
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1685 |
confirmWithCancel:aString default:defaultValue onCancel:cancelValue |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1686 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1687 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1688 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1689 |
|answer| |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1690 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1691 |
answer := self confirmWithCancel:aString default:defaultValue. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1692 |
answer isNil ifTrue:[ |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1693 |
^ cancelValue value |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1694 |
]. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1695 |
^ answer |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1696 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1697 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1698 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1699 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1700 |
! |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1701 |
|
3456 | 1702 |
confirmWithCancel:aString default:default title:titleString |
1703 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1704 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1705 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1706 |
||
1707 |
^ self |
|
1708 |
confirmWithCancel:aString |
|
1709 |
labels:(self classResources array:#('Cancel' 'No' 'Yes') ) |
|
1710 |
values:#(nil false true) |
|
1711 |
default:(#(nil false true) indexOf:default ifAbsent:nil) |
|
1712 |
title:titleString |
|
1713 |
||
1714 |
" |
|
1715 |
Dialog confirmWithCancel:'really ?' default:false |
|
1716 |
Dialog confirmWithCancel:'really ?' default:true |
|
1717 |
" |
|
1718 |
||
1719 |
"Created: / 02-03-2007 / 15:09:56 / cg" |
|
1720 |
! |
|
1721 |
||
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1722 |
confirmWithCancel:aString labels:labelArray |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1723 |
"launch a Dialog, which allows user to enter cancel, no or yes. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1724 |
Return true for 'yes', false for 'no', nil for 'cancel'. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1725 |
The default is yes. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1726 |
The buttons labels are given in labelArray" |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1727 |
|
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1728 |
^ self |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1729 |
confirmWithCancel:aString |
3456 | 1730 |
labels:(self classResources array:labelArray) |
1731 |
default:3 |
|
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1732 |
" |
2493 | 1733 |
Dialog confirmWithCancel:'really ?' labels:#( 'Oops' 'Nope' 'Yea') |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1734 |
" |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1735 |
|
3456 | 1736 |
"Modified: / 02-03-2007 / 15:10:34 / cg" |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1737 |
! |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1738 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1739 |
confirmWithCancel:aString labels:buttonLabels default:default |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1740 |
"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
|
1741 |
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
|
1742 |
The strings for cancel, no and yes are to be passed in |
1004 | 1743 |
buttonLabels; |
1744 |
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
|
1745 |
return button (1 to 3)" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1746 |
|
1707 | 1747 |
^ self |
1748 |
confirmWithCancel:aString |
|
1749 |
labels:buttonLabels |
|
1750 |
values:#(nil false true) |
|
1751 |
default:default |
|
1752 |
||
1753 |
" |
|
1754 |
Transcript showCR:( |
|
1755 |
Dialog |
|
1756 |
confirmWithCancel:'really ?' |
|
2493 | 1757 |
labels:#('mhmh' 'Maybe' 'Definitely') |
1707 | 1758 |
default:3 |
1759 |
) |
|
1760 |
" |
|
1761 |
||
1762 |
"Created: / 18.10.1996 / 14:50:51 / cg" |
|
1763 |
"Modified: / 21.10.1998 / 15:49:16 / cg" |
|
1764 |
! |
|
1765 |
||
1766 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default |
|
1767 |
"launch a Dialog, which allows user to click on any button. |
|
1768 |
Return the corresponding value from the values array. |
|
1769 |
The labels for for the buttons are to be passed in |
|
1770 |
buttonLabels; |
|
1771 |
The default argument (if non-nil) defines the index of the |
|
1772 |
return button (1 to n)" |
|
1773 |
||
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1774 |
^ self |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1775 |
confirmWithCancel:aString |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1776 |
labels:buttonLabels |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1777 |
values:buttonValues |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1778 |
default:default |
3456 | 1779 |
title:nil |
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1780 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1781 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1782 |
Transcript showCR:( |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1783 |
Dialog |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1784 |
confirmWithCancel:'really ?' |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1785 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1786 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1787 |
default:3 |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1788 |
) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1789 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1790 |
|
3456 | 1791 |
"Created: / 18-10-1996 / 14:50:51 / cg" |
1792 |
"Modified: / 02-03-2007 / 15:09:24 / cg" |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1793 |
! |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1794 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1795 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default boxLabel:boxLabelOrNil |
3456 | 1796 |
"obsolete - for backward compatibility" |
1797 |
||
1798 |
^ self |
|
1799 |
confirmWithCancel:aString |
|
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1800 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1801 |
values:buttonValues |
3456 | 1802 |
default:default |
1803 |
title:boxLabelOrNil |
|
1804 |
||
1805 |
"Modified: / 02-03-2007 / 15:09:11 / cg" |
|
1806 |
! |
|
1807 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1808 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default check:checkLabelOrNil on:checkHolderOrNil title:boxLabelOrNil |
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1809 |
"launch a Dialog, which allows user to click on any button. |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1810 |
Return the corresponding value from the values array. |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1811 |
The labels for for the buttons are to be passed in |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1812 |
buttonLabels; |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1813 |
The default argument (if non-nil) defines the index of the return button (1 to n). |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1814 |
If checkLabel/checkHolder are not nil, and additional labelled checkBox is added to operate on |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1815 |
checkHolder. This can be used for 'do not show this box again' checkItems." |
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1816 |
|
3701 | 1817 |
|box buttons answer i| |
197 | 1818 |
|
1708
dc23c5ca439e
fixed button-creation in confirmWithCancel.
Claus Gittinger <cg@exept.de>
parents:
1707
diff
changeset
|
1819 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1820 |
box buttonTitles:buttonLabels |
1707 | 1821 |
actions:(buttonValues collect:[:v | [answer := v]]). |
2972
d66d46e04cd4
Use #image:/#label: instead of obsolete #form:
Stefan Vogel <sv@exept.de>
parents:
2966
diff
changeset
|
1822 |
box image:(YesNoBox iconBitmap). |
3622 | 1823 |
default notNil ifTrue:[ |
3805
33b4a2271c19
dont care for RETURN-key in keyPress:x:y:; its already done in keyboardProcessor
Claus Gittinger <cg@exept.de>
parents:
3756
diff
changeset
|
1824 |
box defaultButtonIndex:(default isInteger |
33b4a2271c19
dont care for RETURN-key in keyPress:x:y:; its already done in keyboardProcessor
Claus Gittinger <cg@exept.de>
parents:
3756
diff
changeset
|
1825 |
ifTrue:[default] |
33b4a2271c19
dont care for RETURN-key in keyPress:x:y:; its already done in keyboardProcessor
Claus Gittinger <cg@exept.de>
parents:
3756
diff
changeset
|
1826 |
ifFalse:[ buttonValues indexOf:default]) |
3622 | 1827 |
]. |
2493 | 1828 |
box label:(boxLabelOrNil ? (self classResources string:'Confirm')). |
3701 | 1829 |
buttons := box buttons. |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1830 |
(i := buttonValues indexOf:true) ~~ 0 ifTrue:[ |
3701 | 1831 |
i <= buttons size ifTrue:[ |
1832 |
(buttons at:i) cursor:(Cursor thumbsUp). |
|
3218 | 1833 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1834 |
]. |
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1835 |
(i := buttonValues indexOf:false) ~~ 0 ifTrue:[ |
3701 | 1836 |
i <= buttons size ifTrue:[ |
1837 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1838 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1839 |
]. |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1840 |
(i := buttonValues indexOf:nil) ~~ 0 ifTrue:[ |
3701 | 1841 |
i <= buttons size ifTrue:[ |
1842 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1843 |
] |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1844 |
]. |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1845 |
checkLabelOrNil notNil ifTrue:[ |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1846 |
box addCheckBox:checkLabelOrNil on:checkHolderOrNil. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1847 |
]. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1848 |
|
2439 | 1849 |
self showAndThenDestroyBox:box. |
197 | 1850 |
box actions:nil. |
1851 |
^ answer |
|
1852 |
||
1853 |
" |
|
1707 | 1854 |
Transcript showCR:( |
1855 |
Dialog |
|
1856 |
confirmWithCancel:'really ?' |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1857 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1858 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1859 |
default:3 |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1860 |
check:'Again' on:(true asValue) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1861 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1862 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1863 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1864 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1865 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1866 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1867 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1868 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1869 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1870 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1871 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1872 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1873 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1874 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1875 |
"Created: / 02-03-2007 / 15:08:49 / cg" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1876 |
! |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1877 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1878 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default title:boxLabelOrNil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1879 |
"launch a Dialog, which allows user to click on any button. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1880 |
Return the corresponding value from the values array. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1881 |
The labels for for the buttons are to be passed in |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1882 |
buttonLabels; |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1883 |
The default argument (if non-nil) defines the index of the |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1884 |
return button (1 to n)" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1885 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1886 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1887 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1888 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1889 |
values:buttonValues |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1890 |
default:default |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1891 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1892 |
title:boxLabelOrNil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1893 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1894 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1895 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1896 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1897 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1898 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1899 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1900 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1901 |
title:'hello there' |
1707 | 1902 |
) |
1903 |
" |
|
1904 |
||
3456 | 1905 |
"Created: / 02-03-2007 / 15:08:49 / cg" |
2787
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1906 |
! |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1907 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1908 |
confirmWithCancel:aString onCancel:cancelValue |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1909 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1910 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1911 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1912 |
|answer| |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1913 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1914 |
answer := self confirmWithCancel:aString. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1915 |
answer isNil ifTrue:[ |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1916 |
^ cancelValue value |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1917 |
]. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1918 |
^ answer |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1919 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1920 |
" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1921 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1922 |
" |
3456 | 1923 |
! |
1924 |
||
1925 |
confirmWithCancel:aString title:titleString |
|
1926 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1927 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1928 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1929 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1930 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1931 |
default:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1932 |
title:titleString |
3456 | 1933 |
|
1934 |
" |
|
1935 |
Dialog confirmWithCancel:'really ?' |
|
1936 |
" |
|
1937 |
||
1938 |
" |
|
1939 |
Transcript showCR:( |
|
1940 |
Dialog confirmWithCancel:'really ?' |
|
1941 |
) |
|
1942 |
" |
|
1943 |
||
1944 |
"Created: / 02-03-2007 / 15:11: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
|
1945 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1946 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1947 |
!DialogBox class methodsFor:'defaults'! |
573 | 1948 |
|
1949 |
defaultLabel |
|
1950 |
"return the boxes default window title." |
|
1951 |
||
1952 |
^ 'Dialog' |
|
1953 |
||
1954 |
"Created: 23.4.1996 / 17:13:10 / cg" |
|
1757 | 1955 |
! |
1956 |
||
1957 |
updateStyleCache |
|
1958 |
"extract values from the styleSheet and cache them in class variables" |
|
1959 |
||
1960 |
<resource: #style (#'dialogBox.returnShiftsFocusToOK')> |
|
1961 |
||
1962 |
DefaultFocusToOKOnLeave := StyleSheet at:'dialogBox.returnShiftsFocusToOK' default:false. |
|
1963 |
||
573 | 1964 |
! ! |
1965 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1966 |
!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
|
1967 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1968 |
requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1969 |
"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
|
1970 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1971 |
^ self |
2825 | 1972 |
requestDirectoryName:'Select Directory' |
1973 |
default:nil |
|
1974 |
ok:nil abort:nil |
|
1975 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1976 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1977 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1978 |
Dialog requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1979 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1980 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1981 |
"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
|
1982 |
"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
|
1983 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1984 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1985 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1986 |
"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
|
1987 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1988 |
^ self |
2825 | 1989 |
requestDirectoryName:title |
1990 |
default:nil |
|
1991 |
ok:nil abort:nil |
|
1992 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1993 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1994 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1995 |
Dialog |
2825 | 1996 |
requestDirectoryName:'which directory ?' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1997 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1998 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1999 |
"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
|
2000 |
"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
|
2001 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2002 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2003 |
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
|
2004 |
"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
|
2005 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2006 |
^ self |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2007 |
requestDirectoryName:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2008 |
default:aFileName |
2825 | 2009 |
ok:nil abort:nil |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2010 |
ifFail:'' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2011 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2012 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2013 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2014 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2015 |
default:'/etc' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2016 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2017 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2018 |
"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
|
2019 |
"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
|
2020 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2021 |
|
2966 | 2022 |
requestDirectoryName:title default:aFileName acceptReturnAsOK:aBoolean |
2023 |
"same as requestFileName, but only show directories" |
|
2024 |
||
2025 |
^ self |
|
2026 |
requestDirectoryName:title |
|
2027 |
default:aFileName |
|
2028 |
ok:nil abort:nil |
|
2029 |
ifFail:'' |
|
2030 |
acceptReturnAsOK:aBoolean |
|
2031 |
||
2032 |
" |
|
2033 |
Dialog |
|
2034 |
requestDirectoryName:'which directory ?' |
|
2035 |
default:'/etc' |
|
2036 |
" |
|
2037 |
||
2038 |
"Created: 19.4.1996 / 14:29:10 / cg" |
|
2039 |
"Modified: 19.4.1996 / 14:31:52 / cg" |
|
2040 |
! |
|
2041 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2042 |
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
|
2043 |
"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
|
2044 |
|
2825 | 2045 |
^ self |
2046 |
requestDirectoryName:title |
|
2047 |
default:aFileName |
|
2048 |
ok:nil abort:nil |
|
2049 |
ifFail:failBlock |
|
2050 |
||
2051 |
" |
|
2052 |
Dialog |
|
2053 |
requestDirectoryName:'which directory ?' |
|
2054 |
default:'/etc' |
|
2055 |
ifFail:'none' 'none' |
|
2056 |
" |
|
2057 |
||
2058 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2059 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2060 |
! |
|
2061 |
||
2062 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText |
|
2063 |
"same as requestFileName, but only show directories" |
|
2064 |
||
2065 |
^ self |
|
2066 |
requestDirectoryName:title |
|
2067 |
default:aFileName |
|
2068 |
ok:okText abort:abortText |
|
2069 |
ifFail:'' |
|
2070 |
||
2071 |
" |
|
2072 |
Dialog |
|
2073 |
requestDirectoryName:'which directory ?' |
|
2074 |
default:'/etc' |
|
2075 |
ok:'Yes' abort:'No' |
|
2076 |
" |
|
2077 |
||
2078 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2079 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2080 |
! |
|
2081 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2082 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2083 |
"Same as requestFileName, but only show directories." |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2084 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2085 |
^ self |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2086 |
requestDirectoryName:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2087 |
default:aFileName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2088 |
ok:okText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2089 |
abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2090 |
ifFail:failBlock |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2091 |
acceptReturnAsOK:false |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2092 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2093 |
"Modified (format): / 23-01-2012 / 11:46:08 / cg" |
2966 | 2094 |
! |
2095 |
||
2096 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
|
2097 |
"Same as requestFileName, but only show directories. |
|
2098 |
Extended to accept return as ok if wanted." |
|
2825 | 2099 |
|
2100 |
|t dir dirF fN fileBox enteredName resources| |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2101 |
|
2621 | 2102 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2103 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2104 |
^ "FileDialogV2" FileDialog requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2105 |
] |
2621 | 2106 |
]. |
2789 | 2107 |
|
2108 |
resources := self classResources. |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2109 |
fileBox := FileSelectionBox |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2110 |
title:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2111 |
action:[:fileName | enteredName := fileName]. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2112 |
|
3352 | 2113 |
fileBox acceptReturnAsOK:aBoolean. |
2966 | 2114 |
|
2825 | 2115 |
okText notNil |
2116 |
ifTrue:[ t := okText ] |
|
2117 |
ifFalse:[ t := resources string:'OK' ]. |
|
2118 |
fileBox okText:t. |
|
2119 |
||
2120 |
abortText notNil |
|
2121 |
ifTrue:[ t := abortText ] |
|
2122 |
ifFalse:[ t := resources string:'Cancel' ]. |
|
2123 |
fileBox abortText:t. |
|
2124 |
||
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2125 |
fN := aFileName. |
1780
bfc30a82aae3
dont get confused with a nil default
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
2126 |
dirF := (aFileName ? '.') asFilename. |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2127 |
dirF name = dirF baseName ifFalse:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2128 |
dir := dirF directoryName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2129 |
fN := dirF baseName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2130 |
] ifTrue:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2131 |
dir := FileSelectionBox lastFileSelectionDirectory. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2132 |
]. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2133 |
dir notNil ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2134 |
fileBox directory:dir. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2135 |
]. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2136 |
|
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2137 |
fileBox initialText:fN. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2138 |
fileBox selectingDirectory:true. |
2439 | 2139 |
|
2140 |
self showAndThenDestroyBox:fileBox. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2141 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2142 |
(enteredName isEmptyOrNil) ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2143 |
^ failBlock value |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2144 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2145 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2146 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2147 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2148 |
^ enteredName |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2149 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2150 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2151 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2152 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2153 |
default:'/etc' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2154 |
ifFail:'none' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2155 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2156 |
|
3352 | 2157 |
"Created: / 19-04-1996 / 14:31:04 / cg" |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2158 |
"Modified: / 23-01-2012 / 11:43:07 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2159 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2160 |
|
2631 | 2161 |
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2162 |
"same as requestFileName, but only show directories" |
|
2163 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2164 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2165 |
^ FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2166 |
requestDirectoryName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2167 |
default:aFileName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2168 |
ok:okText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2169 |
abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2170 |
version:versionSymbol |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2171 |
pattern:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2172 |
fromDirectory:aDirectoryPath |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2173 |
ifFail:failBlock |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2174 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2175 |
asLoadDialog:aBoolean. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2176 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2177 |
^ self |
2631 | 2178 |
requestDirectoryName:titleString |
2179 |
default:aFileName |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2180 |
ok:okText abort:abortText |
2631 | 2181 |
ifFail:failBlock |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2182 |
acceptReturnAsOK:true |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2183 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2184 |
"Modified: / 23-01-2012 / 11:47:37 / cg" |
2631 | 2185 |
! |
2186 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2187 |
requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2188 |
"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
|
2189 |
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
|
2190 |
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
|
2191 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2192 |
^ self |
1401 | 2193 |
requestFileName:'filename:' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2194 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2195 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2196 |
Dialog requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2197 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2198 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2199 |
"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
|
2200 |
"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
|
2201 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2202 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2203 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2204 |
"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
|
2205 |
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
|
2206 |
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
|
2207 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2208 |
^ self |
1401 | 2209 |
requestFileName:titleString |
2210 |
default:'file.ext' |
|
183 | 2211 |
|
197 | 2212 |
" |
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
|
2213 |
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
|
2214 |
Dialog requestFileName:'enter a fileName:' |
183 | 2215 |
" |
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
|
2216 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2217 |
"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
|
2218 |
"Modified: 19.4.1996 / 13:53:17 / cg" |
118 | 2219 |
! |
2220 |
||
100 | 2221 |
requestFileName:titleString default:defaultName |
2222 |
"launch a Dialog, which allows user to enter a filename. |
|
2223 |
The box will not allow pressing 'ok' without an entered string. |
|
2224 |
Return the pathname string consisting of the full pathname of the filename, |
|
2225 |
or an empty string (if cancel was pressed)." |
|
2226 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2227 |
^ self |
1401 | 2228 |
requestFileName:titleString |
2229 |
default:defaultName |
|
2230 |
version:nil |
|
2231 |
ifFail:'' |
|
100 | 2232 |
|
2233 |
" |
|
2234 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
2235 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
|
2236 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2237 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2238 |
"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
|
2239 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2240 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2241 |
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
|
2242 |
"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
|
2243 |
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
|
2244 |
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
|
2245 |
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
|
2246 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2247 |
^ self |
4181 | 2248 |
requestFileName:titleString |
2249 |
default:defaultName |
|
2250 |
version:nil |
|
2251 |
ifFail:'' |
|
2252 |
pattern:nil |
|
2253 |
fromDirectory:aDirectoryPath |
|
2254 |
forSave:false |
|
2255 |
whenBoxCreatedEvaluate:nil |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2256 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2257 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2258 |
Dialog |
4181 | 2259 |
requestFileName:'enter a fileName:' |
2260 |
default:'Makefile.bak' |
|
2261 |
fromDirectory:'..' |
|
2262 |
" |
|
2263 |
||
2264 |
"Modified: / 27-10-2010 / 10:40:42 / cg" |
|
100 | 2265 |
! |
2266 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2267 |
requestFileName:titleString default:defaultName ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2268 |
"launch a Dialog, which allows user to enter a filename. |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2269 |
The box will not allow pressing 'ok' without an entered string. |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2270 |
Return the pathname string consisting of the full pathname of the filename, |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2271 |
or an empty string (if cancel was pressed)." |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2272 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2273 |
^ self |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2274 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2275 |
default:defaultName |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2276 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2277 |
ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2278 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2279 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2280 |
Dialog requestFileName:'enter a fileName:' default:'' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2281 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2282 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2283 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2284 |
"Modified: 19.4.1996 / 13:47:44 / cg" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2285 |
! |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2286 |
|
1736 | 2287 |
requestFileName:titleString default:defaultName ifFail:failReturn pattern:pattern fromDirectory:dir |
2288 |
"launch a Dialog, which allows user to enter a filename. |
|
2289 |
The files presented initially are those from dir. |
|
2290 |
The box will show ok/cancel in its buttons. |
|
2291 |
The matchPattern is set to pattern initially. |
|
2292 |
Return the string or failReturn if cancel was pressed." |
|
2293 |
||
2294 |
^ self |
|
2295 |
requestFileName:titleString |
|
2296 |
default:defaultName |
|
2297 |
version:nil |
|
2298 |
ifFail:failReturn |
|
2299 |
pattern:pattern |
|
2300 |
fromDirectory:dir |
|
2301 |
||
2302 |
! |
|
2303 |
||
2825 | 2304 |
requestFileName:titleString default:defaultName ok:okText abort:abortText |
2305 |
"launch a Dialog, which allows user to enter a filename. |
|
2306 |
The files presented initially are those from the current directory. |
|
2307 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2308 |
The matchPattern is set to pattern initially. |
|
2309 |
Return the string or nil if cancel was pressed." |
|
2310 |
||
2311 |
^ self |
|
2312 |
requestFileName:titleString |
|
2313 |
default:defaultName |
|
2314 |
ok:okText abort:abortText |
|
2315 |
pattern:'*' |
|
2316 |
||
2317 |
" |
|
2318 |
Dialog |
|
2319 |
requestFileName:'enter a fileName:' |
|
2320 |
default:'' |
|
2321 |
ok:'yeah' |
|
2322 |
abort:'oh, no' |
|
2323 |
" |
|
2324 |
! |
|
2325 |
||
197 | 2326 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
2327 |
"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
|
2328 |
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
|
2329 |
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
|
2330 |
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
|
2331 |
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
|
2332 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2333 |
^ self |
1401 | 2334 |
requestFileName:titleString |
2335 |
default:defaultName |
|
2336 |
ok:okText |
|
2337 |
abort:abortText |
|
2338 |
pattern:pattern |
|
2339 |
fromDirectory:nil |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2340 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2341 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2342 |
Dialog |
1401 | 2343 |
requestFileName:'enter a fileName:' |
2344 |
default:'' |
|
2345 |
ok:'yeah' |
|
2346 |
abort:'oh, no' |
|
2347 |
pattern:'*.st' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2348 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2349 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2350 |
"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
|
2351 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2352 |
|
2218 | 2353 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2354 |
"launch a Dialog, which allows user to enter a filename. |
2218 | 2355 |
The files presented initially are those in aDirectoryPathOrNil, or the |
2356 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
197 | 2357 |
The box will show okText in its okButton, abortText in the abortButton. |
2358 |
The matchPattern is set to pattern initially. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2359 |
Return the string, or nil if cancel was pressed." |
197 | 2360 |
|
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2361 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2362 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2363 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2364 |
ok:okText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2365 |
abort:abortText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2366 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2367 |
fromDirectory:aDirectoryPathOrNil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2368 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2369 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2370 |
|
4181 | 2371 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil forSave:forSave |
2372 |
"launch a Dialog, which allows user to enter a filename. |
|
2373 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2374 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2375 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2376 |
The matchPattern is set to pattern initially. |
|
2377 |
Return the string, or nil if cancel was pressed." |
|
2378 |
||
2379 |
^ self |
|
2380 |
requestFileName:titleString |
|
2381 |
default:defaultName |
|
2382 |
ok:okText |
|
2383 |
abort:abortText |
|
2384 |
pattern:pattern |
|
2385 |
fromDirectory:aDirectoryPathOrNil |
|
2386 |
forSave:forSave |
|
2387 |
whenBoxCreatedEvaluate:nil |
|
2388 |
||
2389 |
"Created: / 27-10-2010 / 11:22:58 / cg" |
|
2390 |
! |
|
2391 |
||
2392 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil forSave:forSave whenBoxCreatedEvaluate:boxCreatedCallback |
|
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2393 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2394 |
The files presented initially are those in aDirectoryPathOrNil, or the |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2395 |
last fileBox directory (default: current directory) (if a nil path is given). |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2396 |
The box will show okText in its okButton, abortText in the abortButton. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2397 |
The matchPattern is set to pattern initially. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2398 |
Return the string, or nil if cancel was pressed." |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2399 |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2400 |
|box defaultDir defaultNm dir enteredName| |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2401 |
|
4164 | 2402 |
Screen current nativeFileDialogs ifTrue:[ |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2403 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2404 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2405 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2406 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2407 |
save:forSave |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2408 |
title:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2409 |
inDirectory:aDirectoryPathOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2410 |
initialAnswer:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2411 |
filter:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2412 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2413 |
]. |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2414 |
]. |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2415 |
]. |
2620 | 2416 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2417 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2418 |
^ FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2419 |
requestFileName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2420 |
default:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2421 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2422 |
pattern:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2423 |
fromDirectory:aDirectoryPathOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2424 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2425 |
] |
2620 | 2426 |
]. |
2427 |
||
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2428 |
defaultNm := defaultName. |
2218 | 2429 |
defaultDir := aDirectoryPathOrNil. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2430 |
defaultDir isNil ifTrue:[ |
2218 | 2431 |
defaultNm notNil ifTrue:[ |
2432 |
defaultDir := defaultName asFilename directoryName. |
|
2433 |
defaultNm := defaultNm asFilename baseName. |
|
2434 |
defaultDir = Filename currentDirectory name ifTrue:[ |
|
2435 |
defaultName asFilename isExplicitRelative ifFalse:[ |
|
2436 |
defaultDir := nil |
|
2437 |
] |
|
2438 |
] |
|
2439 |
]. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2440 |
]. |
197 | 2441 |
|
2442 |
box := FileSelectionBox |
|
2218 | 2443 |
title:titleString |
2444 |
okText:okText |
|
2445 |
abortText:abortText |
|
2446 |
action:[:fileName | enteredName := fileName]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2447 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2448 |
defaultDir notNil ifTrue:[ |
2218 | 2449 |
box directory:defaultDir |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2450 |
] ifFalse:[ |
2218 | 2451 |
dir := FileSelectionBox lastFileSelectionDirectory. |
2452 |
dir notNil ifTrue:[ |
|
2453 |
box directory:dir. |
|
2454 |
]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2455 |
]. |
197 | 2456 |
box pattern:pattern. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2457 |
box initialText:defaultNm. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2458 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2459 |
|
2460 |
self showAndThenDestroyBox:box. |
|
197 | 2461 |
box action:nil. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2462 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2463 |
(enteredName notEmptyOrNil) ifTrue:[ |
2218 | 2464 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2465 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2466 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2467 |
^ enteredName |
197 | 2468 |
|
2469 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2470 |
Dialog |
2218 | 2471 |
requestFileName:'enter a fileName:' |
2472 |
default:'' |
|
2473 |
ok:'yeah' |
|
2474 |
abort:'oh, no' |
|
2475 |
pattern:'rc*' |
|
2476 |
fromDirectory:'/etc' |
|
197 | 2477 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2478 |
|
4164 | 2479 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
4181 | 2480 |
"Created: / 27-10-2010 / 11:21:05 / cg" |
2481 |
! |
|
2482 |
||
2483 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
2484 |
"launch a Dialog, which allows user to enter a filename. |
|
2485 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2486 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2487 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2488 |
The matchPattern is set to pattern initially. |
|
2489 |
Return the string, or nil if cancel was pressed." |
|
2490 |
||
2491 |
^ self |
|
2492 |
requestFileName:titleString |
|
2493 |
default:defaultName |
|
2494 |
ok:okText |
|
2495 |
abort:abortText |
|
2496 |
pattern:pattern |
|
2497 |
fromDirectory:aDirectoryPathOrNil |
|
2498 |
forSave:false |
|
2499 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2500 |
||
2501 |
" |
|
2502 |
Dialog |
|
2503 |
requestFileName:'enter a fileName:' |
|
2504 |
default:'' |
|
2505 |
ok:'yeah' |
|
2506 |
abort:'oh, no' |
|
2507 |
pattern:'rc*' |
|
2508 |
fromDirectory:'/etc' |
|
2509 |
" |
|
2510 |
||
2511 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
2512 |
"Modified: / 27-10-2010 / 11:21:44 / cg" |
|
197 | 2513 |
! |
2514 |
||
2631 | 2515 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2516 |
"launch a Dialog, which allows user to enter a filename. |
|
2517 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2518 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2519 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2520 |
The matchPattern is set to pattern initially. |
|
2521 |
Return the string, or nil if cancel was pressed |
|
2522 |
The version argument allows validation of the files existance; |
|
2523 |
it may be any of: |
|
2524 |
#mustBeNew - fail (return empty string) if the file exists |
|
2525 |
#new - confirm if the file exists |
|
2526 |
#mustBeOld - fail if the file does not exist |
|
2527 |
#old - confirm if the file does not exist |
|
2528 |
#any (other) - no validation |
|
2529 |
" |
|
2530 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2531 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2532 |
^ FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2533 |
requestFileName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2534 |
default:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2535 |
ok:okText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2536 |
abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2537 |
version:versionSymbol |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2538 |
ifFail:failBlock |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2539 |
pattern:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2540 |
fromDirectory:aDirectoryPath |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2541 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2542 |
asLoadDialog:aBoolean. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2543 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2544 |
^ self |
2631 | 2545 |
requestFileName:titleString |
2546 |
default:defaultName |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2547 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2548 |
pattern:pattern fromDirectory:aDirectoryPath forSave:aBoolean not |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2549 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2550 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2551 |
"Modified: / 23-01-2012 / 11:50:45 / cg" |
2631 | 2552 |
! |
2553 |
||
1030 | 2554 |
requestFileName:titleString default:defaultName pattern:pattern |
2555 |
"launch a Dialog, which allows user to enter a filename. |
|
2556 |
The files presented initially are those from the current directory. |
|
2557 |
The box will show ok/cancel in its buttons. |
|
2558 |
The matchPattern is set to pattern initially. |
|
2559 |
Return the string or nil if cancel was pressed." |
|
2560 |
||
2415 | 2561 |
|resources| |
2562 |
||
2563 |
resources := self classResources. |
|
1030 | 2564 |
^ self |
2415 | 2565 |
requestFileName:titleString |
2566 |
default:defaultName |
|
3276 | 2567 |
ok:(resources string:'OK') |
2415 | 2568 |
abort:(resources string:'Cancel') |
2569 |
pattern:pattern |
|
2570 |
fromDirectory:nil |
|
1030 | 2571 |
|
2572 |
" |
|
2573 |
Dialog |
|
2415 | 2574 |
requestFileName:'enter a fileName:' |
2575 |
default:'' |
|
2576 |
pattern:'*.st' |
|
1030 | 2577 |
" |
2578 |
" |
|
2579 |
Dialog |
|
2415 | 2580 |
requestFileName:'enter a fileName:' |
2581 |
default:'' |
|
2582 |
pattern:'*.st;*.h' |
|
1030 | 2583 |
" |
2584 |
||
2585 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2586 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2587 |
! |
|
2588 |
||
2525 | 2589 |
requestFileName:titleString default:defaultName pattern:pattern fromDirectory:aDirectory |
2590 |
"launch a Dialog, which allows user to enter a filename. |
|
2591 |
The files presented initially are those from the current directory. |
|
2592 |
The box will show ok/cancel in its buttons. |
|
2593 |
The matchPattern is set to pattern initially. |
|
2594 |
Return the string or nil if cancel was pressed." |
|
2595 |
||
2596 |
|resources| |
|
2597 |
||
2598 |
resources := self classResources. |
|
2599 |
^ self |
|
2600 |
requestFileName:titleString |
|
2601 |
default:defaultName |
|
3276 | 2602 |
ok:(resources string:'OK') |
2525 | 2603 |
abort:(resources string:'Cancel') |
2604 |
pattern:pattern |
|
2605 |
fromDirectory:aDirectory |
|
2606 |
||
2607 |
" |
|
2608 |
Dialog |
|
2609 |
requestFileName:'enter a fileName:' |
|
2610 |
default:'' |
|
2611 |
pattern:'*.st' |
|
2612 |
" |
|
2613 |
" |
|
2614 |
Dialog |
|
2615 |
requestFileName:'enter a fileName:' |
|
2616 |
default:'' |
|
2617 |
pattern:'*.st;*.h' |
|
2618 |
" |
|
2619 |
||
2620 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2621 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2622 |
! |
|
2623 |
||
100 | 2624 |
requestFileName:titleString default:defaultName version:versionSymbol |
2625 |
"launch a Dialog, which allows user to enter a filename. |
|
2626 |
The box will not allow pressing 'ok' without an entered string. |
|
2627 |
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
|
2628 |
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
|
2629 |
it may be any of: |
1401 | 2630 |
#mustBeNew - fail (return empty string) if the file exists |
2631 |
#new - confirm if the file exists |
|
2632 |
#mustBeOld - fail if the file does not exist |
|
2633 |
#old - confirm if the file does not exist |
|
2634 |
#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
|
2635 |
" |
100 | 2636 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2637 |
^ self |
1401 | 2638 |
requestFileName:titleString |
2639 |
default:defaultName |
|
2640 |
version:versionSymbol |
|
2641 |
ifFail:'' |
|
100 | 2642 |
|
2643 |
" |
|
2644 |
Dialog requestFileName:'enter a fileName:' |
|
1401 | 2645 |
default:'' |
2646 |
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
|
2647 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2648 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2649 |
default:'' |
2650 |
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
|
2651 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2652 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2653 |
default:'' |
2654 |
version:#new |
|
100 | 2655 |
" |
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
|
2656 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2657 |
"Modified: 19.4.1996 / 13:53:58 / cg" |
100 | 2658 |
! |
2659 |
||
2660 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
2661 |
"launch a Dialog, which allows user to enter a filename. |
|
2662 |
The box will not allow pressing 'ok' without an entered string. |
|
2663 |
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
|
2664 |
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
|
2665 |
it may be any of: |
1401 | 2666 |
#mustBeNew - fail (return empty string) if the file exists |
2667 |
#new - confirm if the file exists |
|
2668 |
#mustBeOld - fail if the file does not exist |
|
2669 |
#old - confirm if the file does not exist |
|
2670 |
#any (other) - no validation |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2671 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2672 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2673 |
^ self |
1401 | 2674 |
requestFileName:titleString |
2675 |
default:defaultName |
|
2676 |
version:versionSymbol |
|
2677 |
ifFail:failBlock |
|
2678 |
fromDirectory:nil |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2679 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2680 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2681 |
Dialog |
1401 | 2682 |
requestFileName:'enter a fileName:' |
2683 |
default:'' |
|
2684 |
version:nil |
|
2685 |
ifFail:['none'] |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2686 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2687 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2688 |
Dialog |
1401 | 2689 |
requestFileName:'enter a fileName:' |
2690 |
default:'' |
|
2691 |
version:#old |
|
2692 |
ifFail:['none'] |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2693 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2694 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2695 |
"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
|
2696 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2697 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2698 |
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
|
2699 |
"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
|
2700 |
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
|
2701 |
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
|
2702 |
it may be any of: |
1736 | 2703 |
#mustBeNew - fail (return empty string) if the file exists |
2704 |
#new - confirm if the file exists |
|
2705 |
#mustBeOld - fail if the file does not exist |
|
2706 |
#old - confirm if the file does not exist |
|
2707 |
#any (other) - no validation |
|
2708 |
" |
|
2709 |
||
2710 |
^ self |
|
2711 |
requestFileName:titleString |
|
2712 |
default:defaultName |
|
2713 |
version:versionSymbol |
|
2714 |
ifFail:failBlock |
|
2715 |
pattern:nil |
|
2716 |
fromDirectory:aDirectoryPath |
|
1031 | 2717 |
|
2718 |
" |
|
2719 |
Dialog |
|
1736 | 2720 |
requestFileName:'enter a fileName:' |
2721 |
default:'' |
|
2722 |
version:nil |
|
2723 |
ifFail:['none'] |
|
2724 |
fromDirectory:'/etc' |
|
1031 | 2725 |
" |
2726 |
" |
|
2727 |
Dialog |
|
1736 | 2728 |
requestFileName:'enter a fileName:' |
2729 |
default:'' |
|
2730 |
version:#old |
|
2731 |
ifFail:['none'] |
|
2732 |
fromDirectory:'/etc' |
|
1031 | 2733 |
" |
2734 |
" |
|
2735 |
Dialog |
|
1736 | 2736 |
requestFileName:'enter a fileName:' |
2737 |
default:'' |
|
2738 |
version:#mustBeNew |
|
2739 |
ifFail:['none'] |
|
2740 |
fromDirectory:'/etc' |
|
1031 | 2741 |
" |
2742 |
||
2743 |
"Modified: 20.2.1997 / 18:12:28 / cg" |
|
2744 |
"Modified: 21.2.1997 / 14:27:27 / stefan" |
|
2745 |
! |
|
2746 |
||
2747 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
2748 |
"launch a Dialog, which allows user to enter a filename. |
|
2749 |
Return the string or the value of failBlock if cancel was pressed. |
|
2750 |
The version argument allows validation of the files existance; |
|
2751 |
it may be any of: |
|
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2752 |
#mustBeNew - fail (return empty string) if the file exists |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2753 |
#new - confirm if the file exists |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2754 |
#mustBeOld - fail if the file does not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2755 |
#old - confirm if the file does not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2756 |
#any (other) - no validation |
1031 | 2757 |
" |
2758 |
||
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2759 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2760 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2761 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2762 |
version:versionSymbol |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2763 |
ifFail:failBlock |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2764 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2765 |
fromDirectory:aDirectoryPath |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2766 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2767 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2768 |
|
4181 | 2769 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath forSave:forSave whenBoxCreatedEvaluate:boxCreatedCallback |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2770 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2771 |
Return the string or the value of failBlock if cancel was pressed. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2772 |
The version argument allows validation of the files existance; |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2773 |
it may be any of: |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2774 |
#mustBeNew - fail (return empty string) if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2775 |
#new - confirm if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2776 |
#mustBeOld - fail if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2777 |
#old - confirm if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2778 |
#any (other) - no validation |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2779 |
" |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2780 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2781 |
|box defaultDir defaultNm| |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2782 |
|
4164 | 2783 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 2784 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2785 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2786 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2787 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2788 |
save:forSave |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2789 |
title:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2790 |
inDirectory:aDirectoryPath |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2791 |
initialAnswer:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2792 |
filter:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2793 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2794 |
] |
3574 | 2795 |
]. |
2796 |
]. |
|
2797 |
||
2621 | 2798 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2799 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2800 |
^ FileDialog |
2769 | 2801 |
requestFileName:titleString |
2802 |
default:defaultName |
|
2803 |
version:versionSymbol |
|
2804 |
ifFail:failBlock |
|
2805 |
pattern:pattern |
|
2806 |
fromDirectory:aDirectoryPath |
|
2807 |
whenBoxCreatedEvaluate:boxCreatedCallback. |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2808 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2809 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2810 |
|
2773 | 2811 |
defaultName notNil ifTrue:[defaultNm := defaultName asFilename name]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2812 |
defaultDir := aDirectoryPath. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2813 |
defaultDir isNil ifTrue:[ |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2814 |
defaultNm notNil ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2815 |
defaultName asFilename withoutSuffix baseName = '*' ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2816 |
defaultDir := FileSelectionBox lastFileSelectionDirectory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2817 |
defaultNm := ''. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2818 |
] ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2819 |
defaultDir := defaultName asFilename directoryName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2820 |
defaultNm := defaultNm asFilename baseName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2821 |
] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2822 |
]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2823 |
]. |
100 | 2824 |
|
2825 |
box := FileSelectionBox title:titleString. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2826 |
defaultDir notNil ifTrue:[box directory:defaultDir]. |
1031 | 2827 |
pattern notNil ifTrue:[box pattern:pattern]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2828 |
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
|
2829 |
box action:[:name | |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2830 |
versionSymbol == #mustBeNew ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2831 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2832 |
name asFilename exists ifTrue:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2833 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2834 |
versionSymbol == #new ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2835 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2836 |
name asFilename exists ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2837 |
(self confirm:(self classResources string:'''%1'' exists.\\Continue anyway ?' with:box fileName) withCRs) |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2838 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2839 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2840 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2841 |
versionSymbol == #mustBeOld ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2842 |
name asFilename exists ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2843 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2844 |
versionSymbol == #old ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2845 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2846 |
name asFilename exists ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2847 |
(self confirm:(self classResources string:'''%1'' does not exist yet.\\Continue anyway ?' with:box fileName) withCRs) |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2848 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2849 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2850 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2851 |
FileSelectionBox lastFileSelectionDirectory:box directory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2852 |
box destroy. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2853 |
^ 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
|
2854 |
]. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2855 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2856 |
self showAndThenDestroyBox:box. |
100 | 2857 |
box action:nil. |
2858 |
^ failBlock value |
|
2859 |
||
2860 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2861 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2862 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2863 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2864 |
version:nil |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2865 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2866 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2867 |
fromDirectory:'/etc' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2868 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2869 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2870 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2871 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2872 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2873 |
version:#old |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2874 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2875 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2876 |
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
|
2877 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2878 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2879 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2880 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2881 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2882 |
version:#mustBeNew |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2883 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2884 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2885 |
fromDirectory:'/etc' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2886 |
" |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2887 |
|
4181 | 2888 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
2889 |
"Created: / 27-10-2010 / 10:38:10 / cg" |
|
2890 |
! |
|
2891 |
||
2892 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
2893 |
"launch a Dialog, which allows user to enter a filename. |
|
2894 |
Return the string or the value of failBlock if cancel was pressed. |
|
2895 |
The version argument allows validation of the files existance; |
|
2896 |
it may be any of: |
|
2897 |
#mustBeNew - fail (return empty string) if the file exists |
|
2898 |
#new - confirm if the file exists |
|
2899 |
#mustBeOld - fail if the file does not exist |
|
2900 |
#old - confirm if the file does not exist |
|
2901 |
#any (other) - no validation |
|
2902 |
" |
|
2903 |
||
2904 |
^ self |
|
2905 |
requestFileName:titleString |
|
2906 |
default:defaultName |
|
2907 |
version:versionSymbol |
|
2908 |
ifFail:failBlock |
|
2909 |
pattern:pattern |
|
2910 |
fromDirectory:aDirectoryPath |
|
2911 |
forSave:false |
|
2912 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2913 |
||
2914 |
" |
|
2915 |
Dialog |
|
2916 |
requestFileName:'enter a fileName:' |
|
2917 |
default:'' |
|
2918 |
version:nil |
|
2919 |
ifFail:['none'] |
|
2920 |
pattern:'*.conf' |
|
2921 |
fromDirectory:'/etc' |
|
2922 |
" |
|
2923 |
" |
|
2924 |
Dialog |
|
2925 |
requestFileName:'enter a fileName:' |
|
2926 |
default:'' |
|
2927 |
version:#old |
|
2928 |
ifFail:['none'] |
|
2929 |
pattern:'*.conf' |
|
2930 |
fromDirectory:'/etc' |
|
2931 |
" |
|
2932 |
" |
|
2933 |
Dialog |
|
2934 |
requestFileName:'enter a fileName:' |
|
2935 |
default:'' |
|
2936 |
version:#mustBeNew |
|
2937 |
ifFail:['none'] |
|
2938 |
pattern:'*.conf' |
|
2939 |
fromDirectory:'/etc' |
|
2940 |
" |
|
2941 |
||
4164 | 2942 |
"Created: / 21-02-1997 / 14:23:44 / stefan" |
2943 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
|
4181 | 2944 |
"Modified: / 27-10-2010 / 10:38:53 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2945 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2946 |
|
3877 | 2947 |
requestFileName:titleString fromDirectory:aDirectory |
2948 |
"launch a Dialog, which allows user to enter a filename. |
|
2949 |
The files presented initially are those from the current directory. |
|
2950 |
The box will show ok/cancel in its buttons. |
|
2951 |
Return the string or nil if cancel was pressed." |
|
2952 |
||
2953 |
^ self |
|
2954 |
requestFileName:titleString |
|
2955 |
default:nil |
|
2956 |
pattern:'*' |
|
2957 |
fromDirectory:aDirectory |
|
2958 |
||
2959 |
" |
|
2960 |
Dialog |
|
2961 |
requestFileName:'enter a fileName:' |
|
2962 |
fromDirectory:'../../libbasic' |
|
2963 |
" |
|
2964 |
! |
|
2965 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2966 |
requestFileName:titleString ifFail:cancelBlockOrValue |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2967 |
"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
|
2968 |
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
|
2969 |
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
|
2970 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2971 |
^ self |
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2972 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2973 |
default:'file.ext' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2974 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2975 |
ifFail:cancelBlockOrValue |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2976 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2977 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2978 |
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
|
2979 |
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
|
2980 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2981 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2982 |
"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
|
2983 |
"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
|
2984 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2985 |
|
2524 | 2986 |
requestFileName:titleString pattern:pattern |
2987 |
"launch a Dialog, which allows user to enter a filename. |
|
2988 |
The files presented initially are those from the current directory. |
|
2989 |
The box will show ok/cancel in its buttons. |
|
2990 |
The matchPattern is set to pattern initially. |
|
2991 |
Return the string or nil if cancel was pressed." |
|
2992 |
||
2993 |
^ self |
|
2994 |
requestFileName:titleString |
|
2995 |
default:nil |
|
2996 |
pattern:pattern |
|
2997 |
||
2998 |
" |
|
2999 |
Dialog |
|
3000 |
requestFileName:'enter a fileName:' |
|
3001 |
pattern:'*.st' |
|
3002 |
" |
|
3003 |
" |
|
3004 |
Dialog |
|
3005 |
requestFileName:'enter a fileName:' |
|
3006 |
pattern:'*.st;*.h' |
|
3007 |
" |
|
3008 |
! |
|
3009 |
||
2525 | 3010 |
requestFileName:titleString pattern:pattern fromDirectory:aDirectory |
3011 |
"launch a Dialog, which allows user to enter a filename. |
|
3012 |
The files presented initially are those from the current directory. |
|
3013 |
The box will show ok/cancel in its buttons. |
|
3014 |
The matchPattern is set to pattern initially. |
|
3015 |
Return the string or nil if cancel was pressed." |
|
3016 |
||
3017 |
^ self |
|
3018 |
requestFileName:titleString |
|
3019 |
default:nil |
|
3020 |
pattern:pattern |
|
3021 |
fromDirectory:aDirectory |
|
3022 |
" |
|
3023 |
Dialog |
|
3024 |
requestFileName:'enter a fileName:' |
|
3025 |
pattern:'*.st' |
|
3026 |
" |
|
3027 |
" |
|
3028 |
Dialog |
|
3029 |
requestFileName:'enter a fileName:' |
|
3030 |
pattern:'*.st;*.h' |
|
3031 |
" |
|
3032 |
! |
|
3033 |
||
4181 | 3034 |
requestFileNameForSave:titleString |
3035 |
"launch a Dialog, which allows user to enter a filename. |
|
3036 |
Return the pathname string consisting of the full pathname of the filename, |
|
3037 |
or an empty string (if cancel was pressed)." |
|
3038 |
||
3039 |
^ self |
|
3040 |
requestFileNameForSave:titleString |
|
3041 |
default:'file.ext' |
|
3042 |
||
3043 |
" |
|
3044 |
Dialog requestFileName:'enter a fileName:' |
|
3045 |
Dialog requestFileName:'enter a fileName:' |
|
3046 |
" |
|
3047 |
||
3048 |
"Created: / 27-10-2010 / 11:31:52 / cg" |
|
3049 |
! |
|
3050 |
||
3051 |
requestFileNameForSave:titleString default:defaultName |
|
3052 |
"launch a Dialog, which allows user to enter a filename. |
|
3053 |
The box will not allow pressing 'ok' without an entered string. |
|
3054 |
Return the pathname string consisting of the full pathname of the filename, |
|
3055 |
or an empty string (if cancel was pressed)." |
|
3056 |
||
3057 |
^ self |
|
4182
46fec1281cbc
changed: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4181
diff
changeset
|
3058 |
requestFileNameForSave:titleString |
4181 | 3059 |
default:defaultName |
3060 |
version:nil |
|
3061 |
ifFail:'' |
|
3062 |
||
3063 |
" |
|
3064 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
4183
c775db615fdf
comment/format in: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4182
diff
changeset
|
3065 |
Dialog requestFileNameForSave:'enter a fileName:' default:'' |
4181 | 3066 |
" |
3067 |
||
3068 |
"Created: / 27-10-2010 / 11:32:06 / cg" |
|
3069 |
! |
|
3070 |
||
3071 |
requestFileNameForSave:titleString default:defaultName fromDirectory:aDirectoryPath |
|
3072 |
"launch a Dialog, which allows user to enter a filename. |
|
3073 |
The box will not allow pressing 'ok' without an entered string. |
|
3074 |
Return the pathname string consisting of the full pathname of the filename, |
|
3075 |
or an empty string (if cancel was pressed)." |
|
3076 |
||
3077 |
^ self |
|
3078 |
requestFileName:titleString |
|
3079 |
default:defaultName |
|
3080 |
version:nil |
|
3081 |
ifFail:'' |
|
3082 |
pattern:nil |
|
3083 |
fromDirectory:aDirectoryPath |
|
3084 |
forSave:true |
|
3085 |
whenBoxCreatedEvaluate:nil |
|
3086 |
||
3087 |
" |
|
3088 |
Dialog |
|
3089 |
requestFileName:'enter a fileName:' |
|
3090 |
default:'Makefile.bak' |
|
3091 |
fromDirectory:'..' |
|
3092 |
" |
|
3093 |
||
3094 |
"Created: / 27-10-2010 / 10:41:04 / cg" |
|
3095 |
! |
|
3096 |
||
3097 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
|
3098 |
"launch a Dialog, which allows user to enter a filename. |
|
3099 |
The files presented initially are those from the current directory. |
|
3100 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3101 |
The matchPattern is set to pattern initially. |
|
3102 |
Return the string or nil if cancel was pressed." |
|
3103 |
||
3104 |
^ self |
|
3105 |
requestFileNameForSave:titleString |
|
3106 |
default:defaultName |
|
3107 |
ok:okText |
|
3108 |
abort:abortText |
|
3109 |
pattern:pattern |
|
3110 |
fromDirectory:nil |
|
3111 |
||
3112 |
" |
|
3113 |
Dialog |
|
3114 |
requestFileName:'enter a fileName:' |
|
3115 |
default:'' |
|
3116 |
ok:'yeah' |
|
3117 |
abort:'oh, no' |
|
3118 |
pattern:'*.st' |
|
3119 |
" |
|
3120 |
||
3121 |
"Created: / 27-10-2010 / 11:29:20 / cg" |
|
3122 |
! |
|
3123 |
||
3124 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil |
|
3125 |
"launch a Dialog, which allows user to enter a filename. |
|
3126 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3127 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3128 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3129 |
The matchPattern is set to pattern initially. |
|
3130 |
Return the string, or nil if cancel was pressed." |
|
3131 |
||
3132 |
^ self |
|
3133 |
requestFileName:titleString |
|
3134 |
default:defaultName |
|
3135 |
ok:okText |
|
3136 |
abort:abortText |
|
3137 |
pattern:pattern |
|
3138 |
fromDirectory:aDirectoryPathOrNil |
|
3139 |
forSave:true |
|
3140 |
whenBoxCreatedEvaluate:nil |
|
3141 |
||
3142 |
"Created: / 27-10-2010 / 11:24:37 / cg" |
|
3143 |
! |
|
3144 |
||
3145 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
3146 |
"launch a Dialog, which allows user to enter a filename. |
|
3147 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3148 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3149 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3150 |
The matchPattern is set to pattern initially. |
|
3151 |
Return the string, or nil if cancel was pressed." |
|
3152 |
||
3153 |
^ self |
|
3154 |
requestFileName:titleString |
|
3155 |
default:defaultName |
|
3156 |
ok:okText |
|
3157 |
abort:abortText |
|
3158 |
pattern:pattern |
|
3159 |
fromDirectory:aDirectoryPathOrNil |
|
3160 |
forSave:true |
|
3161 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3162 |
||
3163 |
" |
|
3164 |
Dialog |
|
3165 |
requestFileName:'enter a fileName:' |
|
3166 |
default:'' |
|
3167 |
ok:'yeah' |
|
3168 |
abort:'oh, no' |
|
3169 |
pattern:'rc*' |
|
3170 |
fromDirectory:'/etc' |
|
3171 |
" |
|
3172 |
||
3173 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
3174 |
"Created: / 27-10-2010 / 11:23:40 / cg" |
|
3175 |
! |
|
3176 |
||
3177 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
3178 |
"launch a Dialog, which allows user to enter a filename. |
|
3179 |
The box will not allow pressing 'ok' without an entered string. |
|
3180 |
Return the string or the value of failBlock if cancel was pressed. |
|
3181 |
The version argument allows validation of the files existance; |
|
3182 |
it may be any of: |
|
3183 |
#mustBeNew - fail (return empty string) if the file exists |
|
3184 |
#new - confirm if the file exists |
|
3185 |
#mustBeOld - fail if the file does not exist |
|
3186 |
#old - confirm if the file does not exist |
|
3187 |
#any (other) - no validation |
|
3188 |
" |
|
3189 |
||
3190 |
^ self |
|
3191 |
requestFileNameForSave:titleString |
|
3192 |
default:defaultName |
|
3193 |
version:versionSymbol |
|
3194 |
ifFail:failBlock |
|
3195 |
fromDirectory:nil |
|
3196 |
||
3197 |
" |
|
3198 |
Dialog |
|
3199 |
requestFileName:'enter a fileName:' |
|
3200 |
default:'' |
|
3201 |
version:nil |
|
3202 |
ifFail:['none'] |
|
3203 |
" |
|
3204 |
" |
|
3205 |
Dialog |
|
3206 |
requestFileName:'enter a fileName:' |
|
3207 |
default:'' |
|
3208 |
version:#old |
|
3209 |
ifFail:['none'] |
|
3210 |
" |
|
3211 |
||
3212 |
"Created: / 27-10-2010 / 11:32:03 / cg" |
|
3213 |
! |
|
3214 |
||
3215 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath |
|
3216 |
"launch a Dialog, which allows user to enter a filename. |
|
3217 |
Return the string or the value of failBlock if cancel was pressed. |
|
3218 |
The version argument allows validation of the files existance; |
|
3219 |
it may be any of: |
|
3220 |
#mustBeNew - fail (return empty string) if the file exists |
|
3221 |
#new - confirm if the file exists |
|
3222 |
#mustBeOld - fail if the file does not exist |
|
3223 |
#old - confirm if the file does not exist |
|
3224 |
#any (other) - no validation |
|
3225 |
" |
|
3226 |
||
3227 |
^ self |
|
3228 |
requestFileNameForSave:titleString |
|
3229 |
default:defaultName |
|
3230 |
version:versionSymbol |
|
3231 |
ifFail:failBlock |
|
3232 |
pattern:nil |
|
3233 |
fromDirectory:aDirectoryPath |
|
3234 |
||
3235 |
" |
|
3236 |
Dialog |
|
3237 |
requestFileName:'enter a fileName:' |
|
3238 |
default:'' |
|
3239 |
version:nil |
|
3240 |
ifFail:['none'] |
|
3241 |
fromDirectory:'/etc' |
|
3242 |
" |
|
3243 |
" |
|
3244 |
Dialog |
|
3245 |
requestFileName:'enter a fileName:' |
|
3246 |
default:'' |
|
3247 |
version:#old |
|
3248 |
ifFail:['none'] |
|
3249 |
fromDirectory:'/etc' |
|
3250 |
" |
|
3251 |
" |
|
3252 |
Dialog |
|
3253 |
requestFileName:'enter a fileName:' |
|
3254 |
default:'' |
|
3255 |
version:#mustBeNew |
|
3256 |
ifFail:['none'] |
|
3257 |
fromDirectory:'/etc' |
|
3258 |
" |
|
3259 |
||
3260 |
"Modified: / 21-02-1997 / 14:27:27 / stefan" |
|
3261 |
"Created: / 27-10-2010 / 11:32:22 / cg" |
|
3262 |
! |
|
3263 |
||
3264 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
3265 |
"launch a Dialog, which allows user to enter a filename. |
|
3266 |
Return the string or the value of failBlock if cancel was pressed. |
|
3267 |
The version argument allows validation of the files existance; |
|
3268 |
it may be any of: |
|
3269 |
#mustBeNew - fail (return empty string) if the file exists |
|
3270 |
#new - confirm if the file exists |
|
3271 |
#mustBeOld - fail if the file does not exist |
|
3272 |
#old - confirm if the file does not exist |
|
3273 |
#any (other) - no validation |
|
3274 |
" |
|
3275 |
||
3276 |
^ self |
|
3277 |
requestFileName:titleString |
|
3278 |
default:defaultName |
|
3279 |
version:versionSymbol |
|
3280 |
ifFail:failBlock |
|
3281 |
pattern:pattern |
|
3282 |
fromDirectory:aDirectoryPath |
|
3283 |
forSave:true |
|
3284 |
whenBoxCreatedEvaluate:nil |
|
3285 |
||
3286 |
"Created: / 27-10-2010 / 11:32:55 / cg" |
|
3287 |
! |
|
3288 |
||
2631 | 3289 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog |
3290 |
"launch a Dialog, which allows user to enter a filename. |
|
3291 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3292 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3293 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3294 |
The matchPattern is set to pattern initially. |
|
3295 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
|
3296 |
" |
|
3297 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3298 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3299 |
^ FileDialog |
2631 | 3300 |
requestFileNames:titleString |
3301 |
default:defaultName |
|
3302 |
ok:okText |
|
3303 |
abort:abortText |
|
3304 |
ifFail:failBlock |
|
3305 |
pattern:pattern |
|
3306 |
fromDirectory:aDirectoryPath |
|
3307 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3308 |
asLoadDialog:asLoadDialog. |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3309 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3310 |
^ self |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3311 |
requestFileName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3312 |
default:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3313 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3314 |
pattern:pattern fromDirectory:aDirectoryPath forSave:asLoadDialog not |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3315 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3316 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3317 |
"Modified: / 23-01-2012 / 11:52:17 / cg" |
2631 | 3318 |
! |
3319 |
||
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
|
3320 |
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
|
3321 |
"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
|
3322 |
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
|
3323 |
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
|
3324 |
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
|
3325 |
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
|
3326 |
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
|
3327 |
|
1736 | 3328 |
^ self |
3329 |
requestFileName:titleString |
|
3330 |
default:defaultName |
|
3331 |
version:#new |
|
3332 |
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
|
3333 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3334 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3335 |
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
|
3336 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3337 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3338 |
"Modified: 27.1.1996 / 13:44:13 / cg" |
2694 | 3339 |
! |
3340 |
||
3341 |
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction:appendActionOrNil |
|
3418 | 3342 |
"save contents into a file - ask user for filename using a fileSelectionBox. |
3343 |
Append is NOT offered, if appendActionOrNil is nil." |
|
2694 | 3344 |
|
2789 | 3345 |
|doAppend fileBox fileName dialog default resources| |
2694 | 3346 |
|
3347 |
default := defaultOrNil. |
|
3348 |
default notNil ifTrue:[ default := default asString]. |
|
3349 |
||
2789 | 3350 |
resources := self classResources. |
3351 |
||
4164 | 3352 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 3353 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
3354 |
appendActionOrNil isNil ifTrue:[ |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3355 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3356 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3357 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3358 |
save:true |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3359 |
title:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3360 |
inDirectory:directoryOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3361 |
initialAnswer:default |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3362 |
filter:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3363 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3364 |
] |
3574 | 3365 |
]. |
3366 |
]. |
|
3367 |
]. |
|
3368 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3369 |
(UserPreferences current useNewFileDialog and:[FileDialog notNil]) ifTrue:[ |
2694 | 3370 |
fileName := FileDialog |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3371 |
requestFileName:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3372 |
default:default |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3373 |
ok:(resources string:'Save') |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3374 |
abort:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3375 |
version:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3376 |
ifFail:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3377 |
pattern:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3378 |
fromDirectory:directoryOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3379 |
whenBoxCreatedEvaluate:[:box | (dialog := box) appendButtonVisibleHolder value:appendActionOrNil notNil]. |
2694 | 3380 |
|
3381 |
doAppend := dialog appendWasPressed |
|
3382 |
] ifFalse:[ |
|
3383 |
fileBox := FileSaveBox |
|
3384 |
title:title |
|
2789 | 3385 |
okText:(resources string:'Save') |
3386 |
abortText:(resources string:'Cancel') |
|
2694 | 3387 |
action:[:fn | doAppend := false. fileName := fn]. |
3388 |
fileBox appendAction:[:fn | doAppend := true. fileName := fn]. |
|
3389 |
directoryOrNil notNil ifTrue:[ fileBox directory:directoryOrNil]. |
|
3390 |
default notNil ifTrue:[fileBox initialText:default]. |
|
3391 |
fileBox showAtPointer. |
|
3392 |
fileBox destroy. |
|
3393 |
]. |
|
3394 |
||
3395 |
fileName size > 0 ifTrue:[ |
|
2705
a7c0e46f20fb
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction
tm
parents:
2700
diff
changeset
|
3396 |
(doAppend ifTrue:[appendActionOrNil] ifFalse:[action]) |
2694 | 3397 |
value:fileName |
3398 |
]. |
|
3399 |
^ self. |
|
3418 | 3400 |
|
3401 |
" |
|
3402 |
Dialog |
|
3403 |
requestSaveFileName:'Save dialog example with append' |
|
3404 |
default:'xxx.txt' |
|
3405 |
fromDirectory:(Filename homeDirectory) |
|
3406 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3407 |
appendAction:[:fn | Transcript showCR:'append ',fn] |
|
3408 |
||
3409 |
Dialog |
|
3410 |
requestSaveFileName:'Save dialog example' |
|
3411 |
default:'xxx.txt' |
|
3412 |
fromDirectory:(Filename homeDirectory) |
|
3413 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3414 |
appendAction:nil |
|
3415 |
" |
|
3416 |
||
4164 | 3417 |
"Modified: / 24-08-2010 / 17:29:12 / sr" |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3418 |
"Modified: / 23-01-2012 / 11:53:07 / 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
|
3419 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3420 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
3421 |
!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
|
3422 |
|
2315 | 3423 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3424 |
"return a dialog asking for multiline text. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3425 |
The box is not shown yet, for further customization" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3426 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3427 |
^ self |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3428 |
forRequestText:title |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3429 |
editViewClass:EditTextView |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3430 |
lines:numLines columns:numCols |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3431 |
initialAnswer:initialText model:textModel |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3432 |
setupWith: |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3433 |
[:textView :dialog| |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3434 |
textView model:textModel. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3435 |
textView acceptChannel:(dialog acceptChannel). |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3436 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3437 |
] |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3438 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3439 |
"Modified: / 12-10-2006 / 13:59:21 / cg" |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3440 |
! |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3441 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3442 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel setupWith:aSetupBlockOrNil |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3443 |
"return a dialog asking for multiline text. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3444 |
The box is not shown yet, for further customization" |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3445 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3446 |
|dialog textView| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3447 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3448 |
dialog := self new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3449 |
(dialog addTextLabel:(self classResources string:title)) adjust:#left. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3450 |
textView := dialog addTextBoxOn:nil |
2315 | 3451 |
class:editViewClass |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3452 |
withNumberOfLines:numLines |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3453 |
hScrollable:true |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3454 |
vScrollable:true. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3455 |
dialog width:(textView preferredExtentForLines:numLines cols:numCols) x. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3456 |
dialog addAbortAndOkButtons. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3457 |
dialog okButton isReturnButton:false. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3458 |
dialog makeTabable:textView. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3459 |
dialog stickAtBottomWithVariableHeight:textView. |
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3460 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3461 |
aSetupBlockOrNil notNil ifTrue:[ |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3462 |
aSetupBlockOrNil valueWithOptionalArgument:textView and:dialog |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3463 |
]. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3464 |
textModel notNil ifTrue:[ |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3465 |
textModel value:initialText. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3466 |
]. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3467 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3468 |
^ dialog |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3469 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3470 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3471 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3472 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3473 |
textHolder := ValueHolder new. |
2315 | 3474 |
dialog := Dialog |
3475 |
forRequestText:'foo' |
|
3476 |
editViewClass:EditTextView |
|
3477 |
lines:10 columns:40 |
|
3478 |
initialAnswer:'hello' model:textHolder. |
|
3479 |
dialog open. |
|
3480 |
dialog accepted ifTrue:[ |
|
3481 |
^ textHolder value |
|
3482 |
]. |
|
3483 |
^ nil |
|
3484 |
" |
|
3485 |
||
3486 |
" |
|
3487 |
|dialog textHolder| |
|
3488 |
||
3489 |
textHolder := ValueHolder new. |
|
3490 |
dialog := Dialog |
|
3491 |
forRequestText:'foo' |
|
3492 |
editViewClass:CodeView |
|
3493 |
lines:10 columns:40 |
|
3494 |
initialAnswer:'hello' model:textHolder. |
|
3495 |
dialog open. |
|
3496 |
dialog accepted ifTrue:[ |
|
3497 |
^ textHolder value |
|
3498 |
]. |
|
3499 |
^ nil |
|
3500 |
" |
|
3501 |
||
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3502 |
"Created: / 12-10-2006 / 13:59:27 / cg" |
2315 | 3503 |
! |
3504 |
||
3505 |
forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textModel |
|
3506 |
"return a dialog asking for multiline text. |
|
3507 |
The box is not shown yet, for further customization" |
|
3508 |
||
3509 |
^ self |
|
3510 |
forRequestText:title |
|
3511 |
editViewClass:EditTextView |
|
3512 |
lines:numLines columns:numCols |
|
3513 |
initialAnswer:initialText model:textModel |
|
3514 |
||
3515 |
" |
|
3516 |
|dialog textHolder| |
|
3517 |
||
3518 |
textHolder := ValueHolder new. |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3519 |
dialog := Dialog forRequestText:'foo' lines:10 columns:40 initialAnswer:'hello' model:textHolder. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3520 |
dialog open. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3521 |
dialog accepted ifTrue:[ |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3522 |
^ textHolder value |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3523 |
]. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3524 |
^ nil |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3525 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3526 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3527 |
"Modified: / 12-10-2006 / 12:45:47 / cg" |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3528 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3529 |
|
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
|
3530 |
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
|
3531 |
"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
|
3532 |
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
|
3533 |
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
|
3534 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3535 |
^ self |
2439 | 3536 |
request:aString |
3537 |
displayAt:nil |
|
3538 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
3539 |
action:nil |
|
3540 |
initialAnswer:'' |
|
3541 |
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
|
3542 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3543 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3544 |
Dialog |
2439 | 3545 |
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
|
3546 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3547 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3548 |
"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
|
3549 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3550 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3551 |
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
|
3552 |
"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
|
3553 |
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
|
3554 |
that point. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3555 |
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
|
3556 |
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
|
3557 |
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
|
3558 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3559 |
^ self |
2444 | 3560 |
request:aString |
3561 |
displayAt:aPoint |
|
3562 |
centered:centered |
|
3563 |
action:resultAction |
|
3564 |
initialAnswer:initial |
|
3565 |
okLabel:nil |
|
3566 |
cancelLabel:nil |
|
3567 |
title:nil |
|
4093 | 3568 |
onCancel:nil |
2444 | 3569 |
list:nil |
3570 |
initialSelection:nil |
|
3571 |
entryCompletionBlock: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
|
3572 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3573 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3574 |
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
|
3575 |
|
2444 | 3576 |
Dialog |
2548 | 3577 |
request:'Enter a string:' |
2444 | 3578 |
displayAt:200@200 |
3579 |
centered:true |
|
3580 |
action:[:result | result printNewline] |
|
3581 |
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
|
3582 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3583 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3584 |
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
|
3585 |
|
2444 | 3586 |
Dialog |
2548 | 3587 |
request:'Enter a string:' |
2444 | 3588 |
displayAt:200@200 |
3589 |
centered:false |
|
3590 |
action:[:result | result printNewline] |
|
3591 |
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
|
3592 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3593 |
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
|
3594 |
|
2444 | 3595 |
Dialog |
2548 | 3596 |
request:'Enter a string:' |
2444 | 3597 |
displayAt:nil |
3598 |
centered:false |
|
3599 |
action:[:result | result printNewline] |
|
3600 |
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
|
3601 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3602 |
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
|
3603 |
|
2444 | 3604 |
Dialog |
2548 | 3605 |
request:'Enter a string:' |
2444 | 3606 |
displayAt:nil |
3607 |
centered:true |
|
3608 |
action:[:result | result printNewline] |
|
3609 |
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
|
3610 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3611 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3612 |
"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
|
3613 |
"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
|
3614 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3615 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3616 |
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
|
3617 |
"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
|
3618 |
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
|
3619 |
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
|
3620 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3621 |
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
|
3622 |
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
|
3623 |
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
|
3624 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3625 |
^ self |
2444 | 3626 |
request:aString |
3627 |
displayAt:aPoint |
|
3628 |
centered:centered |
|
3629 |
action:resultAction |
|
3630 |
initialAnswer:initial |
|
3631 |
okLabel:okLabel |
|
3632 |
cancelLabel:cancelLabel |
|
3633 |
title:nil |
|
3634 |
onCancel:cancelValue |
|
3635 |
list:nil |
|
3636 |
initialSelection:nil |
|
3637 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3638 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3639 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3640 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 3641 |
Dialog |
2548 | 3642 |
request:'Enter a string:' |
2444 | 3643 |
displayAt:0@0 |
3644 |
centered:true |
|
3645 |
action:[:result | result printNewline] |
|
3646 |
initialAnswer:'the default' |
|
2548 | 3647 |
okLabel:'Yes' |
3648 |
cancelLabel:'No' |
|
2444 | 3649 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3650 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3651 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3652 |
|
2444 | 3653 |
Dialog |
2548 | 3654 |
request:'Enter a string:' |
2444 | 3655 |
displayAt:200@200 |
3656 |
centered:true |
|
3657 |
action:[:result | result printNewline] |
|
3658 |
initialAnswer:'the default' |
|
2548 | 3659 |
okLabel:'Yes' |
3660 |
cancelLabel:'No' |
|
2444 | 3661 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3662 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3663 |
topLeft of box at 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3664 |
|
2444 | 3665 |
Dialog |
2548 | 3666 |
request:'Enter a string:' |
2444 | 3667 |
displayAt:200@200 |
3668 |
centered:false |
|
3669 |
action:[:result | result printNewline] |
|
3670 |
initialAnswer:'the default' |
|
2548 | 3671 |
okLabel:'Yes' |
3672 |
cancelLabel:'No' |
|
2444 | 3673 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3674 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3675 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3676 |
|
2444 | 3677 |
Dialog |
2548 | 3678 |
request:'Enter a string:' |
2444 | 3679 |
displayAt:nil |
3680 |
centered:false |
|
3681 |
action:[:result | result printNewline] |
|
3682 |
initialAnswer:'the default' |
|
2548 | 3683 |
okLabel:'Yes' |
3684 |
cancelLabel:'No' |
|
2444 | 3685 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3686 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3687 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3688 |
|
2444 | 3689 |
Dialog |
2548 | 3690 |
request:'Enter a string:' |
2444 | 3691 |
displayAt:nil |
3692 |
centered:true |
|
3693 |
action:[:result | result printNewline] |
|
3694 |
initialAnswer:'the default' |
|
2548 | 3695 |
okLabel:'Yes' |
3696 |
cancelLabel:'No' |
|
2444 | 3697 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3698 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3699 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3700 |
"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
|
3701 |
"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
|
3702 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3703 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3704 |
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
|
3705 |
"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
|
3706 |
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
|
3707 |
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
|
3708 |
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
|
3709 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3710 |
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
|
3711 |
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
|
3712 |
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
|
3713 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3714 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3715 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3716 |
displayAt:aPoint |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3717 |
centered:centered |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3718 |
action:resultAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3719 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3720 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3721 |
cancelLabel:cancelLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3722 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3723 |
onCancel:cancelValue |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3724 |
list:nil |
2444 | 3725 |
initialSelection:nil |
3726 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3727 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3728 |
|
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3729 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3730 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3731 |
onCancel:cancelValue list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3732 |
"launch a Dialog, which allows user to enter a string. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3733 |
The dialogs window is titled titleString, or the default (if nil). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3734 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3735 |
If it is nil, it is shown at the current pointer position or at the |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3736 |
screen center (if centered is true). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3737 |
The ok-button is labelled okLabel (or the default, ifNil), |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3738 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3739 |
Return the string or the value of cancelValue (if cancel was pressed)" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3740 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3741 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3742 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3743 |
displayAt:aPoint |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3744 |
centered:centered |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3745 |
action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3746 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3747 |
okLabel:okLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3748 |
cancelLabel:cancelLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3749 |
title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3750 |
onCancel:cancelValue |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3751 |
list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3752 |
initialSelection:nil |
2444 | 3753 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3754 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3755 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3756 |
centered around 200@200: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3757 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3758 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3759 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3760 |
displayAt:200@200 |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3761 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3762 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3763 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3764 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3765 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3766 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3767 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3768 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3769 |
under mouse pointer: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3770 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3771 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3772 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3773 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3774 |
centered:false |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3775 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3776 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3777 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3778 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3779 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3780 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3781 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3782 |
centered on the screen: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3783 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3784 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3785 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3786 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3787 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3788 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3789 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3790 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3791 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3792 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3793 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3794 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3795 |
with a list: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3796 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3797 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3798 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3799 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3800 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3801 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3802 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3803 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3804 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3805 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3806 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3807 |
list:#(foo bar baz) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3808 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3809 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3810 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3811 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3812 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3813 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3814 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3815 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3816 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anInterval |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3817 |
"launch a Dialog, which allows user to enter a string. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3818 |
The dialogs window is titled titleString, or the default (if nil). |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3819 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3820 |
If it is nil, it is shown at the current pointer position or at the |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3821 |
screen center (if centered is true). |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3822 |
The ok-button is labelled okLabel (or the default, ifNil), |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3823 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3824 |
Return the string or the value of cancelValue (if cancel was pressed)" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3825 |
|
2444 | 3826 |
^ self |
3827 |
request:aString |
|
3828 |
displayAt:aPoint |
|
3829 |
centered:centered |
|
3830 |
action:resultAction |
|
3831 |
initialAnswer:initial |
|
3832 |
okLabel:okLabel |
|
3833 |
cancelLabel:cancelLabel |
|
3834 |
title:titleString |
|
3835 |
onCancel:cancelValue |
|
3836 |
list:listToSelectFrom |
|
3837 |
initialSelection:anInterval |
|
3838 |
entryCompletionBlock:nil |
|
3839 |
||
3840 |
" |
|
3841 |
centered around 200@200: |
|
3842 |
||
3843 |
Dialog |
|
2548 | 3844 |
request:'Enter a string:' |
2444 | 3845 |
displayAt:200@200 |
3846 |
centered:true |
|
3847 |
action:[:result | result printNewline] |
|
3848 |
initialAnswer:'the default' |
|
2548 | 3849 |
okLabel:'Yes' |
3850 |
cancelLabel:'No' |
|
2444 | 3851 |
title:'foo' |
3852 |
onCancel:#foo |
|
3853 |
||
3854 |
under mouse pointer: |
|
3855 |
||
3856 |
Dialog |
|
2548 | 3857 |
request:'Enter a string:' |
2444 | 3858 |
displayAt:nil |
3859 |
centered:false |
|
3860 |
action:[:result | result printNewline] |
|
3861 |
initialAnswer:'the default' |
|
2548 | 3862 |
okLabel:'Yes' |
3863 |
cancelLabel:'No' |
|
2444 | 3864 |
title:'foo' |
3865 |
onCancel:#foo |
|
3866 |
||
3867 |
centered on the screen: |
|
3868 |
||
3869 |
Dialog |
|
2548 | 3870 |
request:'Enter a string:' |
2444 | 3871 |
displayAt:nil |
3872 |
centered:true |
|
3873 |
action:[:result | result printNewline] |
|
3874 |
initialAnswer:'the default' |
|
2548 | 3875 |
okLabel:'Yes' |
3876 |
cancelLabel:'No' |
|
2444 | 3877 |
title:'foo' |
3878 |
onCancel:#foo |
|
3879 |
||
3880 |
with a list: |
|
3881 |
||
3882 |
Dialog |
|
2548 | 3883 |
request:'Enter a string:' |
2444 | 3884 |
displayAt:nil |
3885 |
centered:true |
|
3886 |
action:[:result | result printNewline] |
|
3887 |
initialAnswer:'the default' |
|
2548 | 3888 |
okLabel:'Yes' |
3889 |
cancelLabel:'No' |
|
2444 | 3890 |
title:'foo' |
3891 |
onCancel:#foo |
|
3892 |
list:#(foo bar baz) |
|
3893 |
" |
|
3894 |
||
3895 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
|
3896 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
|
3897 |
! |
|
3898 |
||
3899 |
request:aString displayAt:aPoint centered:centeredOrNil action:resultAction |
|
3900 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
|
3901 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anInterval |
|
3902 |
entryCompletionBlock:entryCompletionBlock |
|
3903 |
"launch a Dialog, which allows user to enter a string. |
|
3904 |
The dialogs window is titled titleString, or the default (if nil). |
|
3905 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
|
3906 |
If it is nil, it is shown at the current pointer position or at the |
|
3907 |
screen center (if centered is true). |
|
3908 |
The ok-button is labelled okLabel (or the default, ifNil), |
|
3909 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
|
3910 |
Return the string or the value of cancelValue (if cancel was pressed)" |
|
3911 |
||
3912 |
|box centered| |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3913 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3914 |
listToSelectFrom isNil ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3915 |
box := EnterBox title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3916 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3917 |
box := EnterBoxWithList title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3918 |
box list:listToSelectFrom. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3919 |
]. |
2685 | 3920 |
initial notNil ifTrue:[ box initialText:initial printString ]. |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3921 |
anInterval notNil ifTrue:[ |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3922 |
box selectFrom:anInterval start to:anInterval stop. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3923 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
3924 |
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
|
3925 |
okLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3926 |
box okText:okLabel. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3927 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3928 |
cancelLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3929 |
box abortText:cancelLabel |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3930 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3931 |
resultAction isNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3932 |
box action:[:val | box destroy. ^ val] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3933 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3934 |
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
|
3935 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3936 |
titleString notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3937 |
box label:titleString |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3938 |
]. |
2444 | 3939 |
entryCompletionBlock notNil ifTrue:[ |
2517 | 3940 |
"/ box entryCompletionBlock:[:text | box |
3941 |
"/ initialText:(entryCompletionBlock value:text) |
|
3942 |
"/ selected:false]. |
|
3943 |
box entryCompletionBlock:entryCompletionBlock. |
|
2444 | 3944 |
]. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3945 |
|
2444 | 3946 |
centered := centeredOrNil ? (ForceModalBoxesToOpenAtCenter ? false). |
3947 |
||
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3948 |
aPoint notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3949 |
box showAt:aPoint center:centered |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3950 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3951 |
centered ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3952 |
box showAtCenter |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3953 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3954 |
box showAtPointer |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3955 |
] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3956 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
3957 |
box destroy. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3958 |
^ cancelValue value. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3959 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3960 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3961 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3962 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3963 |
Dialog |
2548 | 3964 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3965 |
displayAt:200@200 |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3966 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3967 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3968 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3969 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3970 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3971 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3972 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3973 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3974 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3975 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3976 |
Dialog |
2548 | 3977 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3978 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3979 |
centered:false |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3980 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3981 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3982 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3983 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3984 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3985 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3986 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3987 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3988 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3989 |
Dialog |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3990 |
request:'enter a string:' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3991 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3992 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3993 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3994 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3995 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3996 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3997 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3998 |
onCancel:#foo |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3999 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4000 |
with a list: |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4001 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4002 |
Dialog |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4003 |
request:'enter a string:' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4004 |
displayAt:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4005 |
centered:true |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4006 |
action:[:result | result printNewline] |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4007 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4008 |
okLabel:'yes' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4009 |
cancelLabel:'no' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4010 |
title:'foo' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4011 |
onCancel:#foo |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4012 |
list:#(foo bar baz) |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4013 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4014 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4015 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4016 |
"Modified: / 5.5.1999 / 10:50: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
|
4017 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4018 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4019 |
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
|
4020 |
"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
|
4021 |
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
|
4022 |
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
|
4023 |
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
|
4024 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4025 |
^ self |
2444 | 4026 |
request:aString |
4027 |
displayAt:aPoint |
|
4028 |
centered:centered |
|
4029 |
action:resultAction |
|
4030 |
initialAnswer:initial |
|
4031 |
okLabel:nil |
|
4032 |
cancelLabel:nil |
|
4033 |
title:nil |
|
4034 |
onCancel:cancelValue |
|
4035 |
list:nil |
|
4036 |
initialSelection: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
|
4037 |
|
100 | 4038 |
" |
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
|
4039 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 4040 |
Dialog |
4041 |
request:'enter a string:' |
|
4042 |
displayAt:0@0 |
|
4043 |
centered:true |
|
4044 |
action:[:result | result printNewline] |
|
4045 |
initialAnswer:'the default' |
|
4046 |
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
|
4047 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4048 |
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
|
4049 |
|
2444 | 4050 |
Dialog |
4051 |
request:'enter a string:' |
|
4052 |
displayAt:200@200 |
|
4053 |
centered:true |
|
4054 |
action:[:result | result printNewline] |
|
4055 |
initialAnswer:'the default' |
|
4056 |
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
|
4057 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4058 |
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
|
4059 |
|
2444 | 4060 |
Dialog |
4061 |
request:'enter a string:' |
|
4062 |
displayAt:200@200 |
|
4063 |
centered:false |
|
4064 |
action:[:result | result printNewline] |
|
4065 |
initialAnswer:'the default' |
|
4066 |
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
|
4067 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4068 |
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
|
4069 |
|
2444 | 4070 |
Dialog |
4071 |
request:'enter a string:' |
|
4072 |
displayAt:nil |
|
4073 |
centered:false |
|
4074 |
action:[:result | result printNewline] |
|
4075 |
initialAnswer:'the default' |
|
4076 |
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
|
4077 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4078 |
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
|
4079 |
|
2444 | 4080 |
Dialog |
4081 |
request:'enter a string:' |
|
4082 |
displayAt:nil |
|
4083 |
centered:true |
|
4084 |
action:[:result | result printNewline] |
|
4085 |
initialAnswer:'the default' |
|
4086 |
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
|
4087 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4088 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4089 |
"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
|
4090 |
"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
|
4091 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4092 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4093 |
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
|
4094 |
"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
|
4095 |
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
|
4096 |
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
|
4097 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4098 |
^ self |
2439 | 4099 |
request:aString |
4100 |
displayAt:aPoint |
|
4101 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4102 |
action:nil |
|
4103 |
initialAnswer:initial |
|
4093 | 4104 |
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
|
4105 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4106 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4107 |
Dialog |
2439 | 4108 |
request:'enter a string:' |
4109 |
displayAt:(250 @ 250) |
|
4110 |
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
|
4111 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4112 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4113 |
"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
|
4114 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4115 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4116 |
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
|
4117 |
"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
|
4118 |
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
|
4119 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4120 |
^ self |
2439 | 4121 |
request:aString |
4122 |
displayAt:nil |
|
4123 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4124 |
action:nil |
|
2444 | 4125 |
initialAnswer:initial |
4126 |
okLabel:nil |
|
4127 |
cancelLabel:nil |
|
4128 |
title:nil |
|
4093 | 4129 |
onCancel:nil |
2444 | 4130 |
list:nil |
4131 |
initialSelection:nil |
|
4132 |
entryCompletionBlock: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
|
4133 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4134 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4135 |
Dialog |
2439 | 4136 |
request:'enter a string:' |
4137 |
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
|
4138 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4139 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4140 |
"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
|
4141 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4142 |
|
2444 | 4143 |
request:aString initialAnswer:initial entryCompletionBlock:entryCompletionBlock |
4144 |
"launch a Dialog, which allows user to enter something. |
|
4145 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4146 |
||
4147 |
^ self |
|
4148 |
request:aString |
|
4149 |
displayAt:nil |
|
4150 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4151 |
action:nil |
|
4152 |
initialAnswer:initial |
|
4153 |
okLabel:nil |
|
4154 |
cancelLabel:nil |
|
4155 |
title:nil |
|
4093 | 4156 |
onCancel:nil |
2444 | 4157 |
list:nil |
4158 |
initialSelection:nil |
|
4159 |
entryCompletionBlock:entryCompletionBlock |
|
4160 |
||
4161 |
" |
|
4162 |
Dialog |
|
4163 |
request:'enter a selector:' |
|
4164 |
initialAnswer:'at:p' |
|
4165 |
entryCompletionBlock:[:s | |completion| |
|
4166 |
||
4167 |
completion := Smalltalk selectorCompletion:s. |
|
4168 |
completion second size > 1 ifTrue:[ Screen current beep]. |
|
4169 |
completion first |
|
4170 |
]. |
|
4171 |
" |
|
4172 |
||
4173 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4174 |
! |
|
4175 |
||
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4176 |
request:aString initialAnswer:initial initialSelection:anInterval |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4177 |
"launch a Dialog, which allows user to enter something. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4178 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4179 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4180 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4181 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4182 |
displayAt:nil |
2439 | 4183 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4184 |
action:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4185 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4186 |
okLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4187 |
cancelLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4188 |
title:nil |
4093 | 4189 |
onCancel:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4190 |
list:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4191 |
initialSelection:anInterval |
2444 | 4192 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4193 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4194 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4195 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4196 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4197 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4198 |
initialSelection:(1 to:3) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4199 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4200 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4201 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4202 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4203 |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4204 |
request:aString initialAnswer:initial list:aList |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4205 |
"launch a Dialog, which allows user to enter something, |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4206 |
or select from a list of values. |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4207 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4208 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4209 |
^ self |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4210 |
request:aString |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4211 |
displayAt:nil |
2439 | 4212 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4213 |
action:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4214 |
initialAnswer:initial |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4215 |
okLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4216 |
cancelLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4217 |
title:nil |
4093 | 4218 |
onCancel:nil |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4219 |
list:aList |
2444 | 4220 |
initialSelection:nil |
4221 |
entryCompletionBlock:nil |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4222 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4223 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4224 |
Dialog |
2548 | 4225 |
request:'Enter a string:' |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4226 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4227 |
list:#('foo' 'bar' 'baz') |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4228 |
" |
2110 | 4229 |
" |
4230 |
Dialog |
|
4231 |
request:'enter a string:' |
|
4232 |
initialAnswer:'the default' |
|
4233 |
list:((1 to:30) collect:[:i | i printString]) |
|
4234 |
" |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4235 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4236 |
"Modified: / 5.5.1999 / 10:53:45 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4237 |
! |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4238 |
|
2550 | 4239 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString |
4240 |
"launch a Dialog, which allows user to enter something. |
|
4241 |
Return the entered string (may be empty string) |
|
4242 |
or cancelValue (if cancel was pressed)" |
|
4243 |
||
4244 |
^ self |
|
4245 |
request:aString |
|
4246 |
displayAt:nil |
|
4247 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4248 |
action:nil |
|
4249 |
initialAnswer:initial |
|
4250 |
okLabel:okLabel |
|
4251 |
cancelLabel:nil |
|
4252 |
title:titleString |
|
4253 |
onCancel:nil |
|
4254 |
list:nil |
|
4255 |
initialSelection:nil |
|
4256 |
entryCompletionBlock:nil |
|
4257 |
||
4258 |
" |
|
4259 |
Dialog |
|
4260 |
request:'Enter a string:' |
|
4261 |
initialAnswer:'the default' |
|
4262 |
okLabel:'Yes' |
|
4263 |
title:'Only a Test' |
|
4264 |
" |
|
4265 |
||
4266 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4267 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4268 |
! |
|
4269 |
||
2551 | 4270 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString list:list |
4271 |
"launch a Dialog, which allows user to enter something. |
|
4272 |
Return the entered string (may be empty string) |
|
4273 |
or cancelValue (if cancel was pressed)" |
|
4274 |
||
4275 |
^ self |
|
4276 |
request:aString |
|
4277 |
displayAt:nil |
|
4278 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4279 |
action:nil |
|
4280 |
initialAnswer:initial |
|
4281 |
okLabel:okLabel |
|
4282 |
cancelLabel:nil |
|
4283 |
title:titleString |
|
4284 |
onCancel:nil |
|
4285 |
list:list |
|
4286 |
initialSelection:nil |
|
4287 |
entryCompletionBlock:nil |
|
4288 |
||
4289 |
" |
|
4290 |
Dialog |
|
4291 |
request:'Enter or select a string:' |
|
4292 |
initialAnswer:'the default' |
|
4293 |
okLabel:'Yes' |
|
4294 |
title:'Only a Test' |
|
4295 |
list:#('a' 'b' 'c') |
|
4296 |
" |
|
4297 |
||
4298 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4299 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4300 |
! |
|
4301 |
||
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4302 |
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
|
4303 |
"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
|
4304 |
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
|
4305 |
or cancelValue (if cancel was pressed)" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4306 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4307 |
^ self |
2439 | 4308 |
request:aString |
4309 |
displayAt:nil |
|
4310 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4311 |
action:nil |
|
4312 |
initialAnswer:initial |
|
4313 |
okLabel:okLabel |
|
4314 |
cancelLabel:nil |
|
4315 |
title:titleString |
|
4316 |
onCancel:cancelAction |
|
2444 | 4317 |
list:nil |
4318 |
initialSelection:nil |
|
4319 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4320 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4321 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4322 |
Dialog |
2548 | 4323 |
request:'Enter a string:' |
2439 | 4324 |
initialAnswer:'the default' |
4325 |
onCancel:['foooo'] |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4326 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4327 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4328 |
"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
|
4329 |
"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
|
4330 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4331 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4332 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices |
2548 | 4333 |
"launch a Dialog, which allows user to enter something |
4334 |
(with a list of choices for fast input). |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4335 |
Return the entered string (may be empty string) |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4336 |
or cancelValue (if cancel was pressed)" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4337 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4338 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4339 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4340 |
displayAt:nil |
2439 | 4341 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4342 |
action:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4343 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4344 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4345 |
cancelLabel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4346 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4347 |
onCancel:cancelAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4348 |
list:listOfChoices |
2444 | 4349 |
initialSelection:nil |
4350 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4351 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4352 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4353 |
Dialog |
2548 | 4354 |
request:'Enter a String:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4355 |
initialAnswer:'the default' |
2548 | 4356 |
okLabel:'OK' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4357 |
title:'demo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4358 |
onCancel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4359 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4360 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4361 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4362 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4363 |
"Created: 29.5.1996 / 14:59:57 / cg" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4364 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4365 |
|
2517 | 4366 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices entryCompletionBlock:entryCompletionBlock |
2548 | 4367 |
"launch a Dialog, which allows user to enter something |
4368 |
(with a list of choices for fast input). |
|
2517 | 4369 |
Return the entered string (may be empty string) |
4370 |
or cancelValue (if cancel was pressed)" |
|
4371 |
||
4372 |
^ self |
|
4373 |
request:aString |
|
4374 |
displayAt:nil |
|
4375 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4376 |
action:nil |
|
4377 |
initialAnswer:initial |
|
4378 |
okLabel:okLabel |
|
4379 |
cancelLabel:nil |
|
4380 |
title:titleString |
|
4381 |
onCancel:cancelAction |
|
4382 |
list:listOfChoices |
|
4383 |
initialSelection:nil |
|
4384 |
entryCompletionBlock:entryCompletionBlock |
|
4385 |
||
4386 |
" |
|
4387 |
Dialog |
|
2548 | 4388 |
request:'Enter a String:' |
2517 | 4389 |
initialAnswer:'the default' |
2548 | 4390 |
okLabel:'OK' |
2517 | 4391 |
title:'demo' |
4392 |
onCancel:nil |
|
4393 |
list:#('foo' 'bar' 'baz') |
|
4394 |
" |
|
4395 |
||
4396 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4397 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4398 |
! |
|
4399 |
||
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
|
4400 |
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
|
4401 |
"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
|
4402 |
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
|
4403 |
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
|
4404 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4405 |
^ self |
2439 | 4406 |
request:aString |
4407 |
displayAt:nil |
|
4408 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4409 |
action:nil |
|
4410 |
initialAnswer:initial |
|
2444 | 4411 |
okLabel:nil |
4412 |
cancelLabel:nil |
|
4413 |
title:nil |
|
2439 | 4414 |
onCancel:cancelAction |
2444 | 4415 |
list:nil |
4416 |
initialSelection:nil |
|
4417 |
entryCompletionBlock: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
|
4418 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4419 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4420 |
Dialog |
2439 | 4421 |
request:'enter a string:' |
4422 |
initialAnswer:'the default' |
|
4423 |
onCancel:['foooo'] |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4424 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4425 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4426 |
"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
|
4427 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4428 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4429 |
request:aString list:listOfChoices |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4430 |
"launch a Dialog, which allows user to enter something, |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4431 |
but adds a list of choices for fast input. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4432 |
Return the entered string (may be empty string) |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4433 |
or the empty string (if cancel was pressed)" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4434 |
|
4302 | 4435 |
^ self request:aString list:listOfChoices initialAnswer:'' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4436 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4437 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4438 |
Dialog |
2548 | 4439 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4440 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4441 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4442 |
|
4302 | 4443 |
"Modified: / 18-08-2011 / 19:29:28 / cg" |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4444 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4445 |
|
4301
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4446 |
request:aString list:listOfChoices initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4447 |
"launch a Dialog, which allows user to enter something, |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4448 |
but adds a list of choices for fast input. |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4449 |
Return the entered string (may be empty string) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4450 |
or the empty string (if cancel was pressed)" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4451 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4452 |
^ self |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4453 |
request:aString |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4454 |
displayAt:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4455 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4456 |
action:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4457 |
initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4458 |
okLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4459 |
cancelLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4460 |
title:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4461 |
onCancel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4462 |
list:listOfChoices |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4463 |
initialSelection:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4464 |
entryCompletionBlock:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4465 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4466 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4467 |
Dialog |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4468 |
request:'Enter a string:' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4469 |
list:#('foo' 'bar' 'baz') |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4470 |
initialAnswer:'foe' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4471 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4472 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4473 |
"Modified: / 29-05-1996 / 14:26:25 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4474 |
"Created: / 18-08-2011 / 19:28:13 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4475 |
! |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4476 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4477 |
request:aString okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4478 |
"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
|
4479 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4480 |
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
|
4481 |
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
|
4482 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4483 |
^ self |
2439 | 4484 |
request:aString |
4485 |
displayAt:nil |
|
4486 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4487 |
action:nil |
|
4488 |
initialAnswer:'' |
|
4489 |
okLabel:okLabel |
|
4490 |
cancelLabel:nil |
|
2444 | 4491 |
title:nil |
4492 |
onCancel:nil |
|
4493 |
list:nil |
|
4494 |
initialSelection:nil |
|
4495 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4496 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4497 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4498 |
Dialog |
2548 | 4499 |
request:'Enter a string:' |
4500 |
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
|
4501 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4502 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4503 |
"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
|
4504 |
"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
|
4505 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4506 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4507 |
request:aString okLabel:okLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4508 |
"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
|
4509 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4510 |
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
|
4511 |
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
|
4512 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4513 |
^ self |
2439 | 4514 |
request:aString |
4515 |
displayAt:nil |
|
4516 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4517 |
action:nil |
|
4518 |
initialAnswer:'' |
|
4519 |
okLabel:okLabel |
|
4520 |
cancelLabel:nil |
|
2444 | 4521 |
title:nil |
2439 | 4522 |
onCancel:cancelValue |
2444 | 4523 |
list:nil |
4524 |
initialSelection:nil |
|
4525 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4526 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4527 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4528 |
Dialog |
2548 | 4529 |
request:'Enter a string:' |
4530 |
okLabel:'Yes' |
|
2439 | 4531 |
onCancel:nil |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4532 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4533 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4534 |
"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
|
4535 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4536 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4537 |
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
|
4538 |
"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
|
4539 |
The okButton is labelled as okLabel. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4540 |
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
|
4541 |
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
|
4542 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4543 |
^ self |
2439 | 4544 |
request:aString |
4545 |
displayAt:nil |
|
4546 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4547 |
action:nil |
|
4548 |
initialAnswer:'' |
|
4549 |
okLabel:okLabel |
|
4550 |
cancelLabel:nil |
|
4551 |
title:titleString |
|
4552 |
onCancel:cancelValue |
|
2444 | 4553 |
list:nil |
4554 |
initialSelection:nil |
|
4555 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4556 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4557 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4558 |
Dialog |
2548 | 4559 |
request:'Enter a String:' |
4560 |
okLabel:'Yes' |
|
2439 | 4561 |
title:'foo' |
4562 |
onCancel:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4563 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4564 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4565 |
"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
|
4566 |
"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
|
4567 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4568 |
|
2360 | 4569 |
request:aString onCancel:cancelActionOrValue |
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
|
4570 |
"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
|
4571 |
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
|
4572 |
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
|
4573 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4574 |
^ self |
2360 | 4575 |
request:aString |
4576 |
displayAt:nil |
|
2439 | 4577 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2360 | 4578 |
action:nil |
4579 |
initialAnswer:'' |
|
2444 | 4580 |
okLabel:nil |
4581 |
cancelLabel:nil |
|
4582 |
title:nil |
|
2360 | 4583 |
onCancel:cancelActionOrValue |
2444 | 4584 |
list:nil |
4585 |
initialSelection:nil |
|
4586 |
entryCompletionBlock: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
|
4587 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4588 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4589 |
Dialog |
2548 | 4590 |
request:'Enter a String:' |
2360 | 4591 |
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
|
4592 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4593 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4594 |
"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
|
4595 |
"Modified: 29.5.1996 / 14:28:59 / cg" |
100 | 4596 |
! |
4597 |
||
2718 | 4598 |
request:aString title:titleString initialAnswer:initial |
4599 |
"launch a Dialog, which allows user to enter something. |
|
4600 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4601 |
||
4602 |
^ self |
|
4603 |
request:aString |
|
4604 |
displayAt:nil |
|
4605 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4606 |
action:nil |
|
4607 |
initialAnswer:initial |
|
4608 |
okLabel:nil |
|
4609 |
cancelLabel:nil |
|
4610 |
title:titleString |
|
4093 | 4611 |
onCancel:nil |
2718 | 4612 |
list:nil |
4613 |
initialSelection:nil |
|
4614 |
entryCompletionBlock:nil |
|
4615 |
||
4616 |
" |
|
4617 |
Dialog |
|
4618 |
request:'enter a string:' |
|
4619 |
initialAnswer:'the default' |
|
4620 |
" |
|
4621 |
||
4622 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4623 |
! |
|
4624 |
||
3152 | 4625 |
requestNumber:aString |
4626 |
"launch a Dialog, which allows user to enter a number. |
|
4627 |
Return the numeric value or nil |
|
4628 |
(for an invalid number or if cancel was pressed)" |
|
4629 |
||
4630 |
|string| |
|
4631 |
||
4632 |
string := self request:aString. |
|
4633 |
^ Number readFrom:string onError:nil. |
|
4634 |
||
4635 |
" |
|
4636 |
Dialog requestNumber:'Enter your Age:' |
|
4637 |
" |
|
4638 |
||
4639 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
4640 |
! |
|
4641 |
||
3321 | 4642 |
requestNumber:aString initialAnswer: aNumber |
4643 |
"launch a Dialog, which allows user to enter a number. |
|
4644 |
Return the numeric value or nil |
|
4645 |
(for an invalid number or if cancel was pressed)" |
|
4646 |
||
4647 |
|string| |
|
4648 |
||
4649 |
string := self request:aString initialAnswer: aNumber. |
|
4650 |
^ Number readFrom:string onError:nil. |
|
4651 |
||
4652 |
" |
|
4653 |
Dialog requestNumber:'Enter your Age:' initialAnswer: 25 |
|
4654 |
" |
|
4655 |
||
4656 |
"Created: / 26-07-2006 / 12:22:23 / fm" |
|
4657 |
"Modified: / 07-08-2006 / 15:31:30 / fm" |
|
4658 |
! |
|
4659 |
||
197 | 4660 |
requestPassword:aString |
4661 |
"launch a Dialog, which allows user to enter something invisibly. |
|
4662 |
Return the entered string (may be empty string) |
|
4663 |
or nil (if cancel was pressed)" |
|
100 | 4664 |
|
197 | 4665 |
^ EnterBox requestPassword:aString |
133 | 4666 |
|
4667 |
" |
|
4668 |
Dialog |
|
2548 | 4669 |
requestPassword:'Enter Secret:' |
133 | 4670 |
" |
197 | 4671 |
|
4672 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
2014 | 4673 |
! |
4674 |
||
4139 | 4675 |
requestText:title |
4676 |
"open a dialog asking for multiline text. |
|
4677 |
Return a stringCollection or nil if cancelled." |
|
4678 |
||
4679 |
^ self |
|
4680 |
requestText:title lines:10 columns:40 initialAnswer:'' |
|
4681 |
||
4682 |
" |
|
4683 |
Dialog requestText:'Bla' |
|
4684 |
" |
|
4685 |
! |
|
4686 |
||
4687 |
requestText:title initialAnswer:initialAnswer |
|
4688 |
"open a dialog asking for multiline text. |
|
4689 |
Return a stringCollection or nil if cancelled." |
|
4690 |
||
4691 |
^ self |
|
4692 |
requestText:title lines:10 columns:40 initialAnswer:initialAnswer |
|
4693 |
||
4694 |
" |
|
4695 |
Dialog requestText:'Bla' initialAnswer:'Hello world' |
|
4696 |
" |
|
4697 |
! |
|
4698 |
||
2014 | 4699 |
requestText:title lines:numLines columns:numCols initialAnswer:initialText |
4700 |
"open a dialog asking for multiline text. |
|
4701 |
Return a stringCollection or nil if cancelled." |
|
4702 |
||
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4703 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4704 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4705 |
textHolder := ValueHolder new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4706 |
dialog := Dialog forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textHolder. |
2014 | 4707 |
dialog open. |
4708 |
dialog accepted ifTrue:[ |
|
2675 | 4709 |
^ textHolder value |
2014 | 4710 |
]. |
4711 |
^ nil |
|
4712 |
||
2675 | 4713 |
" |
4714 |
Dialog requestText:'Bla' lines:8 columns:40 initialAnswer:'hello world' |
|
4715 |
" |
|
4716 |
||
4717 |
"Modified: / 18.8.2000 / 21:45:41 / 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
|
4718 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4719 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
4720 |
!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
|
4721 |
|
3234 | 4722 |
choose:aString fromList:list lines:maxLines |
4723 |
"launch a Dialog showing the message and list. |
|
4724 |
The user can select an item and click ok; in this case, the corresponding value |
|
4725 |
from listValues is returned (doubleclick works as well). |
|
4726 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4727 |
Pressing ok without a selection is treated like cancel." |
|
4728 |
||
4729 |
^ self |
|
4730 |
choose:aString |
|
3455 | 4731 |
fromList:(list collect:[:each| each printString]) values:list |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4732 |
initialSelection:nil |
3455 | 4733 |
buttons:nil values:nil |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4734 |
default:nil |
3234 | 4735 |
lines:maxLines |
4736 |
cancel:nil |
|
4737 |
multiple:false |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4738 |
title:nil |
3234 | 4739 |
postBuildBlock:nil |
4740 |
||
4741 |
" |
|
4742 |
Transcript showCR:( |
|
4743 |
Dialog |
|
4744 |
choose:'choose any' |
|
4745 |
fromList:#(1 2 3 4 5 6 7) |
|
4746 |
lines:4 |
|
4747 |
) |
|
4748 |
" |
|
4749 |
||
3455 | 4750 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
3234 | 4751 |
! |
4752 |
||
3307 | 4753 |
choose:aString fromList:list lines:maxLines initialSelection:initialSelection |
4754 |
"launch a Dialog showing the message and list. |
|
4755 |
The user can select an item and click ok; in this case, the corresponding value |
|
4756 |
from listValues is returned (doubleclick works as well). |
|
4757 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4758 |
Pressing ok without a selection is treated like cancel." |
|
4759 |
||
4760 |
^ self |
|
4761 |
choose:aString |
|
4762 |
fromList:list values:list initialSelection:initialSelection |
|
4763 |
buttons:nil values:nil |
|
4764 |
lines:maxLines |
|
4765 |
cancel:nil |
|
4766 |
multiple:false |
|
4767 |
postBuildBlock:nil |
|
4768 |
||
4769 |
" |
|
4770 |
Transcript showCR:( |
|
4771 |
Dialog |
|
4772 |
choose:'choose any' |
|
4773 |
fromList:#(1 2 3 4 5 6 7) |
|
4774 |
lines:4 |
|
4775 |
initialSelection:4 |
|
4776 |
) |
|
4777 |
" |
|
4778 |
||
4779 |
"Modified: 27.1.1996 / 14:17:07 / cg" |
|
4780 |
! |
|
4781 |
||
3455 | 4782 |
choose:aString fromList:list lines:maxLines initialSelection:initialSelection title:windowTitle |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4783 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4784 |
The user can select an item and click ok; in this case, the corresponding value |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4785 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4786 |
If cancel is pressed, the value of cancelBlock is returned. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4787 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4788 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4789 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4790 |
choose:aString |
3455 | 4791 |
fromList:(list collect:[:each| each printString]) values:list |
4792 |
initialSelection:initialSelection |
|
4793 |
buttons:nil values:nil |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4794 |
default:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4795 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4796 |
cancel:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4797 |
multiple:false |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4798 |
title:windowTitle |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4799 |
postBuildBlock:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4800 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4801 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4802 |
Transcript showCR:( |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4803 |
Dialog |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4804 |
choose:'choose any' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4805 |
fromList:#(1 2 3 4 5 6 7) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4806 |
lines:4 |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4807 |
title:'Choose' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4808 |
) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4809 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4810 |
|
3455 | 4811 |
"Created: / 02-03-2007 / 12:06:39 / cg" |
4812 |
! |
|
4813 |
||
4814 |
choose:aString fromList:list lines:maxLines title:windowTitle |
|
4815 |
"launch a Dialog showing the message and list. |
|
4816 |
The user can select an item and click ok; in this case, the corresponding value |
|
4817 |
from listValues is returned (doubleclick works as well). |
|
4818 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4819 |
Pressing ok without a selection is treated like cancel." |
|
4820 |
||
4821 |
^ self |
|
4822 |
choose:aString |
|
4823 |
fromList:(list collect:[:each| each printString]) values:list |
|
4824 |
initialSelection:nil |
|
4825 |
buttons:nil values:nil |
|
4826 |
default:nil |
|
4827 |
lines:maxLines |
|
4828 |
cancel:nil |
|
4829 |
multiple:false |
|
4830 |
title:windowTitle |
|
4831 |
postBuildBlock:nil |
|
4832 |
||
4833 |
" |
|
4834 |
Transcript showCR:( |
|
4835 |
Dialog |
|
4836 |
choose:'choose any' |
|
4837 |
fromList:#(1 2 3 4 5 6 7) |
|
4838 |
lines:4 |
|
4839 |
title:'Choose' |
|
4840 |
) |
|
4841 |
" |
|
4842 |
||
4843 |
"Modified: / 02-03-2007 / 12:08:20 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4844 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4845 |
|
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
|
4846 |
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
|
4847 |
"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
|
4848 |
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
|
4849 |
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
|
4850 |
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
|
4851 |
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
|
4852 |
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
|
4853 |
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
|
4854 |
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
|
4855 |
|
2111 | 4856 |
^ self |
4857 |
choose:aString |
|
3455 | 4858 |
fromList:list values:listValues |
4859 |
buttons:buttonLabels values:buttonValues |
|
2111 | 4860 |
lines:maxLines |
4861 |
cancel:cancelBlock |
|
4862 |
multiple:false |
|
4863 |
||
4864 |
" |
|
4865 |
full example: |
|
4866 |
||
4867 |
Transcript showCR:( |
|
4868 |
Dialog |
|
4869 |
choose:'choose any' |
|
4870 |
fromList:#('one' 'two' 'three' 'four') |
|
4871 |
values:#(1 2 3 4) |
|
4872 |
buttons:#('five' 'six' 'seven') |
|
4873 |
values:#(5 6 7) |
|
4874 |
lines:10 |
|
4875 |
cancel:nil |
|
4876 |
) |
|
4877 |
||
4878 |
||
4879 |
no buttons: |
|
4880 |
||
4881 |
Transcript showCR:( |
|
4882 |
Dialog |
|
4883 |
choose:'choose any' |
|
4884 |
fromList:#('one' 'two' 'three' 'four') |
|
4885 |
values:#(1 2 3 4) |
|
4886 |
buttons:nil |
|
4887 |
values:nil |
|
4888 |
lines:4 |
|
4889 |
cancel:nil |
|
4890 |
) |
|
4891 |
||
4892 |
||
4893 |
no list (lines argument is ignored): |
|
4894 |
||
4895 |
Transcript showCR:( |
|
4896 |
Dialog |
|
4897 |
choose:'choose any' |
|
4898 |
fromList:nil |
|
4899 |
values:nil |
|
4900 |
buttons:#('one' 'two' 'three' 'four') |
|
4901 |
values:#(1 2 3 4) |
|
4902 |
lines:nil |
|
4903 |
cancel:nil |
|
4904 |
) |
|
4905 |
||
4906 |
||
4907 |
full including cancel value: |
|
4908 |
||
4909 |
Transcript showCR:( |
|
4910 |
Dialog |
|
4911 |
choose:'choose example' |
|
4912 |
fromList:#('one' 'two' 'three' 'four') |
|
4913 |
values:#(1 2 3 4) |
|
4914 |
buttons:#('five' 'six' 'seven') |
|
4915 |
values:#(5 6 7) |
|
4916 |
lines:4 |
|
4917 |
cancel:[Transcript flash. #aborted] |
|
4918 |
) |
|
4919 |
||
4920 |
||
4921 |
degenerated: |
|
4922 |
||
4923 |
Transcript showCR:( |
|
4924 |
Dialog |
|
4925 |
choose:'choose any' |
|
4926 |
fromList:nil |
|
4927 |
values:nil |
|
4928 |
buttons:nil |
|
4929 |
values:nil |
|
4930 |
lines:nil |
|
4931 |
cancel:nil |
|
4932 |
) |
|
4933 |
||
4934 |
||
4935 |
" |
|
4936 |
||
3455 | 4937 |
"Modified: / 02-03-2007 / 12:08:12 / cg" |
2111 | 4938 |
! |
4939 |
||
4940 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple |
|
4941 |
"launch a Dialog showing the message and list. |
|
4942 |
The user can select an item and click ok; in this case, the corresponding value |
|
4943 |
from listValues is returned (doubleclick works as well). |
|
4944 |
The list may be suppressed (if the list arg is nil). |
|
4945 |
If a list is present, multiple controls if multiple selections are allowed. |
|
4946 |
Below the list, an optional row of buttons is shown, which can also be |
|
4947 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
4948 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4949 |
Pressing ok without a selection is treated like cancel." |
|
4950 |
||
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4951 |
^ self |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4952 |
choose:aString |
3455 | 4953 |
fromList:list values:listValues |
4954 |
buttons:buttonLabels values:buttonValues |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4955 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4956 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4957 |
multiple:multiple |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4958 |
postBuildBlock:nil |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4959 |
|
3455 | 4960 |
"Modified: / 02-03-2007 / 12:08:06 / cg" |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4961 |
! |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4962 |
|
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4963 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4964 |
"launch a Dialog showing the message and list. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4965 |
The user can select an item and click ok; in this case, the corresponding value |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4966 |
from listValues is returned (doubleclick works as well). |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4967 |
The list may be suppressed (if the list arg is nil). |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4968 |
If a list is present, multiple controls if multiple selections are allowed. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4969 |
Below the list, an optional row of buttons is shown, which can also be |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4970 |
clicked upon, and a corresponding value from buttonValues is returned. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4971 |
If cancel is pressed, the value of cancelBlock is returned. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4972 |
Pressing ok without a selection is treated like cancel." |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4973 |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4974 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4975 |
choose:aString |
3455 | 4976 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4977 |
initialSelection:nil |
3455 | 4978 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4979 |
default:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4980 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4981 |
cancel:cancelBlock |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4982 |
multiple:multiple |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4983 |
title:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4984 |
postBuildBlock:aBlockOrNil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4985 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4986 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4987 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4988 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4989 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4990 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4991 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4992 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4993 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4994 |
buttons:#('five' 'six' 'seven') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4995 |
values:#(5 6 7) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4996 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4997 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4998 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4999 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5000 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5001 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5002 |
no buttons: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5003 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5004 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5005 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5006 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5007 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5008 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5009 |
buttons:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5010 |
values:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5011 |
lines:4 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5012 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5013 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5014 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5015 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5016 |
|
3455 | 5017 |
"Modified: / 02-03-2007 / 12:08:02 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5018 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5019 |
|
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5020 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock postBuildBlock:postBuildBlock |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5021 |
"launch a Dialog showing the message and list. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5022 |
The user can select an item and click ok; in this case, the corresponding value |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5023 |
from listValues is returned (doubleclick works as well). |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5024 |
The list may be suppressed (if the list arg is nil). |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5025 |
Below the list, an optional row of buttons is shown, which can also be |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5026 |
clicked upon, and a corresponding value from buttonValues is returned. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5027 |
If cancel is pressed, the value of cancelBlock is returned. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5028 |
Pressing ok without a selection is treated like cancel." |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5029 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5030 |
^ self |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5031 |
choose:aString |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5032 |
fromList:list values:listValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5033 |
buttons:buttonLabels values:buttonValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5034 |
lines:maxLines |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5035 |
cancel:cancelBlock |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5036 |
multiple:false |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5037 |
postBuildBlock:postBuildBlock. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5038 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5039 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5040 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5041 |
full example: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5042 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5043 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5044 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5045 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5046 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5047 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5048 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5049 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5050 |
lines:10 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5051 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5052 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5053 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5054 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5055 |
no buttons: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5056 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5057 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5058 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5059 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5060 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5061 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5062 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5063 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5064 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5065 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5066 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5067 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5068 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5069 |
no list (lines argument is ignored): |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5070 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5071 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5072 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5073 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5074 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5075 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5076 |
buttons:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5077 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5078 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5079 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5080 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5081 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5082 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5083 |
full including cancel value: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5084 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5085 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5086 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5087 |
choose:'choose example' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5088 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5089 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5090 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5091 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5092 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5093 |
cancel:[Transcript flash. #aborted] |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5094 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5095 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5096 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5097 |
degenerated: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5098 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5099 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5100 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5101 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5102 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5103 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5104 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5105 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5106 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5107 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5108 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5109 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5110 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5111 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5112 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5113 |
"Modified: / 02-03-2007 / 12:08:12 / cg" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5114 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5115 |
|
3340 | 5116 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues default:defaultValue lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5117 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5118 |
The user can select an item and click ok; in this case, the corresponding value |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5119 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5120 |
The list may be suppressed (if the list arg is nil). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5121 |
If a list is present, multiple controls if multiple selections are allowed. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5122 |
Below the list, an optional row of buttons is shown, which can also be |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5123 |
clicked upon, and a corresponding value from buttonValues is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5124 |
If cancel is pressed, the value of cancelBlock is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5125 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5126 |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5127 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5128 |
choose:aString |
3455 | 5129 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5130 |
initialSelection:initialListSelectionOrNil |
3455 | 5131 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5132 |
default:defaultValue |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5133 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5134 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5135 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5136 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5137 |
postBuildBlock:aBlockOrNil |
3455 | 5138 |
|
5139 |
"Modified: / 02-03-2007 / 12:07:57 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5140 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5141 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5142 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues default:defaultValue lines:maxLines cancel:cancelBlock multiple:multiple title:windowTitle postBuildBlock:aBlockOrNil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5143 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5144 |
The user can select an item and click ok; in this case, the corresponding value |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5145 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5146 |
The list may be suppressed (if the list arg is nil). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5147 |
If a list is present, multiple controls if multiple selections are allowed. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5148 |
Below the list, an optional row of buttons is shown, which can also be |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5149 |
clicked upon, and a corresponding value from buttonValues is returned. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5150 |
If cancel is pressed, the value of cancelBlock is returned. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5151 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5152 |
|
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5153 |
^ self |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5154 |
choose:aString |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5155 |
fromList:list values:listValues |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5156 |
initialSelection:initialListSelectionOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5157 |
buttons:buttonLabels values:buttonValues |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5158 |
default:defaultValue |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5159 |
lines:maxLines width:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5160 |
cancel:cancelBlock |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5161 |
multiple:multiple |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5162 |
title:windowTitle |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5163 |
postBuildBlock:aBlockOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5164 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5165 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5166 |
full example: |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5167 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5168 |
Transcript showCR:( |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5169 |
Dialog |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5170 |
choose:'choose any' |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5171 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5172 |
initialSelection: nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5173 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5174 |
default:6 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5175 |
lines:10 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5176 |
cancel:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5177 |
multiple:true |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5178 |
postBuildBlock:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5179 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5180 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5181 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5182 |
no buttons: |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5183 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5184 |
Transcript showCR:( |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5185 |
Dialog |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5186 |
choose:'choose any' |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5187 |
fromList:#('one' 'two' 'three' 'four') |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5188 |
values:#(1 2 3 4) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5189 |
buttons:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5190 |
values:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5191 |
lines:4 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5192 |
cancel:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5193 |
multiple:true |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5194 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5195 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5196 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5197 |
"Created: / 22-08-2006 / 16:10:19 / cg" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5198 |
! |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5199 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5200 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues default:defaultValue lines:maxLines width:boxWidthOrNil cancel:cancelBlock multiple:multiple title:windowTitle postBuildBlock:aBlockOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5201 |
"launch a Dialog showing the message and list. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5202 |
The user can select an item and click ok; in this case, the corresponding value |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5203 |
from listValues is returned (doubleclick works as well). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5204 |
The list may be suppressed (if the list arg is nil). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5205 |
If a list is present, multiple controls if multiple selections are allowed. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5206 |
Below the list, an optional row of buttons is shown, which can also be |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5207 |
clicked upon, and a corresponding value from buttonValues is returned. |
4332
ca24b6bb63b5
comment/format in: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4331
diff
changeset
|
5208 |
The buttonValue may be a block of up to 3 arguments; it gets the selection, the box and selIndices as args. |
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5209 |
If cancel is pressed, the value of cancelBlock is returned. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5210 |
Pressing ok without a selection is treated like cancel." |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5211 |
|
3469 | 5212 |
|box listView panel sel haveDefault| |
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
|
5213 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5214 |
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
|
5215 |
(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
|
5216 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5217 |
list notNil ifTrue:[ |
4137
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5218 |
listView := HVScrollableView for:SelectionInListView. |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5219 |
listView autoHideScrollBars:true. |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5220 |
"/ maxLines <= list size ifTrue:[ |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5221 |
"/ listView := HVScrollableView for:SelectionInListView. |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5222 |
"/ ] ifFalse:[ |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5223 |
"/ listView := SelectionInListView new. |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5224 |
"/ listView level:-1. |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5225 |
"/ ]. |
2111 | 5226 |
listView list:list. |
2116 | 5227 |
listView doubleClickAction:[:selectionIndex | |
2111 | 5228 |
|val| |
5229 |
||
2116 | 5230 |
multiple ifTrue:[ |
5231 |
val := selectionIndex collect:[:idx | listValues at:idx]. |
|
5232 |
] ifFalse:[ |
|
5233 |
val := listValues at:selectionIndex. |
|
5234 |
]. |
|
2111 | 5235 |
box destroy. |
5236 |
^ val |
|
5237 |
]. |
|
5238 |
listView multipleSelectOk:multiple. |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5239 |
initialListSelectionOrNil notNil ifTrue:[ |
3005 | 5240 |
multiple ifTrue:[ |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5241 |
listView selection:(initialListSelectionOrNil collect:[:each| listValues indexOf:each]) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5242 |
] ifFalse:[ |
3005 | 5243 |
listView selection:(listValues indexOf:initialListSelectionOrNil) |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5244 |
] |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5245 |
]. |
2111 | 5246 |
box addComponent:listView indent:(ViewSpacing // 2) withHeight:(listView heightForLines:maxLines). |
5247 |
box makeTabable:listView. |
|
3340 | 5248 |
box name:listView as:#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
|
5249 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5250 |
|
2112 | 5251 |
buttonLabels size > 0 ifTrue:[ |
2111 | 5252 |
panel := HorizontalPanelView new. |
5253 |
panel horizontalLayout:#fitSpace. |
|
3340 | 5254 |
haveDefault := false. |
2111 | 5255 |
buttonLabels keysAndValuesDo:[:index :label | |
5256 |
|b| |
|
5257 |
||
5258 |
b := Button label:label. |
|
5259 |
b action:[ |
|
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5260 |
|val selectionValues| |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5261 |
|
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5262 |
selectionValues := listValues isNil |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5263 |
ifTrue:[ listView selection ] |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5264 |
ifFalse:[ listView selection collect:[:idx | listValues at:idx]]. |
2111 | 5265 |
val := buttonValues at:index. |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5266 |
val isBlock ifTrue:[ |
4331
ee5133add66d
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4330
diff
changeset
|
5267 |
val := val valueWithOptionalArgument:selectionValues and:box and:listView selection |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5268 |
] ifFalse:[ |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5269 |
multiple ifTrue:[ |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5270 |
val := Array with:val |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5271 |
]. |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5272 |
]. |
2111 | 5273 |
box destroy. |
5274 |
^ val |
|
5275 |
]. |
|
3340 | 5276 |
haveDefault ifFalse:[ |
5277 |
defaultValue notNil ifTrue:[ |
|
5278 |
(buttonValues at:index) = defaultValue ifTrue:[ |
|
5279 |
b isReturnButton:true. |
|
5280 |
haveDefault := true. |
|
5281 |
]. |
|
5282 |
]. |
|
5283 |
]. |
|
2111 | 5284 |
panel add:b. |
5285 |
box makeTabable:b. |
|
5286 |
]. |
|
5287 |
box addComponent:panel indent:0. "/ panel has its own idea of indenting |
|
3340 | 5288 |
box name:panel as:#ButtonPanel2. |
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
|
5289 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5290 |
box addAbortButton. |
3340 | 5291 |
list notNil ifTrue:[ |
5292 |
haveDefault ifTrue:[ |
|
5293 |
(box addOkButton) isReturnButton:false. |
|
5294 |
] ifFalse:[ |
|
5295 |
box addOkButton. |
|
5296 |
]. |
|
5297 |
]. |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5298 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5299 |
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
|
5300 |
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
|
5301 |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5302 |
aBlockOrNil notNil ifTrue:[ |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5303 |
aBlockOrNil value:box |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5304 |
]. |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5305 |
windowTitle notNil ifTrue:[ |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5306 |
box label:windowTitle. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5307 |
]. |
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5308 |
boxWidthOrNil notNil ifTrue:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5309 |
box width:(boxWidthOrNil max:250). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5310 |
] ifFalse:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5311 |
box width < 250 ifTrue:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5312 |
box width:250. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5313 |
] |
4104
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5314 |
]. |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5315 |
|
2439 | 5316 |
self showBox:box. |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5317 |
"/ notice: if one of the extra buttons is pressed, we do not arrive here, and the returned value |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5318 |
"/ is the value returned by the button-value (which might be a block) |
2111 | 5319 |
|
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
|
5320 |
box accepted ifTrue:[ |
2111 | 5321 |
(sel := listView selection) notNil ifTrue:[ |
5322 |
box destroy. |
|
5323 |
sel isInteger ifTrue:[ |
|
5324 |
^ listValues at:sel |
|
3340 | 5325 |
]. |
5326 |
^ sel collect:[:idx | listValues at:idx] |
|
5327 |
]. |
|
5328 |
box destroy. |
|
3536
76d3579362e4
choose:fromList.... returned true if OK was pressed without
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
5329 |
^ nil "/ ^ 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
|
5330 |
]. |
2111 | 5331 |
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
|
5332 |
^ cancelBlock value |
197 | 5333 |
|
5334 |
" |
|
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
|
5335 |
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
|
5336 |
|
2111 | 5337 |
Transcript showCR:( |
5338 |
Dialog |
|
5339 |
choose:'choose any' |
|
3340 | 5340 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
5341 |
initialSelection: nil |
|
5342 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
|
5343 |
default:6 |
|
2111 | 5344 |
lines:10 |
5345 |
cancel:nil |
|
5346 |
multiple:true |
|
3340 | 5347 |
postBuildBlock:nil |
2111 | 5348 |
) |
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
|
5349 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5350 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5351 |
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
|
5352 |
|
2111 | 5353 |
Transcript showCR:( |
5354 |
Dialog |
|
5355 |
choose:'choose any' |
|
5356 |
fromList:#('one' 'two' 'three' 'four') |
|
5357 |
values:#(1 2 3 4) |
|
5358 |
buttons:nil |
|
5359 |
values:nil |
|
5360 |
lines:4 |
|
5361 |
cancel:nil |
|
5362 |
multiple:true |
|
5363 |
) |
|
133 | 5364 |
" |
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
|
5365 |
|
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5366 |
"Created: / 08-11-2011 / 12:15:20 / cg" |
3340 | 5367 |
! |
5368 |
||
5369 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
|
5370 |
"launch a Dialog showing the message and list. |
|
5371 |
The user can select an item and click ok; in this case, the corresponding value |
|
5372 |
from listValues is returned (doubleclick works as well). |
|
5373 |
The list may be suppressed (if the list arg is nil). |
|
5374 |
If a list is present, multiple controls if multiple selections are allowed. |
|
5375 |
Below the list, an optional row of buttons is shown, which can also be |
|
5376 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5377 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5378 |
Pressing ok without a selection is treated like cancel." |
|
5379 |
||
5380 |
^ self |
|
5381 |
choose:aString |
|
3455 | 5382 |
fromList:list values:listValues |
3340 | 5383 |
initialSelection:initialListSelectionOrNil |
3455 | 5384 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5385 |
default:nil |
3340 | 5386 |
lines:maxLines |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5387 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5388 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5389 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5390 |
postBuildBlock:aBlockOrNil |
3340 | 5391 |
|
3455 | 5392 |
"Modified: / 02-03-2007 / 12:07:47 / 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
|
5393 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5394 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5395 |
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
|
5396 |
"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
|
5397 |
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
|
5398 |
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
|
5399 |
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
|
5400 |
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
|
5401 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5402 |
^ self |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5403 |
choose:aString |
3455 | 5404 |
fromList:list values:listValues |
5405 |
buttons:nil values:nil |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5406 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5407 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5408 |
multiple:false |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5409 |
postBuildBlock: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
|
5410 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5411 |
" |
655 | 5412 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5413 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5414 |
choose:'choose any' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5415 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5416 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5417 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5418 |
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
|
5419 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5420 |
|
655 | 5421 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5422 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5423 |
choose:'choose example' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5424 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5425 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5426 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5427 |
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
|
5428 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5429 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5430 |
|
3455 | 5431 |
"Modified: / 02-03-2007 / 12:07:42 / cg" |
5432 |
! |
|
5433 |
||
3630 | 5434 |
choose:aString fromList:list values:values lines:maxLines cancel:cancelBlock title:windowTitle |
5435 |
"launch a Dialog showing the message and list. |
|
5436 |
The user can select an item and click ok; in this case, the corresponding value |
|
5437 |
from listValues is returned (doubleclick works as well). |
|
5438 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5439 |
Pressing ok without a selection is treated like cancel." |
|
5440 |
||
5441 |
^ self |
|
5442 |
choose:aString |
|
5443 |
fromList:list values:values |
|
5444 |
initialSelection:nil |
|
5445 |
buttons:nil values:nil |
|
5446 |
default:nil |
|
5447 |
lines:maxLines |
|
5448 |
cancel:cancelBlock |
|
5449 |
multiple:false |
|
5450 |
title:windowTitle |
|
5451 |
postBuildBlock:nil |
|
5452 |
||
5453 |
" |
|
5454 |
Transcript showCR:( |
|
5455 |
Dialog |
|
5456 |
choose:'choose any' |
|
5457 |
fromList:#(1 2 3 4 5 6 7) |
|
5458 |
lines:4 |
|
5459 |
title:'Choose' |
|
5460 |
) |
|
5461 |
" |
|
5462 |
||
5463 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5464 |
! |
|
5465 |
||
3455 | 5466 |
choose:aString fromList:list values:values lines:maxLines initialSelection:initialSelection title:windowTitle |
5467 |
"launch a Dialog showing the message and list. |
|
5468 |
The user can select an item and click ok; in this case, the corresponding value |
|
5469 |
from listValues is returned (doubleclick works as well). |
|
5470 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5471 |
Pressing ok without a selection is treated like cancel." |
|
5472 |
||
5473 |
^ self |
|
5474 |
choose:aString |
|
5475 |
fromList:list values:values |
|
5476 |
initialSelection:initialSelection |
|
5477 |
buttons:nil values:nil |
|
5478 |
default:nil |
|
5479 |
lines:maxLines |
|
5480 |
cancel:nil |
|
5481 |
multiple:false |
|
5482 |
title:windowTitle |
|
5483 |
postBuildBlock:nil |
|
5484 |
||
5485 |
" |
|
5486 |
Transcript showCR:( |
|
5487 |
Dialog |
|
5488 |
choose:'choose any' |
|
5489 |
fromList:#(1 2 3 4 5 6 7) |
|
5490 |
lines:4 |
|
5491 |
title:'Choose' |
|
5492 |
) |
|
5493 |
" |
|
5494 |
||
5495 |
"Created: / 02-03-2007 / 12:07:32 / 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
|
5496 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5497 |
|
3630 | 5498 |
choose:aString fromList:list values:values lines:maxLines title:windowTitle |
5499 |
"launch a Dialog showing the message and list. |
|
5500 |
The user can select an item and click ok; in this case, the corresponding value |
|
5501 |
from listValues is returned (doubleclick works as well). |
|
5502 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5503 |
Pressing ok without a selection is treated like cancel." |
|
5504 |
||
5505 |
^ self |
|
5506 |
choose:aString |
|
5507 |
fromList:list values:values |
|
5508 |
initialSelection:nil |
|
5509 |
buttons:nil values:nil |
|
5510 |
default:nil |
|
5511 |
lines:maxLines |
|
5512 |
cancel:nil |
|
5513 |
multiple:false |
|
5514 |
title:windowTitle |
|
5515 |
postBuildBlock:nil |
|
5516 |
||
5517 |
" |
|
5518 |
Transcript showCR:( |
|
5519 |
Dialog |
|
5520 |
choose:'choose any' |
|
5521 |
fromList:#(1 2 3 4 5 6 7) |
|
5522 |
lines:4 |
|
5523 |
title:'Choose' |
|
5524 |
) |
|
5525 |
" |
|
5526 |
||
5527 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5528 |
! |
|
5529 |
||
2473 | 5530 |
choose:aString label:windowLabel image:imageOrNil labels:buttonLabels values:values default:default onCancel:cancelValue |
2472 | 5531 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
5532 |
Returning a corresponding value from the values-array. |
|
5533 |
The default entries button is marked as a return button and entering |
|
5534 |
return will choose that value; hitting escape returns 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
|
5535 |
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
|
5536 |
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
|
5537 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5538 |
|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
|
5539 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5540 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
803 | 5541 |
windowLabel notNil ifTrue:[ |
2439 | 5542 |
box label:windowLabel |
803 | 5543 |
]. |
2473 | 5544 |
imageOrNil notNil ifTrue:[ |
5545 |
box image:imageOrNil |
|
5546 |
]. |
|
5547 |
||
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
|
5548 |
box buttonTitles:(self classResources array:buttonLabels) |
2439 | 5549 |
actions:(values collect:[:val | [answer := val]]). |
2472 | 5550 |
answer := 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
|
5551 |
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
|
5552 |
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
|
5553 |
idx ~~ 0 ifTrue:[box defaultButtonIndex:idx]. |
2439 | 5554 |
|
5555 |
self showAndThenDestroyBox:box. |
|
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
|
5556 |
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
|
5557 |
^ 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
|
5558 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5559 |
"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
|
5560 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5561 |
Dialog |
2439 | 5562 |
choose:'choose any' |
2472 | 5563 |
label:'Foo Bar Baz' |
2439 | 5564 |
labels:#('one' 'two' 'three' 'four') |
5565 |
values:#(1 2 3 4) |
|
2472 | 5566 |
default:2 |
5567 |
onCancel:1 |
|
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
|
5568 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5569 |
Dialog |
2439 | 5570 |
choose:'choose any' |
5571 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5572 |
values:#(nil foo bar baz) |
|
5573 |
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
|
5574 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5575 |
Dialog |
2439 | 5576 |
choose:'choose any' |
5577 |
labels:#('one' 'two' 'three' 'four') |
|
5578 |
values:#(1 2 3 4) |
|
5579 |
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
|
5580 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5581 |
|
2473 | 5582 |
"Modified: / 16.11.2001 / 14:55:33 / cg" |
5583 |
"Created: / 16.11.2001 / 15:04:16 / cg" |
|
5584 |
! |
|
5585 |
||
5586 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default |
|
5587 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5588 |
Returning a corresponding value from the values-array. |
|
5589 |
The default entries button is marked as a return button and entering |
|
5590 |
return will choose that value; hitting escape returns nil. |
|
5591 |
For a good userInterface style, we recommend this being the last |
|
5592 |
entry (to make the right-most button the default button)." |
|
5593 |
||
5594 |
^ self |
|
5595 |
choose:aString |
|
3455 | 5596 |
label:windowLabel image:nil |
5597 |
labels:buttonLabels values:values |
|
2473 | 5598 |
default:default |
5599 |
onCancel:nil |
|
5600 |
||
5601 |
"no good style (default button is not the rightmost one) |
|
5602 |
||
5603 |
Dialog |
|
5604 |
choose:'choose any' |
|
5605 |
labels:#('one' 'two' 'three' 'four') |
|
5606 |
values:#(1 2 3 4) |
|
5607 |
default:2 |
|
5608 |
||
5609 |
Dialog |
|
5610 |
choose:'choose any' |
|
5611 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5612 |
values:#(nil foo bar baz) |
|
5613 |
default:#baz |
|
5614 |
||
5615 |
Dialog |
|
5616 |
choose:'choose any' |
|
5617 |
labels:#('one' 'two' 'three' 'four') |
|
5618 |
values:#(1 2 3 4) |
|
5619 |
default:nil |
|
5620 |
" |
|
5621 |
||
3455 | 5622 |
"Created: / 22-07-1996 / 11:44:27 / cg" |
5623 |
"Modified: / 02-03-2007 / 12:09:01 / cg" |
|
2473 | 5624 |
! |
5625 |
||
5626 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default onCancel:cancelValue |
|
5627 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5628 |
Returning a corresponding value from the values-array. |
|
5629 |
The default entries button is marked as a return button and entering |
|
5630 |
return will choose that value; hitting escape returns cancelValue. |
|
5631 |
For a good userInterface style, we recommend this being the last |
|
5632 |
entry (to make the right-most button the default button)." |
|
5633 |
||
5634 |
^ self |
|
3455 | 5635 |
choose:aString |
5636 |
label:windowLabel image:nil |
|
2473 | 5637 |
labels:buttonLabels values:values |
5638 |
default:default onCancel:cancelValue |
|
5639 |
||
5640 |
"no good style (default button is not the rightmost one) |
|
5641 |
||
5642 |
Dialog |
|
5643 |
choose:'choose any' |
|
5644 |
label:'Foo Bar Baz' |
|
5645 |
labels:#('one' 'two' 'three' 'four') |
|
5646 |
values:#(1 2 3 4) |
|
5647 |
default:2 |
|
5648 |
onCancel:1 |
|
5649 |
||
5650 |
Dialog |
|
5651 |
choose:'choose any' |
|
5652 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5653 |
values:#(nil foo bar baz) |
|
5654 |
default:#baz |
|
5655 |
||
5656 |
Dialog |
|
5657 |
choose:'choose any' |
|
5658 |
labels:#('one' 'two' 'three' 'four') |
|
5659 |
values:#(1 2 3 4) |
|
5660 |
default:nil |
|
5661 |
" |
|
5662 |
||
3455 | 5663 |
"Created: / 16-11-2001 / 14:53:55 / cg" |
5664 |
"Modified: / 02-03-2007 / 12:08:44 / cg" |
|
803 | 5665 |
! |
5666 |
||
5667 |
choose:aString labels:buttonLabels values:values default:default |
|
5668 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5669 |
Returning a corresponding value from the values-array. |
|
5670 |
The default entries button is marked as a return button and entering |
|
5671 |
return will choose that value. |
|
5672 |
For a good userInterface style, we recommend this being the last |
|
5673 |
entry (to make the right-most button the default button)." |
|
5674 |
||
5675 |
^ self |
|
2473 | 5676 |
choose:aString |
3455 | 5677 |
label:nil image:nil |
5678 |
labels:buttonLabels values:values |
|
2473 | 5679 |
default:default |
5680 |
onCancel:nil |
|
803 | 5681 |
|
5682 |
||
5683 |
"no good style (default button is not the rightmost one) |
|
5684 |
||
5685 |
Dialog |
|
2473 | 5686 |
choose:'choose any' |
5687 |
labels:#('one' 'two' 'three' 'four') |
|
5688 |
values:#(1 2 3 4) |
|
5689 |
default:2 |
|
803 | 5690 |
|
5691 |
Dialog |
|
2473 | 5692 |
choose:'choose any' |
5693 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5694 |
values:#(nil foo bar baz) |
|
5695 |
default:#baz |
|
803 | 5696 |
|
5697 |
Dialog |
|
2473 | 5698 |
choose:'choose any' |
5699 |
labels:#('one' 'two' 'three' 'four') |
|
5700 |
values:#(1 2 3 4) |
|
5701 |
default:nil |
|
5702 |
" |
|
5703 |
||
3455 | 5704 |
"Modified: / 02-03-2007 / 12:08:55 / cg" |
2111 | 5705 |
! |
5706 |
||
5707 |
chooseMultiple:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock |
|
5708 |
"launch a Dialog showing the message and list. |
|
5709 |
The user can select an item and click ok; in this case, the corresponding value |
|
5710 |
from listValues is returned (doubleclick works as well). |
|
5711 |
The list may be suppressed (if the list arg is nil). |
|
5712 |
Below the list, an optional row of buttons is shown, which can also be |
|
5713 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5714 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5715 |
Pressing ok without a selection is treated like cancel." |
|
5716 |
||
5717 |
^ self |
|
5718 |
choose:aString |
|
3455 | 5719 |
fromList:list values:listValues |
5720 |
buttons:buttonLabels values:buttonValues |
|
2111 | 5721 |
lines:maxLines |
5722 |
cancel:cancelBlock |
|
5723 |
multiple:true |
|
5724 |
||
5725 |
" |
|
5726 |
full example: |
|
5727 |
||
5728 |
Transcript showCR:( |
|
5729 |
Dialog |
|
2112 | 5730 |
chooseMultiple:'choose selected' |
2111 | 5731 |
fromList:#('one' 'two' 'three' 'four') |
5732 |
values:#(1 2 3 4) |
|
5733 |
buttons:nil |
|
5734 |
values:nil |
|
5735 |
lines:10 |
|
5736 |
cancel:nil |
|
5737 |
) |
|
2112 | 5738 |
|
5739 |
Transcript showCR:( |
|
5740 |
Dialog |
|
5741 |
chooseMultiple:'choose selected' |
|
5742 |
fromList:#('one' 'two' 'three' 'four') |
|
5743 |
values:#(1 2 3 4) |
|
5744 |
buttons:#() |
|
5745 |
values:#() |
|
5746 |
lines:10 |
|
5747 |
cancel:nil |
|
5748 |
) |
|
2111 | 5749 |
" |
5750 |
||
3455 | 5751 |
"Modified: / 02-03-2007 / 12:09:10 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5752 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5753 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5754 |
chooseMultiple:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5755 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5756 |
The user can select an item and click ok; in this case, the corresponding value |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5757 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5758 |
The list may be suppressed (if the list arg is nil). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5759 |
Below the list, an optional row of buttons is shown, which can also be |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5760 |
clicked upon, and a corresponding value from buttonValues is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5761 |
If cancel is pressed, the value of cancelBlock is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5762 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5763 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5764 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5765 |
choose:aString |
3455 | 5766 |
fromList:list values:listValues |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5767 |
initialSelection:initialListSelectionOrNil |
3455 | 5768 |
buttons:nil values:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5769 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5770 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5771 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5772 |
postBuildBlock:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5773 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5774 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5775 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5776 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5777 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5778 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5779 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5780 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5781 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5782 |
initialSelection:#(2 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5783 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5784 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5785 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5786 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5787 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5788 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5789 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5790 |
values:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5791 |
initialSelection:#( 'two' 'three') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5792 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5793 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5794 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5795 |
|
3455 | 5796 |
"Created: / 18-08-2000 / 22:38:13 / cg" |
5797 |
"Modified: / 02-03-2007 / 12:09:15 / cg" |
|
100 | 5798 |
! ! |
5799 |
||
2439 | 5800 |
!DialogBox class methodsFor:'private'! |
5801 |
||
5802 |
showAndThenDestroyBox:aBox |
|
5803 |
self showBox:aBox. |
|
5804 |
aBox destroy |
|
5805 |
! |
|
5806 |
||
5807 |
showBox:aBox |
|
2666
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5808 |
|wg v| |
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5809 |
|
2439 | 5810 |
ForceModalBoxesToOpenAtCenter == true ifTrue:[ |
5811 |
aBox showAtCenter. |
|
3888 | 5812 |
^ self. |
5813 |
]. |
|
5814 |
ForceModalBoxesToOpenAtPointer == true ifTrue:[ |
|
5815 |
aBox showAtPointer. |
|
5816 |
^ self. |
|
5817 |
]. |
|
5818 |
||
5819 |
wg := WindowGroup activeGroup. |
|
5820 |
wg isNil ifTrue:[ |
|
5821 |
aBox showAtCenter. |
|
5822 |
^ self. |
|
5823 |
]. |
|
5824 |
wg isModal ifTrue:[ |
|
5825 |
v := wg mainView. |
|
5826 |
v notNil ifTrue:[ |
|
5827 |
aBox showCenteredIn:v. |
|
5828 |
^ self. |
|
5829 |
]. |
|
5830 |
]. |
|
5831 |
||
5832 |
v := wg mainGroup mainView. |
|
5833 |
v isNil ifTrue:[ |
|
5834 |
aBox showAtCenter. |
|
5835 |
^ self. |
|
5836 |
]. |
|
5837 |
||
5838 |
aBox showCenteredIn:v. |
|
2439 | 5839 |
! ! |
5840 |
||
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5841 |
!DialogBox class methodsFor:'queries'! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5842 |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5843 |
defaultOKButtonAtLeft |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5844 |
"somewhat of a kludge: |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5845 |
some viewStyles have ok at left (motif), others at right..." |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5846 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5847 |
^ (StyleSheet at:'dialogBox.okAtLeft' default:false) |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5848 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5849 |
" |
2694 | 5850 |
DialogBox defaultOKButtonAtLeft |
5851 |
" |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5852 |
! |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5853 |
|
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5854 |
defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5855 |
"return a default parent (top-) window for the dialog. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5856 |
Here, the currently active view is returned, if there |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5857 |
is one; otherwise, the first encountered topView is |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5858 |
returned." |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5859 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5860 |
|activeGroup| |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5861 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5862 |
activeGroup := WindowGroup activeGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5863 |
activeGroup isNil ifTrue:[ |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5864 |
"/ mhmh - looks like I am a background process ... |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5865 |
activeGroup := Transcript windowGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5866 |
activeGroup isNil ifTrue:[^ nil]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5867 |
]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5868 |
^ activeGroup topViews first. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5869 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5870 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5871 |
self defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5872 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5873 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5874 |
"Modified: / 16.6.1998 / 12:36:15 / cg" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5875 |
! ! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5876 |
|
2486 | 5877 |
!DialogBox class methodsFor:'smalltalk dialogs'! |
5878 |
||
3276 | 5879 |
requestClass:aString |
5880 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5881 |
Return the entered class or nil (if cancel was pressed). |
|
5882 |
The entryField does classNameCompletion on TAB." |
|
5883 |
||
5884 |
^ self requestClass:aString okLabel:'OK' initialAnswer:nil. |
|
5885 |
||
5886 |
" |
|
5887 |
Dialog |
|
5888 |
requestClass:'Enter a class:' |
|
5889 |
" |
|
5890 |
! |
|
5891 |
||
3282 | 5892 |
requestClass:aString initialAnswer:initialAnswer |
5893 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5894 |
Return the entered class or nil (if cancel was pressed). |
|
5895 |
The entryField does classNameCompletion on TAB." |
|
5896 |
||
5897 |
^ self requestClass:aString okLabel:'OK' initialAnswer:initialAnswer. |
|
5898 |
||
5899 |
" |
|
5900 |
Dialog |
|
5901 |
requestClass:'Enter a class:' |
|
5902 |
initialAnswer:'Array' |
|
5903 |
" |
|
5904 |
! |
|
5905 |
||
3532 | 5906 |
requestClass:aString list:list okLabel:okLabel initialAnswer:initial |
3276 | 5907 |
"launch a Dialog, which allows user to enter an existing classes name. |
5908 |
Return the entered class or nil (if cancel was pressed). |
|
3181 | 5909 |
The entryField does classNameCompletion on TAB." |
5910 |
||
5911 |
|className| |
|
5912 |
||
3532 | 5913 |
className := self requestClassName:aString list:list okLabel:okLabel initialAnswer:initial. |
3276 | 5914 |
className isEmptyOrNil ifTrue:[^ nil]. |
3181 | 5915 |
^ Smalltalk classNamed:className |
5916 |
||
5917 |
" |
|
5918 |
Dialog |
|
3276 | 5919 |
requestClass:'Enter a class:' |
3181 | 5920 |
okLabel:'OK' |
5921 |
initialAnswer:'Arr' |
|
5922 |
" |
|
3532 | 5923 |
|
5924 |
"Created: / 12-01-2008 / 23:02:28 / cg" |
|
5925 |
! |
|
5926 |
||
5927 |
requestClass:aString okLabel:okLabel initialAnswer:initial |
|
5928 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5929 |
Return the entered class or nil (if cancel was pressed). |
|
5930 |
The entryField does classNameCompletion on TAB." |
|
5931 |
||
5932 |
^ self requestClass:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5933 |
||
5934 |
" |
|
5935 |
Dialog |
|
5936 |
requestClass:'Enter a class:' |
|
5937 |
okLabel:'OK' |
|
5938 |
initialAnswer:'Arr' |
|
5939 |
" |
|
5940 |
||
5941 |
"Modified: / 12-01-2008 / 23:02:42 / cg" |
|
5942 |
! |
|
5943 |
||
5944 |
requestClassName:aString list:list okLabel:okLabel initialAnswer:initial |
|
3181 | 5945 |
"launch a Dialog, which allows user to enter a class name. |
5946 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5947 |
The entryField does classNameCompletion on TAB." |
|
5948 |
||
5949 |
^ self |
|
5950 |
request:aString |
|
5951 |
displayAt:nil |
|
5952 |
centered:nil |
|
5953 |
action:nil |
|
5954 |
initialAnswer:initial |
|
5955 |
okLabel:okLabel |
|
5956 |
cancelLabel:nil |
|
5957 |
title:nil |
|
5958 |
onCancel:nil |
|
3532 | 5959 |
list:list |
3181 | 5960 |
initialSelection:nil |
3182 | 5961 |
entryCompletionBlock:DoWhatIMeanSupport classNameEntryCompletionBlock |
3181 | 5962 |
|
5963 |
" |
|
5964 |
Dialog |
|
3532 | 5965 |
requestClassName:'Enter a class:' |
5966 |
list:(Array with:Array with:String with:Point) |
|
5967 |
okLabel:'OK' |
|
5968 |
initialAnswer:'Arr' |
|
5969 |
" |
|
5970 |
||
5971 |
"Created: / 12-01-2008 / 22:58:01 / cg" |
|
5972 |
! |
|
5973 |
||
5974 |
requestClassName:aString okLabel:okLabel initialAnswer:initial |
|
5975 |
"launch a Dialog, which allows user to enter a class name. |
|
5976 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5977 |
The entryField does classNameCompletion on TAB." |
|
5978 |
||
5979 |
^ self requestClassName:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5980 |
||
5981 |
" |
|
5982 |
Dialog |
|
3181 | 5983 |
requestClassName:'enter a class:' |
5984 |
okLabel:'OK' |
|
5985 |
initialAnswer:'Arr' |
|
5986 |
" |
|
3532 | 5987 |
|
5988 |
"Modified: / 12-01-2008 / 22:58:13 / cg" |
|
3181 | 5989 |
! |
5990 |
||
3538 | 5991 |
requestName:title fromList:nameList title:boxTitle initialAnswer:initialTextOrNil |
5992 |
"Ask for a name from a list (used for namespaces and sharedPools)" |
|
5993 |
||
5994 |
|newName box| |
|
5995 |
||
5996 |
box := ListSelectionBox new. |
|
5997 |
box title:title. |
|
5998 |
box list:nameList. |
|
5999 |
box okAction:[:sel | newName := sel]. |
|
6000 |
box initialText:initialTextOrNil. |
|
6001 |
boxTitle notNil ifTrue:[ box label:boxTitle ]. |
|
6002 |
box showAtPointer. |
|
6003 |
||
6004 |
newName notNil ifTrue:[ |
|
6005 |
newName := newName withoutSeparators. |
|
6006 |
]. |
|
6007 |
^ newName |
|
6008 |
||
6009 |
" |
|
6010 |
Dialog |
|
6011 |
requestName:'Select a Name' |
|
6012 |
fromList:#('foo' 'bar' 'baz') |
|
6013 |
title:'blabla' |
|
6014 |
initialAnswer:nil |
|
6015 |
" |
|
6016 |
! |
|
6017 |
||
2486 | 6018 |
requestNameSpace:title initialAnswer:initialTextOrNil |
6019 |
"Ask for a namespaces name" |
|
6020 |
||
2996 | 6021 |
^ self |
6022 |
requestNameSpace:title |
|
3538 | 6023 |
title:title |
2996 | 6024 |
initialAnswer:initialTextOrNil |
6025 |
||
6026 |
" |
|
3538 | 6027 |
Dialog |
6028 |
requestNameSpace:'Select a NameSpace' |
|
6029 |
initialAnswer:nil |
|
2996 | 6030 |
" |
6031 |
! |
|
6032 |
||
6033 |
requestNameSpace:title title:boxTitle initialAnswer:initialTextOrNil |
|
6034 |
"Ask for a namespaces name" |
|
6035 |
||
3538 | 6036 |
|allNameSpaces| |
2486 | 6037 |
|
3282 | 6038 |
allNameSpaces := NameSpace allNameSpaces collect:[:each | each name]. |
2486 | 6039 |
allNameSpaces := allNameSpaces asOrderedCollection sort. |
6040 |
||
3538 | 6041 |
^ self |
6042 |
requestName:title |
|
6043 |
fromList:allNameSpaces |
|
6044 |
title:boxTitle |
|
6045 |
initialAnswer:initialTextOrNil |
|
6046 |
||
6047 |
" |
|
6048 |
Dialog |
|
6049 |
requestNameSpace:'Select a NameSpace' |
|
6050 |
initialAnswer:nil |
|
2486 | 6051 |
" |
6052 |
! |
|
6053 |
||
3736 | 6054 |
requestProject:title from:listOfProjects initialAnswer:initialTextOrNil suggestions:suggestions |
3384 | 6055 |
"Ask for a project (package-id)" |
6056 |
||
3736 | 6057 |
|newProject box| |
3384 | 6058 |
|
6059 |
box := ListSelectionBox new. |
|
6060 |
box useComboBoxWithList:suggestions. |
|
6061 |
box title:title. |
|
3736 | 6062 |
box list:listOfProjects. |
3384 | 6063 |
box okAction:[:sel | newProject := sel]. |
6064 |
box initialText:initialTextOrNil. |
|
6065 |
box entryCompletionBlock:(DoWhatIMeanSupport packageNameEntryCompletionBlock). |
|
4307
f7c4d912269c
changed: #requestProject:from:initialAnswer:suggestions:
Claus Gittinger <cg@exept.de>
parents:
4302
diff
changeset
|
6066 |
box label:'Enter Project/PackageID'. |
3384 | 6067 |
box showAtPointer. |
6068 |
||
6069 |
newProject notNil ifTrue:[ |
|
6070 |
newProject := newProject withoutSeparators asSymbol. |
|
6071 |
]. |
|
6072 |
^ newProject |
|
6073 |
||
6074 |
" |
|
6075 |
Dialog |
|
6076 |
requestProject:'enter a project' |
|
6077 |
initialAnswer:'stx:libbasic' |
|
6078 |
suggestions:#('foo' 'bar' 'baz') |
|
6079 |
" |
|
6080 |
||
6081 |
"Created: / 07-09-2006 / 11:40:17 / cg" |
|
6082 |
! |
|
6083 |
||
3736 | 6084 |
requestProject:title initialAnswer:initialTextOrNil suggestions:suggestions |
6085 |
"Ask for a project (package-id)" |
|
6086 |
||
6087 |
|allProjects| |
|
6088 |
||
6089 |
allProjects := Smalltalk allProjectIDs. |
|
6090 |
^ self |
|
6091 |
requestProject:title |
|
6092 |
from:allProjects |
|
6093 |
initialAnswer:initialTextOrNil |
|
6094 |
suggestions:suggestions |
|
6095 |
! |
|
6096 |
||
2486 | 6097 |
requestSelector:aString initialAnswer:initial |
6098 |
"launch a Dialog, which allows user to enter a method selector. |
|
6099 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6100 |
The entryField does selectorCompletion on TAB." |
|
6101 |
||
6102 |
^ self requestSelector:aString okLabel:nil initialAnswer:initial |
|
6103 |
||
6104 |
" |
|
6105 |
Dialog |
|
6106 |
requestSelector:'enter a selector:' |
|
6107 |
initialAnswer:'at:p' |
|
6108 |
" |
|
6109 |
! |
|
6110 |
||
6111 |
requestSelector:aString okLabel:okLabel initialAnswer:initial |
|
6112 |
"launch a Dialog, which allows user to enter a method selector. |
|
6113 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6114 |
The entryField does selectorCompletion on TAB." |
|
6115 |
||
6116 |
^ self |
|
6117 |
request:aString |
|
6118 |
displayAt:nil |
|
6119 |
centered:nil |
|
6120 |
action:nil |
|
6121 |
initialAnswer:initial |
|
6122 |
okLabel:okLabel |
|
6123 |
cancelLabel:nil |
|
6124 |
title:nil |
|
6125 |
onCancel:nil |
|
6126 |
list:nil |
|
6127 |
initialSelection:nil |
|
2629 | 6128 |
entryCompletionBlock:[:s :field| |
6129 |
|completion| |
|
2486 | 6130 |
|
6131 |
completion := Smalltalk selectorCompletion:s. |
|
3881 | 6132 |
completion second size > 1 ifTrue:[ |
6133 |
UserPreferences current beepInEditor ifTrue:[ |
|
6134 |
Screen current beep |
|
6135 |
]. |
|
6136 |
]. |
|
2629 | 6137 |
field contents:(completion first) |
2486 | 6138 |
] |
6139 |
||
6140 |
" |
|
6141 |
Dialog |
|
6142 |
requestSelector:'enter a selector:' |
|
6143 |
initialAnswer:'at:p' |
|
6144 |
" |
|
3538 | 6145 |
! |
6146 |
||
6147 |
requestSharedPool:title title:boxTitle initialAnswer:initialTextOrNil |
|
6148 |
"Ask for a sharedPools name" |
|
6149 |
||
6150 |
|allPools| |
|
6151 |
||
6152 |
allPools := SharedPool allSubclasses collect:[:each | each name]. |
|
6153 |
allPools := allPools asOrderedCollection sort. |
|
6154 |
||
6155 |
^ self |
|
6156 |
requestName:title |
|
6157 |
fromList:allPools |
|
6158 |
title:boxTitle |
|
6159 |
initialAnswer:initialTextOrNil |
|
6160 |
||
6161 |
" |
|
6162 |
Dialog |
|
6163 |
requestSharedPool:'Select a SharedPool' |
|
6164 |
title:nil |
|
6165 |
initialAnswer:nil |
|
6166 |
" |
|
2486 | 6167 |
! ! |
6168 |
||
197 | 6169 |
!DialogBox methodsFor:'accessing-behavior'! |
6170 |
||
6171 |
abortAction:aBlock |
|
6172 |
"define the action to be performed when abort is pressed" |
|
6173 |
||
6174 |
abortAction := aBlock |
|
125 | 6175 |
! |
6176 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6177 |
acceptCheck:aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6178 |
"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
|
6179 |
accepted (ok-button or Return-key). If it returns true, the box is closed, |
2106 | 6180 |
otherwise not. Of course, you may also use a valueHolder instead of a block |
6181 |
to provide the check value." |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6182 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6183 |
acceptCheck := aBlock |
2106 | 6184 |
|
6185 |
"Modified: / 25.1.2000 / 20:56:04 / cg" |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6186 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6187 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6188 |
acceptOnLeave:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6189 |
"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
|
6190 |
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
|
6191 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6192 |
acceptOnLeave := aBoolean. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6193 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6194 |
"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
|
6195 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6196 |
|
197 | 6197 |
acceptReturnAsOK:aBoolean |
6198 |
"turn on/off interpretation of return-key as ok. |
|
6199 |
Default is on" |
|
6200 |
||
6201 |
acceptReturnAsOK := aBoolean. |
|
6202 |
okButton notNil ifTrue:[ |
|
6203 |
okButton isReturnButton:aBoolean. |
|
6204 |
] |
|
6205 |
! |
|
6206 |
||
6207 |
action:aBlock |
|
6208 |
"set the action to be performed when user presses ok-button; |
|
6209 |
aBlock must be nil or a block. This method simply |
|
6210 |
reuses okAction: and has been added for a consistent action-setting |
|
6211 |
protocol." |
|
76 | 6212 |
|
197 | 6213 |
self okAction:aBlock |
6214 |
! |
|
6215 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6216 |
focusOnField:anInputField |
1646 | 6217 |
"arrange for the argument to get the focus (initially)" |
6218 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6219 |
inputFieldGroup makeActive:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6220 |
|
1646 | 6221 |
"Modified: / 13.8.1998 / 21:23:17 / cg" |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6222 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6223 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6224 |
focusToOKOnLeave:aBoolean |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6225 |
"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
|
6226 |
or cursor key. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6227 |
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
|
6228 |
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
|
6229 |
the dialog is accepted & closed." |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6230 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6231 |
focusToOKOnLeave := aBoolean. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6232 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6233 |
"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
|
6234 |
"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
|
6235 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6236 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6237 |
hideOnAccept:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6238 |
"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
|
6239 |
The default is true" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6240 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6241 |
hideOnAccept := aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6242 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6243 |
|
593 | 6244 |
makeTabable:aComponentOrSubcomponent |
6245 |
"add a component (usually a subcomponent, of which the dialog |
|
6246 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6247 |
stepped through via FocusNext/FocusPrevious). |
|
6248 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6249 |
||
3467 | 6250 |
aComponentOrSubcomponent canTab:true. |
6251 |
||
6252 |
"/ tabableElements isNil ifTrue:[ |
|
6253 |
"/ tabableElements := OrderedCollection new |
|
6254 |
"/ ]. |
|
6255 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6256 |
"/ tabableElements add:aComponentOrSubcomponent. |
|
6257 |
"/ ]. |
|
6258 |
||
6259 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6260 |
self addToInputFieldGroup:aComponentOrSubcomponent |
|
593 | 6261 |
]. |
6262 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
6263 |
"Modified: 31.5.1996 / 21:22:13 / cg" |
593 | 6264 |
! |
6265 |
||
1843 | 6266 |
makeTabable:aComponentOrSubcomponent after:anotherComponent |
6267 |
"add a component (usually a subcomponent, of which the dialog |
|
6268 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6269 |
stepped through via FocusNext/FocusPrevious). |
|
6270 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6271 |
||
3467 | 6272 |
<resource: #obsolete> |
6273 |
self obsoleteMethodWarning. "/ focusSequence has been eliminated |
|
6274 |
||
6275 |
aComponentOrSubcomponent canTab:true. |
|
6276 |
||
6277 |
"/ tabableElements isNil ifTrue:[ |
|
6278 |
"/ tabableElements := OrderedCollection new |
|
6279 |
"/ ]. |
|
6280 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent ifAbsent:nil. |
|
6281 |
"/ |
|
6282 |
"/ anotherComponent isNil ifTrue:[ |
|
6283 |
"/ tabableElements addLast:aComponentOrSubcomponent |
|
6284 |
"/ ] ifFalse:[ |
|
6285 |
"/ tabableElements add:aComponentOrSubcomponent after:anotherComponent. |
|
6286 |
"/ ]. |
|
6287 |
"/ |
|
1843 | 6288 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
6289 |
self addToInputFieldGroup:aComponentOrSubcomponent after:anotherComponent |
|
6290 |
]. |
|
6291 |
||
6292 |
"Modified: 18.10.1997 / 03:08:20 / cg" |
|
6293 |
! |
|
6294 |
||
1355 | 6295 |
makeUntabable:aComponentOrSubcomponent |
3467 | 6296 |
aComponentOrSubcomponent canTab:false. |
6297 |
||
6298 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6299 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent. |
|
6300 |
"/ ]. |
|
6301 |
||
6302 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6303 |
self removeFromInputFieldGroup:aComponentOrSubcomponent |
|
1355 | 6304 |
]. |
6305 |
||
6306 |
"Modified: 18.10.1997 / 02:50:05 / cg" |
|
593 | 6307 |
! |
6308 |
||
2361 | 6309 |
noAction:aBlock |
6310 |
"define the action to be performed when 'no' is pressed" |
|
6311 |
||
6312 |
abortAction := aBlock |
|
6313 |
||
6314 |
"Modified: 16.1.1997 / 11:29:18 / cg" |
|
6315 |
! |
|
6316 |
||
197 | 6317 |
okAction:aBlock |
6318 |
"define the action to be performed when ok is pressed" |
|
133 | 6319 |
|
197 | 6320 |
okAction := aBlock |
2361 | 6321 |
! |
6322 |
||
6323 |
title:aString yesAction:yesBlock noAction:noBlock |
|
6324 |
"define title and actions" |
|
6325 |
||
6326 |
self title:aString. |
|
6327 |
okAction := yesBlock. |
|
6328 |
abortAction := noBlock |
|
6329 |
! |
|
6330 |
||
6331 |
yesAction:aBlock |
|
6332 |
"define the action to be performed when 'yes' is pressed" |
|
6333 |
||
6334 |
okAction := aBlock |
|
6335 |
||
6336 |
"Modified: 16.1.1997 / 11:31:21 / cg" |
|
6337 |
! |
|
6338 |
||
6339 |
yesAction:yesBlock noAction:noBlock |
|
6340 |
"define both actions" |
|
6341 |
||
6342 |
okAction := yesBlock. |
|
6343 |
abortAction := noBlock |
|
197 | 6344 |
! ! |
6345 |
||
6346 |
!DialogBox methodsFor:'accessing-components'! |
|
6347 |
||
6348 |
abortButton |
|
6349 |
"return the abortButton - this access is provided to allow |
|
6350 |
setting the buttons look (for example: colors or font)" |
|
6351 |
||
6352 |
^ abortButton |
|
76 | 6353 |
! |
6354 |
||
2327 | 6355 |
buttonPanel |
6356 |
"return the buttonPanel - this access is provided to allow |
|
6357 |
setting the buttons look (for example: colors or font)" |
|
6358 |
||
6359 |
^ buttonPanel |
|
6360 |
! |
|
6361 |
||
2147
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6362 |
cancelButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6363 |
"same as #abortButton; |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6364 |
return the abortButton - this access is provided to allow |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6365 |
setting the buttons look (for example: colors or font)" |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6366 |
|
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6367 |
^ self abortButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6368 |
! |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6369 |
|
2361 | 6370 |
noButton |
6371 |
"return the no-button" |
|
6372 |
||
6373 |
^ abortButton |
|
6374 |
! |
|
6375 |
||
197 | 6376 |
okButton |
6377 |
"return the okButton - this access is provided to allow |
|
6378 |
setting the buttons look (for example: colors or font)" |
|
76 | 6379 |
|
197 | 6380 |
^ okButton |
2361 | 6381 |
! |
6382 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6383 |
verticalPanel |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6384 |
"if there is none yet, create and add a vertical panel. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6385 |
This can be used to additional components in an aboutToOpen hook callback." |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6386 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6387 |
|savedY| |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6388 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6389 |
verticalPanel isNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6390 |
savedY := yPosition. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6391 |
self addComponent:(verticalPanel := VerticalPanelView new). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6392 |
verticalPanel horizontalLayout:#fit. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6393 |
verticalPanel verticalLayout:#top. |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6394 |
verticalPanel height:25. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6395 |
yPosition := savedY. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6396 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6397 |
^ verticalPanel |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6398 |
! |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6399 |
|
2361 | 6400 |
yesButton |
6401 |
"return the 'yes'-button" |
|
6402 |
||
6403 |
^ okButton |
|
6404 |
||
6405 |
"Modified: 16.1.1997 / 11:31:27 / cg" |
|
197 | 6406 |
! ! |
155 | 6407 |
|
197 | 6408 |
!DialogBox methodsFor:'accessing-elements'! |
6409 |
||
6410 |
componentAt:name |
|
680 | 6411 |
"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
|
6412 |
named previously with #name:as:" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6413 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6414 |
namedComponents isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6415 |
^ namedComponents at:name ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6416 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6417 |
"Modified: 16.1.1997 / 11:40:50 / cg" |
76 | 6418 |
! |
6419 |
||
197 | 6420 |
name:element as:name |
680 | 6421 |
"assign a name to a component. This can be done during construction, |
6422 |
to allow later access to the components (i.e. without a need to |
|
6423 |
remember them in some instVars)" |
|
6424 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6425 |
namedComponents isNil ifTrue:[ |
1401 | 6426 |
namedComponents := Dictionary new. |
197 | 6427 |
]. |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6428 |
namedComponents at:name put:element |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6429 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6430 |
"Modified: 16.1.1997 / 11:41:03 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6431 |
! ! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6432 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6433 |
!DialogBox methodsFor:'accessing-look'! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6434 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6435 |
abortText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6436 |
"define the label in the abort-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6437 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6438 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6439 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6440 |
aString ~= abortButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6441 |
oldSize := abortButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6442 |
abortButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6443 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6444 |
abortButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6445 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6446 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6447 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6448 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6449 |
|
1702 | 6450 |
hideButtons |
6451 |
"hides the buttonPanel (i.e. the ok and cancel buttons if any)" |
|
6452 |
||
6453 |
buttonPanel notNil ifTrue:[buttonPanel beInvisible] |
|
6454 |
! |
|
6455 |
||
2361 | 6456 |
noLabel:aString |
6457 |
"define the label of the 'no'-button. |
|
6458 |
And alias for #noText: - for backward compatibility" |
|
6459 |
||
6460 |
self noText:aString. |
|
6461 |
||
6462 |
"Created: 13.12.1995 / 16:21:57 / cg" |
|
6463 |
"Modified: 16.1.1997 / 11:30:25 / cg" |
|
6464 |
! |
|
6465 |
||
6466 |
noText:aString |
|
6467 |
"define the label of the no-button. |
|
6468 |
If not set, it defaults to the resource-string for 'no'." |
|
6469 |
||
6470 |
aString ~= abortButton label ifTrue:[ |
|
6471 |
abortButton label:aString. |
|
6472 |
abortButton resize. |
|
6473 |
shown ifTrue:[self resize] |
|
6474 |
] |
|
6475 |
! |
|
6476 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6477 |
okText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6478 |
"define the text in the ok-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6479 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6480 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6481 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6482 |
aString ~= okButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6483 |
oldSize := okButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6484 |
okButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6485 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6486 |
okButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6487 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6488 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6489 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6490 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6491 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6492 |
okText:okString abortText:abortString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6493 |
"set both texts displayed in the buttons" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6494 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6495 |
(abortString ~= abortButton label |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6496 |
or:[okString ~= okButton label]) ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6497 |
okButton label:okString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6498 |
abortButton label:abortString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6499 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6500 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6501 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6502 |
] |
2361 | 6503 |
! |
6504 |
||
6505 |
okText:yesString noText:noString |
|
6506 |
"define the labels of both buttons. |
|
6507 |
Alias for yesText:noText: for backward compatibility." |
|
6508 |
||
6509 |
^ self yesText:yesString noText:noString |
|
6510 |
||
6511 |
"Modified: 16.1.1997 / 11:30:58 / cg" |
|
6512 |
! |
|
6513 |
||
6514 |
title:aString yesText:yesString noText:noString |
|
6515 |
"define title and button labels" |
|
6516 |
||
6517 |
self title:aString. |
|
6518 |
self yesText:yesString noText:noString |
|
6519 |
! |
|
6520 |
||
6521 |
yesLabel:aString |
|
6522 |
"define the label of the 'yes'-button. |
|
6523 |
An alias for #yesText: for backward compatibility." |
|
6524 |
||
6525 |
self yesText:aString. |
|
6526 |
||
6527 |
"Created: 13.12.1995 / 16:22:05 / cg" |
|
6528 |
"Modified: 16.1.1997 / 11:31:58 / cg" |
|
6529 |
! |
|
6530 |
||
6531 |
yesText:aString |
|
6532 |
"define the label of the 'yes'-button" |
|
6533 |
||
6534 |
self okText:aString |
|
6535 |
||
6536 |
"Modified: 16.1.1997 / 11:31:39 / cg" |
|
6537 |
! |
|
6538 |
||
6539 |
yesText:yesString noText:noString |
|
6540 |
"define the labels of both buttons" |
|
6541 |
||
6542 |
((yesString ~= okButton label) or:[noString ~= abortButton label]) ifTrue:[ |
|
6543 |
okButton label:yesString. |
|
6544 |
abortButton label:noString. |
|
6545 |
okButton resize. |
|
6546 |
abortButton resize. |
|
6547 |
shown ifTrue:[self resize] |
|
6548 |
] |
|
6549 |
||
6550 |
"Modified: 21.2.1996 / 00:58:38 / cg" |
|
197 | 6551 |
! ! |
6552 |
||
6553 |
!DialogBox methodsFor:'accessing-models'! |
|
76 | 6554 |
|
197 | 6555 |
accept |
6556 |
"return the valueHolder holding true when the box |
|
6557 |
is accepted, false if closed via the windowManager or |
|
6558 |
the cancel button. |
|
6559 |
This is confusing: this method was originally called #acceptValue, |
|
6560 |
but renamed for compatibility with ST-80. |
|
6561 |
This looks like a bad name to me, since in most other situations, #accept |
|
6562 |
is used to force an accept, not to return some valueHolder ...)." |
|
6563 |
||
6564 |
^ acceptValue |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6565 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6566 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6567 |
acceptChannel |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6568 |
"same as #accept: return the valueHolder which is set to true when the box |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6569 |
is accepted" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6570 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6571 |
^ acceptValue |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6572 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6573 |
"Created: / 18.8.2000 / 21:44:24 / cg" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6574 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6575 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6576 |
acceptChannel:aValueHolder |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6577 |
"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
|
6578 |
is accepted" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6579 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6580 |
acceptValue := aValueHolder |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6581 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6582 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6583 |
aspectAt:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6584 |
"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
|
6585 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6586 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6587 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6588 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6589 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6590 |
bindings isNil ifTrue:[bindings := IdentityDictionary new]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6591 |
bindings at:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6592 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6593 |
"Created: 16.1.1997 / 11:38:46 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6594 |
"Modified: 16.1.1997 / 11:41:28 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6595 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6596 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6597 |
aspectFor:anAspectSymbol |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6598 |
"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
|
6599 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6600 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6601 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6602 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6603 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6604 |
"/ subclasses may redefine some aspects... |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6605 |
(self respondsTo:anAspectSymbol) ifTrue:[ |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6606 |
^ self perform:anAspectSymbol |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6607 |
]. |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6608 |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6609 |
bindings isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6610 |
^ bindings at:anAspectSymbol ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6611 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6612 |
"Modified: / 11-10-2006 / 21:48:14 / cg" |
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6613 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6614 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6615 |
cancel |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6616 |
^ BlockValue forLogicalNot:(acceptValue) |
76 | 6617 |
! ! |
6618 |
||
120 | 6619 |
!DialogBox methodsFor:'construction-adding'! |
6620 |
||
593 | 6621 |
addComponent:aComponent |
6622 |
"add any component with its preferred height and full width. |
|
6623 |
Returns the component." |
|
6624 |
||
6625 |
^ self addComponent:aComponent indent:nil tabable:false |
|
6626 |
||
6627 |
"Modified: 9.2.1996 / 22:22:41 / cg" |
|
6628 |
! |
|
6629 |
||
6630 |
addComponent:aComponent indent:indent |
|
6631 |
"add any component with its preferred height and full width. |
|
6632 |
The indent is temporarily changed to indent. |
|
6633 |
Returns the component." |
|
6634 |
||
6635 |
^ self addComponent:aComponent indent:indent tabable:false |
|
6636 |
||
6637 |
"Modified: 9.2.1996 / 22:22:44 / cg" |
|
6638 |
! |
|
6639 |
||
6640 |
addComponent:aComponent indent:indent tabable:tabable |
|
6641 |
"add any component with its preferred height and full width. |
|
6642 |
The indent is temporarily changed to indent. |
|
6643 |
Returns the component." |
|
6644 |
||
6645 |
|oldLeft oldRight result| |
|
6646 |
||
6647 |
oldLeft := leftIndent. |
|
6648 |
oldRight := rightIndent. |
|
6649 |
indent notNil ifTrue:[ |
|
1401 | 6650 |
leftIndent := rightIndent := indent. |
593 | 6651 |
]. |
6652 |
result := self addComponent:aComponent tabable:tabable tabbedComponent:aComponent. |
|
6653 |
leftIndent := oldLeft. |
|
6654 |
rightIndent := oldRight. |
|
6655 |
^ result |
|
6656 |
||
6657 |
"Modified: 9.2.1996 / 22:22:50 / cg" |
|
6658 |
! |
|
6659 |
||
6660 |
addComponent:aComponent indent:indent withExtent:ext |
|
6661 |
"add any component with some given extent. |
|
6662 |
Returns the component." |
|
6663 |
||
6664 |
|fullSize lI rI| |
|
6665 |
||
6666 |
indent isNil ifTrue:[ |
|
2801 | 6667 |
lI := leftIndent. |
6668 |
rI := rightIndent. |
|
593 | 6669 |
] ifFalse:[ |
2801 | 6670 |
lI := rI := indent |
593 | 6671 |
]. |
6672 |
||
6673 |
self basicAddComponent:aComponent. |
|
4155
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6674 |
(ext x isInteger) ifTrue:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6675 |
fullSize := ext + (lI + rI @ 0). |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6676 |
width := fullSize x max:width. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6677 |
] ifFalse:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6678 |
fullSize := ext. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6679 |
]. |
593 | 6680 |
aComponent extent:fullSize. |
2801 | 6681 |
aComponent origin:(0.0 @ yPosition); |
6682 |
leftInset:lI; |
|
6683 |
rightInset:rI. |
|
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6684 |
|
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6685 |
yPosition := aComponent corner y + ViewSpacing. |
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6686 |
"/ yPosition := yPosition + aComponent height + ViewSpacing. |
593 | 6687 |
needResize := true. |
6688 |
^ aComponent |
|
6689 |
||
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6690 |
"Modified: / 29-07-2011 / 12:28:47 / cg" |
593 | 6691 |
! |
6692 |
||
6693 |
addComponent:aComponent indent:indent withHeight:height |
|
6694 |
"add any component with some given height and full width. |
|
6695 |
Returns the component." |
|
6696 |
||
6697 |
|lI rI| |
|
6698 |
||
6699 |
indent isNil ifTrue:[ |
|
2801 | 6700 |
lI := leftIndent. |
6701 |
rI := rightIndent. |
|
593 | 6702 |
] ifFalse:[ |
2801 | 6703 |
lI := rI := indent |
593 | 6704 |
]. |
6705 |
self basicAddComponent:aComponent. |
|
3283 | 6706 |
aComponent |
6707 |
height:height; |
|
6708 |
origin:0.0@yPosition; |
|
6709 |
width:1.0; |
|
6710 |
leftInset:lI; |
|
6711 |
rightInset:rI. |
|
2801 | 6712 |
yPosition := yPosition + height + ViewSpacing. |
593 | 6713 |
^ aComponent |
6714 |
||
6715 |
"Modified: 9.2.1996 / 22:22:58 / cg" |
|
6716 |
! |
|
6717 |
||
6718 |
addComponent:aComponent tabable:tabable |
|
6719 |
"add any component with its preferred height and full width. |
|
6720 |
Returns the component." |
|
6721 |
||
6722 |
^ self addComponent:aComponent tabable:tabable tabbedComponent:aComponent |
|
6723 |
||
6724 |
"Modified: 9.2.1996 / 22:23:04 / cg" |
|
6725 |
! |
|
6726 |
||
6727 |
addComponent:aComponent tabable:tabable tabbedComponent:subComponent |
|
6728 |
"add any component with its preferred height and full width. |
|
6729 |
Returns the component." |
|
6730 |
||
6731 |
tabable ifTrue:[ |
|
3467 | 6732 |
aComponent canTab:true. |
6733 |
||
6734 |
"/ tabableElements isNil ifTrue:[ |
|
6735 |
"/ tabableElements := OrderedCollection new |
|
6736 |
"/ ]. |
|
6737 |
"/ tabableElements add:subComponent |
|
593 | 6738 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6739 |
^ self addComponent:aComponent withHeight:(aComponent preferredHeight). |
593 | 6740 |
|
6741 |
"Modified: 9.2.1996 / 22:23:07 / cg" |
|
6742 |
! |
|
6743 |
||
6744 |
addComponent:aComponent withExtent:ext |
|
6745 |
"add any component with some given extent. |
|
6746 |
Returns the component." |
|
6747 |
||
6748 |
^ self addComponent:aComponent indent:nil withExtent:ext |
|
6749 |
||
6750 |
"Modified: 9.2.1996 / 22:23:11 / cg" |
|
6751 |
! |
|
6752 |
||
6753 |
addComponent:aComponent withHeight:height |
|
6754 |
"add any component with some given height and full width. |
|
6755 |
Returns the component." |
|
6756 |
||
6757 |
^ self addComponent:aComponent indent:nil withHeight:height |
|
6758 |
||
6759 |
"Modified: 9.2.1996 / 22:23:15 / cg" |
|
6760 |
! |
|
6761 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6762 |
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
|
6763 |
"add a label and some view side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6764 |
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
|
6765 |
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
|
6766 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6767 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6768 |
|
795 | 6769 |
^ self |
1401 | 6770 |
addLabelledField:aView |
6771 |
label:labelString |
|
6772 |
adjust:labelAdjust |
|
6773 |
tabable:tabable |
|
6774 |
from:leftX to:rightX separateAtX:relativeX |
|
6775 |
nameAs:nil |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6776 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6777 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6778 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6779 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6780 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6781 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6782 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6783 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6784 |
field := dialog |
1401 | 6785 |
addLabelledField:(EditField on:model) label:'input here:' |
6786 |
adjust:#left |
|
6787 |
tabable:true |
|
6788 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6789 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6790 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6791 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6792 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6793 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6794 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6795 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6796 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6797 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6798 |
model := SelectionInList new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6799 |
model list:#('foo' 'bar' 'baz'). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6800 |
model selectionIndex:2. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6801 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6802 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6803 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6804 |
field := dialog |
1401 | 6805 |
addLabelledField:(PopUpList on:model) label:'select here:' |
6806 |
adjust:#left |
|
6807 |
tabable:true |
|
6808 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6809 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6810 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6811 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6812 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6813 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6814 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6815 |
"Created: 3.6.1996 / 11:03:24 / cg" |
795 | 6816 |
"Modified: 17.7.1996 / 15:04:07 / cg" |
6817 |
! |
|
6818 |
||
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6819 |
addLabelledField:aView label:labelString adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6820 |
tabable:tabable from:leftX to:rightX separateAtX:relativeX nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6821 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6822 |
"add a label and some view side-by-side. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6823 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6824 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6825 |
The inputField gets model as its model. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6826 |
Return the inputField." |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6827 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6828 |
^ self |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6829 |
addLabelledField:aView |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6830 |
label:labelString |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6831 |
adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6832 |
tabable:tabable |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6833 |
from:leftX to:rightX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6834 |
separateAtX:relativeX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6835 |
nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6836 |
foregroundColor:nil |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6837 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6838 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6839 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6840 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6841 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6842 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6843 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6844 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6845 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6846 |
addLabelledField:(EditField on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6847 |
label:'input here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6848 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6849 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6850 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6851 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6852 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6853 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6854 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6855 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6856 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6857 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6858 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6859 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6860 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6861 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6862 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6863 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6864 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6865 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6866 |
label:'select foo:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6867 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6868 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6869 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6870 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6871 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6872 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6873 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6874 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6875 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6876 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6877 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6878 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6879 |
model := SelectionInList new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6880 |
model list:#('foo' 'bar' 'baz'). |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6881 |
model selectionIndex:2. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6882 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6883 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6884 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6885 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6886 |
addLabelledField:(PopUpList on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6887 |
label:'select here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6888 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6889 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6890 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6891 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6892 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6893 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6894 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6895 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6896 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6897 |
"Created: 17.7.1996 / 15:03:32 / cg" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6898 |
"Modified: 26.7.1996 / 18:11:12 / cg" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6899 |
! |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6900 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6901 |
addLabelledField:aView label:labelString adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6902 |
tabable:tabable from:leftX to:rightX separateAtX:relativeX nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6903 |
foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6904 |
|
795 | 6905 |
"add a label and some view side-by-side. |
6906 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
6907 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
6908 |
The inputField gets model as its model. |
|
6909 |
Return the inputField." |
|
6910 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6911 |
|y lbl max relW wLabel| |
795 | 6912 |
|
6913 |
y := self yPosition. |
|
6914 |
lbl := Label label:labelString. |
|
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6915 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6916 |
max := lbl preferredHeight max:(aView preferredHeight max:aView height). |
795 | 6917 |
|
6918 |
relW := rightX - leftX. |
|
6919 |
||
6920 |
self addComponent:lbl indent:leftIndent withHeight:max. |
|
6921 |
lbl rightInset:0. |
|
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6922 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6923 |
wLabel := relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6924 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6925 |
wLabel := relW*relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6926 |
]. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6927 |
|
795 | 6928 |
lbl |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6929 |
width:wLabel; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6930 |
left:leftX; |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6931 |
adjust:labelAdjust; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6932 |
borderWidth:0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6933 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6934 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6935 |
lbl preferredExtent:(wLabel @ lbl preferredExtent y). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6936 |
lbl extent:(wLabel @ lbl preferredExtent y). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6937 |
lbl sizeFixed:true. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6938 |
]. |
795 | 6939 |
|
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6940 |
fgColor notNil ifTrue:[ |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6941 |
lbl foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6942 |
]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6943 |
|
795 | 6944 |
self yPosition:y. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6945 |
|
4217
9453a5aa3fcf
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4216
diff
changeset
|
6946 |
"/ aView preferredExtent:(aView preferredExtent x @ max). |
9453a5aa3fcf
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4216
diff
changeset
|
6947 |
"/ aView height:max. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6948 |
|
795 | 6949 |
self addComponent:aView tabable:tabable. |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6950 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6951 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6952 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6953 |
leftInset:(ViewSpacing + relativeX); |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6954 |
left:0.0; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6955 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6956 |
right:1.0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6957 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6958 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6959 |
leftInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6960 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6961 |
width:relW*(1.0 - relativeX); |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6962 |
left:leftX+(relW*relativeX). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6963 |
]. |
4218
7b0e5dd511e9
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4217
diff
changeset
|
6964 |
|
4219
c83b708345f7
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4218
diff
changeset
|
6965 |
"/ self todo. "/ someone changes this later, back to a too small height !!!!!! |
4222
53a2a6433f59
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4220
diff
changeset
|
6966 |
aView setHeight:max. |
795 | 6967 |
|
6968 |
aView isInputField ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6969 |
self addToInputFieldGroup:aView |
795 | 6970 |
]. |
6971 |
||
6972 |
aName notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6973 |
self name:lbl as:(aName , '.label'). |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6974 |
self name:aView as:aName |
795 | 6975 |
]. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6976 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6977 |
^ aView |
795 | 6978 |
|
6979 |
" |
|
6980 |
|dialog model field| |
|
6981 |
||
6982 |
model := '' asValue. |
|
6983 |
||
6984 |
dialog := DialogBox new. |
|
6985 |
||
6986 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6987 |
addLabelledField:(EditField on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6988 |
label:'input here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6989 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6990 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6991 |
separateAtX:0.3. |
807 | 6992 |
|
6993 |
dialog addAbortButton; addOkButton. |
|
6994 |
dialog open. |
|
6995 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6996 |
" |
|
6997 |
||
6998 |
" |
|
6999 |
|dialog model field| |
|
7000 |
||
7001 |
model := '' asValue. |
|
7002 |
||
7003 |
dialog := DialogBox new. |
|
7004 |
||
7005 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7006 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7007 |
label:'select foo:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7008 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7009 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7010 |
separateAtX:0.3. |
795 | 7011 |
|
7012 |
dialog addAbortButton; addOkButton. |
|
7013 |
dialog open. |
|
7014 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
7015 |
" |
|
7016 |
||
7017 |
" |
|
7018 |
|dialog model field| |
|
7019 |
||
7020 |
model := SelectionInList new. |
|
7021 |
model list:#('foo' 'bar' 'baz'). |
|
7022 |
model selectionIndex:2. |
|
7023 |
||
7024 |
dialog := DialogBox new. |
|
7025 |
||
7026 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7027 |
addLabelledField:(PopUpList on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7028 |
label:'select here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7029 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7030 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7031 |
separateAtX:0.3. |
795 | 7032 |
|
7033 |
dialog addAbortButton; addOkButton. |
|
7034 |
dialog open. |
|
7035 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
7036 |
" |
|
7037 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7038 |
"Created: / 17-07-1996 / 15:03:32 / cg" |
4222
53a2a6433f59
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4220
diff
changeset
|
7039 |
"Modified: / 02-02-2011 / 12:17:55 / cg" |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7040 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7041 |
|
593 | 7042 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX |
7043 |
"add a label and some view side-by-side. |
|
7044 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
7045 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
7046 |
The inputField gets model as its model. |
|
7047 |
Return the inputField." |
|
7048 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7049 |
^ self |
1401 | 7050 |
addLabelledField:aView |
7051 |
label:labelString |
|
7052 |
adjust:labelAdjust |
|
7053 |
tabable:tabable |
|
7054 |
from:0.0 to:1.0 |
|
7055 |
separateAtX:relativeX |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7056 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7057 |
"/ |y lbl max| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7058 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7059 |
"/ y := self yPosition. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7060 |
"/ lbl := Label label:labelString. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7061 |
"/ max := lbl preferredExtent y max:(aView preferredExtent y). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7062 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7063 |
"/ self addComponent:lbl indent:leftIndent withHeight:max. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7064 |
"/ lbl rightInset:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7065 |
"/ lbl width:relativeX; adjust:labelAdjust; borderWidth:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7066 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7067 |
"/ self yPosition:y. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7068 |
"/ self addComponent:aView tabable:tabable. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7069 |
"/ aView leftInset:ViewSpacing; rightInset:ViewSpacing. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7070 |
"/ aView width:(1.0 - relativeX); left:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7071 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7072 |
"/ aView isInputField ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7073 |
"/ self addToInputFieldGroup:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7074 |
"/ ]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7075 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7076 |
"/ ^ aView |
593 | 7077 |
|
7078 |
" |
|
7079 |
|dialog model field| |
|
7080 |
||
7081 |
model := '' asValue. |
|
7082 |
||
7083 |
dialog := DialogBox new. |
|
7084 |
||
7085 |
field := dialog |
|
1401 | 7086 |
addLabelledField:(EditField on:model) label:'input here:' |
7087 |
adjust:#left |
|
7088 |
tabable:true |
|
7089 |
separateAtX:0.3. |
|
593 | 7090 |
|
7091 |
dialog addAbortButton; addOkButton. |
|
7092 |
dialog open. |
|
655 | 7093 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7094 |
" |
7095 |
||
7096 |
" |
|
7097 |
|dialog model field| |
|
7098 |
||
7099 |
model := SelectionInList new. |
|
7100 |
model list:#('foo' 'bar' 'baz'). |
|
7101 |
model selectionIndex:2. |
|
7102 |
||
7103 |
dialog := DialogBox new. |
|
7104 |
||
7105 |
field := dialog |
|
1401 | 7106 |
addLabelledField:(PopUpList on:model) label:'select here:' |
7107 |
adjust:#left |
|
7108 |
tabable:true |
|
7109 |
separateAtX:0.3. |
|
593 | 7110 |
|
7111 |
dialog addAbortButton; addOkButton. |
|
7112 |
dialog open. |
|
655 | 7113 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7114 |
" |
7115 |
||
7116 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7117 |
"Modified: 3.6.1996 / 18:48:49 / cg" |
593 | 7118 |
! |
7119 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7120 |
addMessage:labelString centered:centered |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7121 |
^ self addTextLabel:labelString |
2116 | 7122 |
|
7123 |
"Created: / 4.2.2000 / 00:03:24 / cg" |
|
7124 |
! |
|
7125 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7126 |
addMessage:labelString textLine:valueHolder boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7127 |
^ self |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7128 |
addMessage:labelString |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7129 |
textLine:valueHolder |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7130 |
type:nil |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7131 |
boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7132 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7133 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7134 |
addMessage:labelString textLine:valueHolder type:typeSymbolOrNil boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7135 |
|pos lbl field| |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7136 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7137 |
pos := self yPosition. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7138 |
lbl := self addTextLabel:labelString. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7139 |
lbl width:fraction. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7140 |
self yPosition:pos. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7141 |
field := self addInputFieldOn:valueHolder tabable:true. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7142 |
field left:fraction; width:(1.0-fraction). |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7143 |
typeSymbolOrNil == #password ifTrue:[ |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7144 |
field bePassword |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7145 |
]. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7146 |
^ field |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7147 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7148 |
|
593 | 7149 |
addTextLabel:aString |
7150 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
7151 |
however, ST/X labels allow image labels too. |
|
7152 |
Returns the label." |
|
7153 |
||
7154 |
|l| |
|
7155 |
||
7156 |
l := Label new label:aString. |
|
7157 |
l borderWidth:0. |
|
7158 |
self addComponent:l. |
|
7159 |
^ l |
|
7160 |
||
7161 |
" |
|
7162 |
|b| |
|
7163 |
||
7164 |
b := DialogBox new. |
|
7165 |
b addTextLabel:'hello'. |
|
7166 |
b showAtPointer |
|
7167 |
" |
|
7168 |
" |
|
7169 |
|b| |
|
7170 |
||
7171 |
b := DialogBox new. |
|
7172 |
b leftIndent:100. |
|
7173 |
b addTextLabel:'hello'. |
|
7174 |
b leftIndent:0. |
|
7175 |
b addTextLabel:'world'. |
|
7176 |
b showAtPointer |
|
7177 |
" |
|
7178 |
" |
|
7179 |
|b| |
|
7180 |
||
7181 |
b := DialogBox new. |
|
7182 |
b addTextLabel:'hello'. |
|
7183 |
b addTextLabel:'world'. |
|
7184 |
b addOkButton. |
|
7185 |
b showAtPointer |
|
7186 |
" |
|
7187 |
" |
|
7188 |
|b| |
|
7189 |
||
7190 |
b := DialogBox new. |
|
7191 |
b addTextLabel:'hello'. |
|
7192 |
(b addTextLabel:'world') foregroundColor:Color red. |
|
7193 |
b addOkButton. |
|
7194 |
b showAtPointer |
|
7195 |
" |
|
7196 |
" |
|
7197 |
|b| |
|
7198 |
||
7199 |
b := DialogBox new. |
|
7200 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7201 |
b addOkButton. |
|
7202 |
b showAtPointer |
|
7203 |
" |
|
7204 |
" |
|
7205 |
|b| |
|
7206 |
||
7207 |
b := DialogBox new. |
|
7208 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7209 |
b addTextLabel:'not bad'. |
|
7210 |
b addAbortButton. |
|
7211 |
b addOkButton. |
|
7212 |
b showAtPointer |
|
7213 |
" |
|
7214 |
! |
|
7215 |
||
3908 | 7216 |
addTextLabelOn:aValueHolder |
7217 |
"create a text label showing the contents of a valueHolder. |
|
7218 |
Returns the label." |
|
7219 |
||
7220 |
|l| |
|
7221 |
||
7222 |
l := Label new labelChannel:aValueHolder. |
|
7223 |
l borderWidth:0. |
|
7224 |
self addComponent:l. |
|
7225 |
^ l |
|
7226 |
||
7227 |
" |
|
7228 |
|b| |
|
7229 |
||
7230 |
b := DialogBox new. |
|
7231 |
b addTextLabelOn:'hello' asValue. |
|
7232 |
b showAtPointer |
|
7233 |
" |
|
7234 |
" |
|
7235 |
|b| |
|
7236 |
||
7237 |
b := DialogBox new. |
|
7238 |
b leftIndent:100. |
|
7239 |
b addTextLabelOn:'hello' asValue. |
|
7240 |
b leftIndent:0. |
|
7241 |
b addTextLabelOn:'world' asValue. |
|
7242 |
b showAtPointer |
|
7243 |
" |
|
7244 |
! |
|
7245 |
||
593 | 7246 |
addToInputFieldGroup:aComponentOrSubcomponent |
7247 |
"add a component to the input group. |
|
7248 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7249 |
a topLevel component." |
|
7250 |
||
1355 | 7251 |
self |
1401 | 7252 |
addToInputFieldGroup:aComponentOrSubcomponent before:nil |
1355 | 7253 |
|
7254 |
"Modified: 18.10.1997 / 03:09:17 / cg" |
|
7255 |
! |
|
7256 |
||
7257 |
addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
|
7258 |
"add a component to the input group. |
|
7259 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7260 |
a topLevel component." |
|
7261 |
||
593 | 7262 |
inputFieldGroup isNil ifTrue:[ |
1759 | 7263 |
inputFieldGroup := EnterFieldGroup new. |
7264 |
inputFieldGroup leaveAction:[self lastFieldLeft]. |
|
7265 |
"/ |
|
7266 |
"/ the first inputField gets the focus initially |
|
7267 |
"/ |
|
7268 |
aComponentOrSubcomponent hasKeyboardFocus:true. |
|
593 | 7269 |
]. |
1355 | 7270 |
inputFieldGroup add:aComponentOrSubcomponent before:anotherComponent. |
593 | 7271 |
self delegate:(KeyboardForwarder to:inputFieldGroup condition:#noFocus). |
7272 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7273 |
"/ inputFields isNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7274 |
"/ inputFields := OrderedCollection new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7275 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7276 |
"/ "/ 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
|
7277 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7278 |
"/ aComponentOrSubcomponent showCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7279 |
"/ aComponentOrSubcomponent hasKeyboardFocus:true. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7280 |
"/ ] ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7281 |
"/ aComponentOrSubcomponent hideCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7282 |
"/ aComponentOrSubcomponent hasKeyboardFocus:false. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7283 |
"/ ]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7284 |
"/ inputFields add:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7285 |
|
1355 | 7286 |
"Modified: 18.10.1997 / 02:47:20 / cg" |
7287 |
"Created: 18.10.1997 / 03:08:51 / cg" |
|
7288 |
! |
|
7289 |
||
7290 |
removeFromInputFieldGroup:aComponentOrSubcomponent |
|
7291 |
"remove a component from the input group. |
|
7292 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7293 |
a topLevel component." |
|
7294 |
||
7295 |
inputFieldGroup isNil ifTrue:[^ self]. |
|
7296 |
inputFieldGroup remove:aComponentOrSubcomponent. |
|
7297 |
||
7298 |
"Created: 18.10.1997 / 02:51:30 / cg" |
|
593 | 7299 |
! ! |
7300 |
||
7301 |
!DialogBox methodsFor:'construction-buttons'! |
|
7302 |
||
1763 | 7303 |
addAbortAndOkButtons |
7304 |
"create both abort- and Ok Buttons" |
|
7305 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7306 |
self |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7307 |
addAbortButtonLabelled:nil; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7308 |
addOkButtonLabelled:nil |
1763 | 7309 |
! |
7310 |
||
197 | 7311 |
addAbortButton |
7312 |
"create an abortButton - to be sent from redefined initialize |
|
162 | 7313 |
methods in subclasses or when creating a box programmatically. |
7314 |
Returns the button." |
|
7315 |
||
197 | 7316 |
^ self addAbortButtonLabelled:nil |
122 | 7317 |
! |
120 | 7318 |
|
162 | 7319 |
addAbortButton:aButton |
7320 |
"add an already created abortButton - to be sent from redefined initialize |
|
7321 |
methods in subclasses or when creating a box programmatically. |
|
7322 |
Returns the button." |
|
7323 |
||
7324 |
abortButton := aButton. |
|
7325 |
aButton model:self; change:#abortPressed. |
|
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7326 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7327 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7328 |
"/ now exclusively done by the buttonPanel itself |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7329 |
|
2698 | 7330 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7331 |
"/ self addButton:aButton after:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7332 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7333 |
"/ self addButton:aButton before:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7334 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7335 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7336 |
self addButton:aButton before:nil. |
1763 | 7337 |
^ aButton. |
162 | 7338 |
|
7339 |
"Created: 17.9.1995 / 20:17:26 / claus" |
|
7340 |
! |
|
7341 |
||
122 | 7342 |
addAbortButtonLabelled:buttonLabel |
7343 |
"create an abortButton with a label - to be sent from redefined initialize |
|
7344 |
methods in subclasses or when creating a box programmatically. |
|
7345 |
A nil argument creates one with the default label. |
|
7346 |
Returns the button." |
|
7347 |
||
162 | 7348 |
|aButton| |
7349 |
||
7350 |
aButton := Button abortButton. |
|
7351 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7352 |
^ self addAbortButton:aButton |
|
7353 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7354 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7355 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7356 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7357 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7358 |
dialog addAbortButtonLabelled:'get out of here'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7359 |
dialog addOkButtonLabelled:'yes thats ok'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7360 |
dialog open. |
655 | 7361 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7362 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7363 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7364 |
"Modified: 9.2.1996 / 22:09:40 / cg" |
120 | 7365 |
! |
76 | 7366 |
|
197 | 7367 |
addButton:aButton |
7368 |
"add a button into the buttonPanel. |
|
122 | 7369 |
Returns the button." |
120 | 7370 |
|
3050 | 7371 |
"/ ^ self addButton:aButton after:nil |
7372 |
(self class defaultOKButtonAtLeft) ifFalse:[ |
|
7373 |
^ self addButton:aButton before:nil |
|
7374 |
] ifTrue:[ |
|
7375 |
^ self addButton:aButton after:nil |
|
7376 |
]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7377 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7378 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7379 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7380 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7381 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7382 |
dialog addAbortButton. |
655 | 7383 |
dialog addButton:(Button label:'foo' action:[Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7384 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7385 |
dialog open. |
655 | 7386 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7387 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7388 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7389 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7390 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7391 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7392 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7393 |
dialog addAbortButton. |
655 | 7394 |
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
|
7395 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7396 |
dialog open. |
655 | 7397 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7398 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7399 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7400 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7401 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7402 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7403 |
dialog := DialogBox new. |
655 | 7404 |
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
|
7405 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7406 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7407 |
dialog open. |
655 | 7408 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7409 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7410 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7411 |
"Modified: 9.2.1996 / 22:14:17 / cg" |
197 | 7412 |
! |
7413 |
||
7414 |
addButton:aButton after:someOtherButtonOrNil |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7415 |
"add a button into the buttonPanel. |
197 | 7416 |
If the argument someOtherButtonOrNil is nil, the button is |
7417 |
added at the end." |
|
7418 |
||
7419 |
|h| |
|
7420 |
||
7421 |
buttonPanel addSubView:aButton after:someOtherButtonOrNil. |
|
7422 |
buttonPanel subViews size > 1 ifTrue:[ |
|
1843 | 7423 |
buttonPanel horizontalLayout:#fitSpace. |
197 | 7424 |
]. |
7425 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
|
1843 | 7426 |
buttonPanel topInset:h negated |
197 | 7427 |
]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7428 |
needResize := true. |
197 | 7429 |
^ aButton |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7430 |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7431 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7432 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7433 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7434 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7435 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7436 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7437 |
dialog addButton:(Button |
1843 | 7438 |
label:'foo' |
7439 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7440 |
after:(dialog okButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7441 |
dialog open. |
655 | 7442 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7443 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7444 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7445 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7446 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7447 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7448 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7449 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7450 |
dialog addButton:(Button |
1843 | 7451 |
label:'foo' |
7452 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7453 |
after:(dialog abortButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7454 |
dialog open. |
655 | 7455 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7456 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7457 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7458 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7459 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7460 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7461 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7462 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7463 |
dialog addButton:(Button |
1843 | 7464 |
label:'foo' |
7465 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7466 |
after:nil. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7467 |
dialog open. |
655 | 7468 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7469 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7470 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7471 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
197 | 7472 |
! |
7473 |
||
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7474 |
addButton:aButton before:someOtherButtonOrNil |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7475 |
"add a button into the buttonPanel. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7476 |
If the argument someOtherButtonOrNil is nil, the button is |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7477 |
added upFront." |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7478 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7479 |
|h| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7480 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7481 |
buttonPanel addSubView:aButton before:someOtherButtonOrNil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7482 |
buttonPanel subViews size > 1 ifTrue:[ |
1843 | 7483 |
buttonPanel horizontalLayout:#fitSpace. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7484 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7485 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
1843 | 7486 |
buttonPanel topInset:h negated |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7487 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7488 |
preferredExtent := nil. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7489 |
needResize := true. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7490 |
^ aButton |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7491 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7492 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7493 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7494 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7495 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7496 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7497 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7498 |
dialog addButton:(Button |
1843 | 7499 |
label:'foo' |
7500 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7501 |
before:(dialog okButton). |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7502 |
dialog open. |
655 | 7503 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7504 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7505 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7506 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7507 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7508 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7509 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7510 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7511 |
dialog addButton:(Button |
1843 | 7512 |
label:'foo' |
7513 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7514 |
before:nil. |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7515 |
dialog open. |
655 | 7516 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7517 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7518 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7519 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7520 |
"Created: 10.2.1996 / 16:04:35 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7521 |
! |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7522 |
|
593 | 7523 |
addHelpButtonFor:pathToHelpText |
7524 |
"add a help button to the buttonPanel. |
|
7525 |
The argument, pathToHelpText should specify the path to the help |
|
7526 |
text under either the doc/online/<language> or the help/<language> |
|
7527 |
directory." |
|
7528 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7529 |
^ self addHelpButtonWithAction:[HTMLDocumentView openFullOnHelpFile:pathToHelpText]. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7530 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7531 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7532 |
|box| |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7533 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7534 |
box := DialogBox new. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7535 |
box |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7536 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7537 |
addAbortButton; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7538 |
addOkButton. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7539 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7540 |
box open |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7541 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7542 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7543 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7544 |
"Modified: / 26-01-2011 / 18:04:53 / cg" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7545 |
! |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7546 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7547 |
addHelpButtonWithAction:helpAction |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7548 |
"add a help button to the buttonPanel. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7549 |
The argument, helpAction is avaluated when clicked" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7550 |
|
593 | 7551 |
|helpButton| |
7552 |
||
2478 | 7553 |
helpButton := Button label:(resources string:'Help'). |
593 | 7554 |
helpButton action:[ |
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7555 |
self withWaitCursorDo:helpAction |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7556 |
]. |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7557 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7558 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7559 |
"/ now exclusively done by the buttonPanel itself |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7560 |
|
2698 | 7561 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7562 |
"/ self addButton:helpButton after:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7563 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7564 |
"/ self addButton:helpButton before:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7565 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7566 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7567 |
self addButton:helpButton before:nil. |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7568 |
^ helpButton |
593 | 7569 |
|
7570 |
" |
|
7571 |
|box| |
|
7572 |
||
7573 |
box := DialogBox new. |
|
7574 |
box |
|
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7575 |
addHelpButtonWithAction:[ Transcript flash ]; |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7576 |
addAbortButton; |
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7577 |
addOkButton. |
593 | 7578 |
|
7579 |
box open |
|
7580 |
" |
|
7581 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7582 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7583 |
"Created: / 26-01-2011 / 18:04:16 / cg" |
593 | 7584 |
! |
7585 |
||
2116 | 7586 |
addOK:checkBlock |
7587 |
|butt| |
|
7588 |
||
7589 |
butt := self addOkButton. |
|
7590 |
"/ what is checkBlock ? |
|
7591 |
^ butt |
|
7592 |
||
7593 |
"Modified: / 4.2.2000 / 00:09:15 / cg" |
|
7594 |
! |
|
7595 |
||
593 | 7596 |
addOkButton |
7597 |
"create an okButton - to be sent from redefined initialize |
|
7598 |
methods in subclasses or when creating a box programmatically. |
|
7599 |
Returns the button." |
|
7600 |
||
7601 |
^ self addOkButtonLabelled:nil |
|
7602 |
||
7603 |
" |
|
7604 |
|dialog| |
|
7605 |
||
7606 |
dialog := DialogBox new. |
|
7607 |
dialog addOkButton. |
|
7608 |
dialog open. |
|
655 | 7609 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7610 |
" |
7611 |
||
7612 |
"Modified: 9.2.1996 / 21:37:02 / cg" |
|
7613 |
! |
|
7614 |
||
7615 |
addOkButton:aButton |
|
7616 |
"add an already created okButton - to be sent from redefined initialize |
|
7617 |
methods in subclasses or when creating a box programmatically. |
|
7618 |
Returns the button." |
|
7619 |
||
1764 | 7620 |
"/ okButton isNil ifTrue:[ |
7621 |
okButton := aButton. |
|
7622 |
"/ ]. |
|
593 | 7623 |
aButton model:self; change:#okPressed. |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7624 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7625 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7626 |
"/ now exclusively done by the buttonPanel itself |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7627 |
|
2698 | 7628 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7629 |
"/ self addButton:aButton before:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7630 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7631 |
"/ self addButton:aButton after:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7632 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7633 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7634 |
self addButton:aButton after:nil. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7635 |
|
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7636 |
^ aButton. |
593 | 7637 |
|
7638 |
" |
|
7639 |
|dialog b| |
|
7640 |
||
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
7641 |
b := Button label:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedBy:0.5). |
593 | 7642 |
|
7643 |
dialog := DialogBox new. |
|
7644 |
dialog addOkButton:b. |
|
7645 |
dialog open. |
|
655 | 7646 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7647 |
" |
7648 |
||
7649 |
"Modified: 17.9.1995 / 20:20:41 / claus" |
|
7650 |
"Modified: 9.2.1996 / 21:38:48 / cg" |
|
7651 |
! |
|
7652 |
||
7653 |
addOkButtonLabelled:buttonLabel |
|
7654 |
"create an okButton with a label - to be sent from redefined initialize |
|
7655 |
methods in subclasses or when creating a box programmatically. |
|
7656 |
A nil argument creates one with the default text. |
|
7657 |
Returns the button." |
|
7658 |
||
7659 |
|aButton| |
|
7660 |
||
7661 |
aButton := Button okButton. |
|
7662 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7663 |
aButton isReturnButton:acceptReturnAsOK. |
|
7664 |
^ self addOkButton:aButton. |
|
7665 |
||
7666 |
" |
|
7667 |
|dialog| |
|
7668 |
||
7669 |
dialog := DialogBox new. |
|
7670 |
dialog addOkButtonLabelled:'get out of here'. |
|
7671 |
dialog open. |
|
655 | 7672 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7673 |
" |
7674 |
||
7675 |
"Modified: 9.2.1996 / 21:39:34 / cg" |
|
7676 |
! ! |
|
7677 |
||
7678 |
!DialogBox methodsFor:'construction-check & comboboxes'! |
|
7679 |
||
197 | 7680 |
addCheckBox:label on:aModel |
7681 |
"create a checkBox with label on aModel and add it. |
|
7682 |
Returns the box." |
|
7683 |
||
7684 |
^ self addCheckBox:label on:aModel tabable:true |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7685 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7686 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7687 |
|dialog check| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7688 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7689 |
check := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7690 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7691 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7692 |
dialog addCheckBox:'on or off' on:check. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7693 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7694 |
dialog open. |
655 | 7695 |
dialog accepted ifTrue:[Transcript showCR:check value]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7696 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7697 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7698 |
"Modified: 9.2.1996 / 22:15:38 / cg" |
197 | 7699 |
! |
7700 |
||
600 | 7701 |
addCheckBox:label on:aModel tabable:tabable |
7702 |
"create a checkBox with label on aModel and add it. |
|
7703 |
Returns the box." |
|
7704 |
||
7705 |
|b| |
|
7706 |
||
7707 |
b := CheckBox on:aModel. |
|
7708 |
b label:label. |
|
7709 |
self addComponent:b tabable:tabable. |
|
7710 |
^ b |
|
7711 |
||
7712 |
" |
|
7713 |
|dialog check1 check2 check3| |
|
7714 |
||
7715 |
check1 := true asValue. |
|
7716 |
check2 := false asValue. |
|
7717 |
check3 := true asValue. |
|
7718 |
||
7719 |
dialog := DialogBox new. |
|
7720 |
dialog addCheckBox:'on or off' on:check1 tabable:false. |
|
7721 |
dialog addHorizontalLine. |
|
7722 |
||
7723 |
dialog addCheckBox:'on or off' on:check2 tabable:true. |
|
7724 |
dialog addCheckBox:'on or off' on:check3 tabable:true. |
|
7725 |
dialog addOkButton. |
|
7726 |
dialog open. |
|
7727 |
" |
|
7728 |
||
7729 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
7730 |
! |
|
7731 |
||
593 | 7732 |
addComboBoxOn:aModel |
7733 |
"create a comboBoxView on aModel and add it. |
|
7734 |
Returns the comboBoxView." |
|
7735 |
||
7736 |
^ self addComboBoxOn:aModel tabable:true |
|
7737 |
||
7738 |
" |
|
7739 |
without a list, the comboBox is disabled: |
|
7740 |
||
7741 |
|box val| |
|
7742 |
||
7743 |
val := 'some input' asValue. |
|
7744 |
||
7745 |
box := Dialog new. |
|
7746 |
||
7747 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7748 |
box addVerticalSpace. |
|
7749 |
(box addComboBoxOn:val). |
|
7750 |
box addOkButton. |
|
7751 |
box open. |
|
7752 |
box accepted ifTrue:[ |
|
1401 | 7753 |
Transcript showCR:val value |
593 | 7754 |
]. |
7755 |
" |
|
7756 |
||
7757 |
"with a list, it can be pulled: |
|
7758 |
||
7759 |
|box val| |
|
7760 |
||
7761 |
val := '' asValue. |
|
7762 |
||
7763 |
box := Dialog new. |
|
7764 |
||
7765 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7766 |
box addVerticalSpace. |
|
7767 |
(box addComboBoxOn:val) list:#('one' 'two' 'three' 'four'). |
|
7768 |
box addOkButton. |
|
7769 |
box open. |
|
7770 |
box accepted ifTrue:[ |
|
1401 | 7771 |
Transcript showCR:val value |
593 | 7772 |
]. |
7773 |
" |
|
7774 |
||
7775 |
"Modified: 28.2.1996 / 15:17:39 / cg" |
|
7776 |
"Created: 4.3.1996 / 17:21:45 / cg" |
|
7777 |
! |
|
7778 |
||
7779 |
addComboBoxOn:aModel tabable:tabable |
|
7780 |
"create a comboBoxView on aModel and add it. |
|
7781 |
Returns the comboBoxView." |
|
7782 |
||
7783 |
|f| |
|
7784 |
||
7785 |
f := ComboBoxView new. |
|
7786 |
f model:aModel. |
|
7787 |
self addComponent:f tabable:tabable. |
|
7788 |
tabable ifTrue:[ |
|
1401 | 7789 |
self addToInputFieldGroup:f editor. |
593 | 7790 |
]. |
7791 |
^ f |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7792 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7793 |
" |
593 | 7794 |
without a list, the comboBox is disabled: |
7795 |
||
7796 |
|box val| |
|
7797 |
||
7798 |
val := 'some input' asValue. |
|
7799 |
||
7800 |
box := Dialog new. |
|
7801 |
||
7802 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7803 |
box addVerticalSpace. |
|
7804 |
(box addComboBoxOn:val tabable:true). |
|
7805 |
box addOkButton. |
|
7806 |
box open. |
|
7807 |
box accepted ifTrue:[ |
|
1401 | 7808 |
Transcript showCR:val value |
593 | 7809 |
]. |
7810 |
" |
|
7811 |
||
7812 |
"with a list, it can be pulled: |
|
7813 |
||
7814 |
|box val| |
|
7815 |
||
7816 |
val := '' asValue. |
|
7817 |
||
7818 |
box := Dialog new. |
|
7819 |
||
7820 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7821 |
box addVerticalSpace. |
|
7822 |
(box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7823 |
box addOkButton. |
|
7824 |
box open. |
|
7825 |
box accepted ifTrue:[ |
|
1401 | 7826 |
Transcript showCR:val value |
593 | 7827 |
]. |
7828 |
" |
|
7829 |
||
7830 |
"Modified: 4.3.1996 / 17:21:57 / cg" |
|
7831 |
! |
|
7832 |
||
7833 |
addComboListOn:aModel |
|
7834 |
"create a comboListView on aModel and add it. |
|
7835 |
Returns the comboListView." |
|
7836 |
||
7837 |
^ self addComboListOn:aModel tabable:true |
|
7838 |
||
7839 |
"without a list, the comboList is disabled: |
|
7840 |
||
7841 |
|box val| |
|
7842 |
||
7843 |
val := 'some input' asValue. |
|
7844 |
||
7845 |
box := Dialog new. |
|
7846 |
||
7847 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7848 |
box addVerticalSpace. |
|
7849 |
(box addComboListOn:val). |
|
7850 |
box addOkButton. |
|
7851 |
box open. |
|
7852 |
box accepted ifTrue:[ |
|
1401 | 7853 |
Transcript showCR:val value |
593 | 7854 |
]. |
7855 |
" |
|
7856 |
||
7857 |
"with a list, it can be pulled: |
|
7858 |
||
7859 |
|box val| |
|
7860 |
||
7861 |
val := '' asValue. |
|
7862 |
||
7863 |
box := Dialog new. |
|
7864 |
||
7865 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7866 |
box addVerticalSpace. |
|
7867 |
(box addComboListOn:val) list:#('one' 'two' 'three' 'four'). |
|
7868 |
box addOkButton. |
|
7869 |
box open. |
|
7870 |
box accepted ifTrue:[ |
|
1401 | 7871 |
Transcript showCR:val value |
593 | 7872 |
]. |
7873 |
" |
|
7874 |
||
7875 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7876 |
"Modified: 4.3.1996 / 17:22:59 / cg" |
|
7877 |
! |
|
7878 |
||
7879 |
addComboListOn:aModel tabable:tabable |
|
7880 |
"create a comboListView on aModel and add it. |
|
7881 |
Returns the comboListView." |
|
7882 |
||
7883 |
|f| |
|
7884 |
||
7885 |
f := ComboListView new. |
|
7886 |
f model:aModel. |
|
7887 |
self addComponent:f tabable:tabable. |
|
7888 |
^ f |
|
7889 |
||
7890 |
"without a list, the comboList is disabled: |
|
7891 |
||
7892 |
|box val| |
|
7893 |
||
7894 |
val := 'some input' asValue. |
|
7895 |
||
7896 |
box := Dialog new. |
|
7897 |
||
7898 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7899 |
box addVerticalSpace. |
|
7900 |
(box addComboListOn:val tabable:true). |
|
7901 |
box addOkButton. |
|
7902 |
box open. |
|
7903 |
box accepted ifTrue:[ |
|
1401 | 7904 |
Transcript showCR:val value |
593 | 7905 |
]. |
7906 |
" |
|
7907 |
||
7908 |
"with a list, it can be pulled: |
|
7909 |
||
7910 |
|box val| |
|
7911 |
||
7912 |
val := '' asValue. |
|
7913 |
||
7914 |
box := Dialog new. |
|
7915 |
||
7916 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7917 |
box addVerticalSpace. |
|
7918 |
(box addComboListOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7919 |
box addOkButton. |
|
7920 |
box open. |
|
7921 |
box accepted ifTrue:[ |
|
1401 | 7922 |
Transcript showCR:val value |
593 | 7923 |
]. |
7924 |
" |
|
7925 |
||
7926 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7927 |
"Modified: 4.3.1996 / 17:23:38 / cg" |
|
7928 |
! ! |
|
7929 |
||
7930 |
!DialogBox methodsFor:'construction-inputfields'! |
|
7931 |
||
7932 |
addFilenameInputFieldOn:aModel in:aDirectory tabable:tabable |
|
7933 |
"create a fileName input field on aModel and add it. |
|
7934 |
Returns the field. This is much like a normal input field, |
|
7935 |
but supports filename completion." |
|
7936 |
||
7937 |
|f| |
|
7938 |
||
7939 |
f := FilenameEditField new. |
|
7940 |
aDirectory notNil ifTrue:[f directory:aDirectory]. |
|
7941 |
f model:aModel. |
|
7942 |
self addInputField:f tabable:tabable. |
|
7943 |
^ f |
|
7944 |
! |
|
7945 |
||
7946 |
addInputField:aField |
|
7947 |
"add an already created input field. |
|
7948 |
Returns the field." |
|
7949 |
||
7950 |
^ self addInputField:aField tabable:true |
|
7951 |
||
7952 |
"Modified: 9.2.1996 / 20:46:16 / cg" |
|
7953 |
! |
|
7954 |
||
7955 |
addInputField:aField tabable:tabable |
|
7956 |
"add an already created input field. |
|
7957 |
If tabable is true, the field is put into a group, to allow |
|
7958 |
stepping through the fields with #Cursor/#Return keys. |
|
7959 |
Returns the field." |
|
7960 |
||
7961 |
self addComponent:aField tabable:tabable. |
|
7962 |
tabable ifTrue:[ |
|
1401 | 7963 |
self addToInputFieldGroup:aField. |
593 | 7964 |
]. |
7965 |
^ aField |
|
7966 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7967 |
"Modified: 31.5.1996 / 21:22:29 / cg" |
593 | 7968 |
! |
7969 |
||
7970 |
addInputFieldOn:aModel |
|
7971 |
"create an input field on aModel and add it. |
|
7972 |
Returns the field." |
|
7973 |
||
7974 |
^ self addInputFieldOn:aModel tabable:true |
|
7975 |
||
7976 |
" |
|
7977 |
|dialog model field| |
|
7978 |
||
7979 |
model := '' asValue. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7980 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7981 |
dialog := DialogBox new. |
593 | 7982 |
(dialog addTextLabel:'enter a string') adjust:#left. |
7983 |
||
7984 |
field := dialog addInputFieldOn:model. |
|
7985 |
||
7986 |
dialog addAbortButton; addOkButton. |
|
7987 |
dialog open. |
|
655 | 7988 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7989 |
" |
7990 |
||
7991 |
"Modified: 9.2.1996 / 21:34:14 / cg" |
|
7992 |
! |
|
7993 |
||
7994 |
addInputFieldOn:aModel tabable:tabable |
|
7995 |
"create an input field on aModel and add it. |
|
7996 |
If tabable is false, the field cannot be tabbed into |
|
7997 |
and return does not close the box. |
|
7998 |
(pointer must be moved into it). |
|
7999 |
Returns the field." |
|
8000 |
||
8001 |
|f| |
|
8002 |
||
913 | 8003 |
f := EditField model:aModel. |
593 | 8004 |
self addInputField:f tabable:tabable. |
8005 |
^ f |
|
8006 |
||
8007 |
" a non-tabable field: |
|
8008 |
||
8009 |
|dialog model field| |
|
8010 |
||
8011 |
model := '' asValue. |
|
8012 |
||
8013 |
dialog := DialogBox new. |
|
8014 |
(dialog addTextLabel:'enter a string') adjust:#left. |
|
8015 |
||
8016 |
field := dialog addInputFieldOn:model tabable:false. |
|
8017 |
||
8018 |
dialog addAbortButton; addOkButton. |
|
8019 |
dialog open. |
|
655 | 8020 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8021 |
" |
8022 |
||
8023 |
"Modified: 9.2.1996 / 21:36:16 / cg" |
|
913 | 8024 |
"Modified: 3.1.1997 / 10:24:04 / stefan" |
593 | 8025 |
! |
8026 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8027 |
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
|
8028 |
"add a label and an inputField side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8029 |
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
|
8030 |
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
|
8031 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8032 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8033 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8034 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8035 |
^ self |
1401 | 8036 |
addLabelledField:(EditField on:model) label:labelString |
8037 |
adjust:labelAdjust |
|
8038 |
tabable:tabable |
|
8039 |
from:leftX to:rightX |
|
8040 |
separateAtX:relativeX. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8041 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8042 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8043 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8044 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8045 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8046 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8047 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8048 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8049 |
field := dialog |
1401 | 8050 |
addLabelledInputField:'enter a string' |
8051 |
adjust:#left |
|
8052 |
on:model |
|
8053 |
tabable:true |
|
8054 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8055 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8056 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8057 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8058 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8059 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8060 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8061 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8062 |
|dialog model1 model2 field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8063 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8064 |
model1 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8065 |
model2 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8066 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8067 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8068 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8069 |
dialog addTextLabel:'a two-input box'. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8070 |
dialog addHorizontalLine. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8071 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8072 |
field := dialog |
1401 | 8073 |
addLabelledInputField:'string1:' |
8074 |
adjust:#right |
|
8075 |
on:model1 |
|
8076 |
tabable:true |
|
8077 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8078 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8079 |
field := dialog |
1401 | 8080 |
addLabelledInputField:'string2:' |
8081 |
adjust:#right |
|
8082 |
on:model2 |
|
8083 |
tabable:true |
|
8084 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8085 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8086 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8087 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8088 |
dialog accepted ifTrue:[ |
1401 | 8089 |
Transcript showCR:model1 value. |
8090 |
Transcript showCR:model2 value. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8091 |
]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8092 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8093 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8094 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8095 |
"Created: 3.6.1996 / 11:04:23 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8096 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8097 |
|
593 | 8098 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable separateAtX:relativeX |
8099 |
"add a label and an inputField side-by-side. |
|
8100 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
8101 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
8102 |
The inputField gets model as its model. |
|
8103 |
Return the inputField." |
|
8104 |
||
8105 |
||
8106 |
^ self |
|
1401 | 8107 |
addLabelledField:(EditField on:model) label:labelString |
8108 |
adjust:labelAdjust |
|
8109 |
tabable:tabable |
|
8110 |
separateAtX:relativeX. |
|
593 | 8111 |
|
8112 |
" |
|
8113 |
|dialog model field| |
|
8114 |
||
8115 |
model := '' asValue. |
|
8116 |
||
8117 |
dialog := DialogBox new. |
|
8118 |
||
8119 |
field := dialog |
|
1401 | 8120 |
addLabelledInputField:'enter a string' |
8121 |
adjust:#left |
|
8122 |
on:model |
|
8123 |
tabable:true |
|
8124 |
separateAtX:0.3. |
|
593 | 8125 |
|
8126 |
dialog addAbortButton; addOkButton. |
|
8127 |
dialog open. |
|
655 | 8128 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8129 |
" |
8130 |
||
8131 |
" |
|
8132 |
|dialog model1 model2 field| |
|
8133 |
||
8134 |
model1 := '' asValue. |
|
8135 |
model2 := '' asValue. |
|
8136 |
||
8137 |
dialog := DialogBox new. |
|
8138 |
||
8139 |
dialog addTextLabel:'a two-input box'. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8140 |
dialog addHorizontalLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8141 |
|
593 | 8142 |
field := dialog |
1401 | 8143 |
addLabelledInputField:'string1:' |
8144 |
adjust:#right |
|
8145 |
on:model1 |
|
8146 |
tabable:true |
|
8147 |
separateAtX:0.4. |
|
593 | 8148 |
|
8149 |
field := dialog |
|
1401 | 8150 |
addLabelledInputField:'string2:' |
8151 |
adjust:#right |
|
8152 |
on:model2 |
|
8153 |
tabable:true |
|
8154 |
separateAtX:0.4. |
|
593 | 8155 |
|
8156 |
dialog addAbortButton; addOkButton. |
|
8157 |
dialog open. |
|
8158 |
dialog accepted ifTrue:[ |
|
1401 | 8159 |
Transcript showCR:model1 value. |
8160 |
Transcript showCR:model2 value. |
|
593 | 8161 |
]. |
8162 |
" |
|
8163 |
||
8164 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
8165 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
|
8166 |
! ! |
|
8167 |
||
8168 |
!DialogBox methodsFor:'construction-layout'! |
|
8169 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8170 |
addGap |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8171 |
"VW compatibility" |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8172 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8173 |
self addGap:4 |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8174 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8175 |
|
2116 | 8176 |
addGap:pixels |
8177 |
"VW compatibility" |
|
8178 |
||
8179 |
self addVerticalSpace:pixels |
|
8180 |
||
8181 |
"Created: / 4.2.2000 / 00:03:58 / cg" |
|
8182 |
"Modified: / 5.2.2000 / 15:30:26 / cg" |
|
8183 |
! |
|
8184 |
||
593 | 8185 |
addHorizontalLine |
8186 |
"add a horizontal line as separator" |
|
8187 |
||
8188 |
^ self addComponent:(Separator new extent:1.0 @ 5). |
|
8189 |
||
8190 |
" |
|
8191 |
|dialog| |
|
8192 |
||
8193 |
dialog := DialogBox new. |
|
8194 |
dialog |
|
1401 | 8195 |
addTextLabel:'some title string'; |
8196 |
addHorizontalLine; |
|
8197 |
addTextLabel:'more text'; |
|
8198 |
addOkButton; |
|
8199 |
open. |
|
593 | 8200 |
" |
8201 |
||
8202 |
" |
|
8203 |
|dialog| |
|
8204 |
||
8205 |
dialog := DialogBox new. |
|
8206 |
dialog |
|
1401 | 8207 |
addTextLabel:'some title string'; |
8208 |
addHorizontalLine; |
|
8209 |
addTextLabel:'more text'. |
|
593 | 8210 |
(dialog addHorizontalLine) width:20. |
8211 |
dialog addTextLabel:'more text'. |
|
8212 |
(dialog addHorizontalLine) width:20. |
|
8213 |
dialog |
|
1401 | 8214 |
addTextLabel:'more text'; |
8215 |
addHorizontalLine; |
|
8216 |
addOkButton; |
|
8217 |
open. |
|
593 | 8218 |
" |
8219 |
||
8220 |
"Modified: 19.4.1996 / 15:11:30 / cg" |
|
8221 |
! |
|
8222 |
||
8223 |
addVerticalSpace |
|
8224 |
"add a default vertical space (1 mm)" |
|
8225 |
||
8226 |
self addVerticalSpace:(ViewSpacing). |
|
8227 |
||
8228 |
" |
|
8229 |
|dialog| |
|
8230 |
||
8231 |
dialog := DialogBox new. |
|
8232 |
dialog addTextLabel:'some title string'. |
|
8233 |
dialog addVerticalSpace. |
|
8234 |
dialog addTextLabel:'more text'. |
|
8235 |
||
8236 |
dialog addOkButton. |
|
8237 |
dialog open. |
|
8238 |
" |
|
8239 |
||
8240 |
"Modified: 9.2.1996 / 21:41:10 / cg" |
|
8241 |
! |
|
8242 |
||
8243 |
addVerticalSpace:nPixel |
|
8244 |
"add some pixels of space to the next component" |
|
8245 |
||
8246 |
yPosition := yPosition + nPixel. |
|
8247 |
needResize := true. |
|
8248 |
||
8249 |
" |
|
8250 |
|dialog| |
|
8251 |
||
8252 |
dialog := DialogBox new. |
|
8253 |
dialog addTextLabel:'some title string'. |
|
8254 |
dialog addVerticalSpace:50. |
|
8255 |
dialog addTextLabel:'more text'. |
|
8256 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8257 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8258 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8259 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8260 |
|
593 | 8261 |
"Modified: 9.2.1996 / 21:41:23 / cg" |
8262 |
! |
|
8263 |
||
2116 | 8264 |
bottomAlign:widgets |
8265 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8266 |
||
2145 | 8267 |
'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR. |
8268 |
"/ self halt:'unimplemented VW functionality'. |
|
2116 | 8269 |
|
8270 |
"Created: / 4.2.2000 / 00:10:21 / cg" |
|
8271 |
"Modified: / 5.2.2000 / 15:31:23 / cg" |
|
8272 |
! |
|
8273 |
||
8274 |
bottomAlignLowerEdge:widget |
|
8275 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8276 |
||
2145 | 8277 |
"/ self halt:'unimplemented VW functionality'. |
8278 |
self stickAtBottomWithVariableHeight:widget |
|
2116 | 8279 |
|
8280 |
"Modified: / 5.2.2000 / 15:31:15 / cg" |
|
8281 |
! |
|
8282 |
||
593 | 8283 |
leftIndent |
8284 |
"return the current indent |
|
8285 |
(current x position - thats where the next component will be located)." |
|
8286 |
||
8287 |
^ leftIndent |
|
8288 |
||
8289 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8290 |
! |
|
8291 |
||
8292 |
leftIndent:aNumber |
|
4145 | 8293 |
"set the left indent |
8294 |
(current x position - that's where the next component(s) will be located). |
|
8295 |
Setting this before adding a component will place it indented" |
|
593 | 8296 |
|
8297 |
leftIndent := aNumber. |
|
8298 |
needResize := true. |
|
8299 |
||
8300 |
" |
|
8301 |
|dialog| |
|
8302 |
||
8303 |
dialog := DialogBox new. |
|
8304 |
(dialog addTextLabel:'label1') adjust:#left. |
|
8305 |
dialog leftIndent:20. |
|
8306 |
(dialog addTextLabel:'label2') adjust:#left. |
|
8307 |
dialog leftIndent:40. |
|
8308 |
(dialog addTextLabel:'label3') adjust:#left. |
|
8309 |
dialog leftIndent:60. |
|
8310 |
(dialog addTextLabel:'label4') adjust:#left. |
|
8311 |
||
8312 |
dialog addOkButton. |
|
8313 |
dialog open. |
|
8314 |
" |
|
8315 |
||
8316 |
"Modified: 9.2.1996 / 21:42:20 / cg" |
|
8317 |
! |
|
8318 |
||
8319 |
rightIndent |
|
8320 |
"return the current right indent." |
|
8321 |
||
8322 |
^ rightIndent |
|
8323 |
||
8324 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8325 |
! |
|
8326 |
||
8327 |
rightIndent:aNumber |
|
8328 |
"set the right indent" |
|
8329 |
||
8330 |
rightIndent := aNumber. |
|
8331 |
needResize := true. |
|
8332 |
||
8333 |
" |
|
8334 |
|dialog| |
|
8335 |
||
8336 |
dialog := DialogBox new. |
|
8337 |
(dialog addTextLabel:'label1') adjust:#right. |
|
8338 |
dialog rightIndent:20. |
|
8339 |
(dialog addTextLabel:'label2') adjust:#right. |
|
8340 |
dialog rightIndent:40. |
|
8341 |
(dialog addTextLabel:'label3') adjust:#right. |
|
8342 |
dialog rightIndent:60. |
|
8343 |
(dialog addTextLabel:'label4') adjust:#right. |
|
8344 |
||
8345 |
dialog addOkButton. |
|
8346 |
dialog open. |
|
8347 |
" |
|
8348 |
||
8349 |
"Modified: 9.2.1996 / 21:42:46 / cg" |
|
8350 |
! |
|
8351 |
||
2116 | 8352 |
setInitialGap |
8353 |
||
8354 |
"Created: / 4.2.2000 / 00:01:44 / cg" |
|
8355 |
! |
|
8356 |
||
593 | 8357 |
stickAtBottomWithFixHeight:aComponent |
8358 |
"arrange for a component to be positioned at a constant offset |
|
8359 |
from the bottom of the box and its height to remain the same. |
|
8360 |
This will keep the component at a constant distance from the bottom |
|
2220 | 8361 |
(without this setup, it would stay at a constant offset from the top). |
8362 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8363 |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8364 |
self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0 |
593 | 8365 |
|
8366 |
" |
|
8367 |
compare the resizing behavior of: |
|
8368 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8369 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8370 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8371 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8372 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8373 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8374 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8375 |
box show |
593 | 8376 |
|
8377 |
with: |
|
8378 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8379 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8380 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8381 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8382 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8383 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8384 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8385 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8386 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8387 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8388 |
|
2220 | 8389 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8390 |
"Modified: / 18.8.2000 / 21:38:21 / cg" |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8391 |
! |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8392 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8393 |
stickAtBottomWithFixHeight:aComponent left:left right:right |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8394 |
"arrange for a component to be positioned at a constant offset |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8395 |
from the bottom of the box and its height to remain the same. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8396 |
This will keep the component at a constant distance from the bottom |
2220 | 8397 |
(without this setup, it would stay at a constant offset from the top). |
8398 |
ATTENTION: use this as a last step, after all components have been added." |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8399 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8400 |
self resize. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8401 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8402 |
aComponent |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8403 |
topInset:(self height - aComponent top) negated; |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8404 |
bottomInset:(self height - aComponent bottom); |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8405 |
origin:left @ 1.0; corner:right @ 1.0. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8406 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8407 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8408 |
compare the resizing behavior of: |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8409 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8410 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8411 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8412 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8413 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8414 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8415 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8416 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8417 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8418 |
with: |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8419 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8420 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8421 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8422 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8423 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8424 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8425 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8426 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8427 |
box show |
593 | 8428 |
" |
8429 |
||
2220 | 8430 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8431 |
"Modified: / 18.8.2000 / 21:38:26 / cg" |
|
593 | 8432 |
! |
8433 |
||
8434 |
stickAtBottomWithVariableHeight:aComponent |
|
8435 |
"arrange for a component to be positioned at a constant offset |
|
8436 |
from the bottom of the box and its height to be adjusted. |
|
8437 |
This will resize the component for a constant distance from the top, |
|
8438 |
and the bottom. |
|
2220 | 8439 |
(without this setup, its height would remain constant). |
8440 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8441 |
|
8442 |
self resize. |
|
8443 |
||
8444 |
aComponent |
|
2220 | 8445 |
bottomInset:(self height - aComponent bottom); |
8446 |
corner:1.0@1.0. |
|
593 | 8447 |
|
8448 |
" |
|
8449 |
compare the resizing behavior of: |
|
8450 |
||
2220 | 8451 |
|box| |
8452 |
||
8453 |
box := Dialog new. |
|
8454 |
box addTextLabel:'hello'. |
|
8455 |
(box addComponent:(SelectionInListView new)) level:-1. |
|
8456 |
box addOkButton. |
|
8457 |
box show |
|
593 | 8458 |
|
8459 |
with: |
|
8460 |
||
2220 | 8461 |
|box list| |
8462 |
||
8463 |
box := Dialog new. |
|
8464 |
box addTextLabel:'hello'. |
|
8465 |
list := (box addComponent:(SelectionInListView new)) level:-1. |
|
8466 |
box addOkButton. |
|
8467 |
box stickAtBottomWithVariableHeight:list. |
|
8468 |
box show |
|
593 | 8469 |
" |
8470 |
||
2220 | 8471 |
"Modified: / 18.8.2000 / 21:38:35 / cg" |
593 | 8472 |
! |
8473 |
||
8474 |
yPosition |
|
8475 |
"return the current y position (thats where the next component |
|
8476 |
will be located)." |
|
8477 |
||
8478 |
^ yPosition |
|
120 | 8479 |
! |
8480 |
||
593 | 8481 |
yPosition:aNumber |
8482 |
"set the current y position (thats where the next component |
|
8483 |
will be located)." |
|
8484 |
||
8485 |
yPosition := aNumber. |
|
8486 |
needResize := true. |
|
8487 |
||
8488 |
" |
|
8489 |
|dialog pos| |
|
8490 |
||
8491 |
dialog := DialogBox new. |
|
8492 |
pos := dialog yPosition. |
|
8493 |
(dialog addTextLabel:'label1') width:0.5. |
|
8494 |
dialog yPosition:pos. |
|
8495 |
(dialog addTextLabel:'label2') width:0.5; left:0.5. |
|
8496 |
||
8497 |
dialog addOkButton. |
|
8498 |
dialog open. |
|
8499 |
" |
|
8500 |
||
8501 |
" |
|
8502 |
|dialog pos| |
|
8503 |
||
8504 |
dialog := DialogBox new. |
|
8505 |
pos := dialog yPosition. |
|
8506 |
#('one' 'two' 'three' 'four') |
|
8507 |
with:#(0.0 0.25 0.5 0.75) do:[:lbl :x | |
|
1401 | 8508 |
dialog yPosition:pos. |
8509 |
(dialog addComponent:(Button label:lbl) tabable:true) |
|
8510 |
width:0.25; left:x. |
|
593 | 8511 |
]. |
8512 |
||
8513 |
dialog addOkButton. |
|
8514 |
dialog open. |
|
8515 |
" |
|
8516 |
||
8517 |
"Modified: 9.2.1996 / 21:46:40 / cg" |
|
8518 |
! ! |
|
8519 |
||
8520 |
!DialogBox methodsFor:'construction-lists'! |
|
8521 |
||
2116 | 8522 |
addList:listHolder lines:nLines validation:validateionBlock |
8523 |
^ self |
|
8524 |
addListBoxOn:listHolder |
|
8525 |
withNumberOfLines:nLines |
|
8526 |
hScrollable:true |
|
8527 |
vScrollable:true |
|
8528 |
||
8529 |
"Created: / 4.2.2000 / 00:04:49 / cg" |
|
8530 |
"Modified: / 4.2.2000 / 00:06:06 / cg" |
|
8531 |
! |
|
8532 |
||
593 | 8533 |
addListBoxOn:aModel |
8534 |
"add a selectionInListView to the box. |
|
8535 |
The listViews ScrollWrapper is returned" |
|
8536 |
||
8537 |
^ self |
|
1401 | 8538 |
addListBoxOn:aModel |
8539 |
withNumberOfLines:nil |
|
8540 |
hScrollable:false |
|
8541 |
vScrollable:true. |
|
593 | 8542 |
|
8543 |
" |
|
8544 |
|dialog model listView| |
|
8545 |
||
8546 |
model := SelectionInList new. |
|
8547 |
model list:#('one' 'two' 'three' 'four'). |
|
8548 |
model selectionIndex:2. |
|
8549 |
||
8550 |
dialog := DialogBox new. |
|
8551 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8552 |
||
8553 |
listView := dialog addListBoxOn:model. |
|
8554 |
||
8555 |
dialog addAbortButton; addOkButton. |
|
8556 |
dialog open. |
|
8557 |
||
655 | 8558 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8559 |
" |
8560 |
||
8561 |
"Modified: 27.4.1996 / 18:27:58 / cg" |
|
8562 |
! |
|
8563 |
||
8564 |
addListBoxOn:aModel class:aListViewClass |
|
8565 |
"create & add an instance of aListViewClass to the box. |
|
8566 |
The listViews ScrollWrapper is returned" |
|
8567 |
||
8568 |
^ self |
|
1401 | 8569 |
addListBoxOn:aModel |
8570 |
class:aListViewClass |
|
8571 |
withNumberOfLines:nil |
|
8572 |
hScrollable:false |
|
8573 |
vScrollable:true. |
|
593 | 8574 |
|
8575 |
"Created: 19.4.1996 / 13:06:14 / cg" |
|
8576 |
"Modified: 27.4.1996 / 18:27:53 / cg" |
|
8577 |
! |
|
8578 |
||
8579 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines |
|
8580 |
"create and add an instance of aListViewClass to the box. |
|
8581 |
The list has numLines (if nonNil) number of lines shown. |
|
8582 |
The listViews ScrollWrapper is returned" |
|
8583 |
||
8584 |
^ self |
|
1401 | 8585 |
addListBoxOn:aModel |
8586 |
class:aListViewClass |
|
8587 |
withNumberOfLines:numLines |
|
8588 |
hScrollable:false |
|
8589 |
vScrollable:true. |
|
593 | 8590 |
|
8591 |
"Created: 19.4.1996 / 13:05:05 / cg" |
|
8592 |
"Modified: 27.4.1996 / 18:27:48 / cg" |
|
8593 |
! |
|
8594 |
||
8595 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
766 | 8596 |
"add an instance of aListViewClass (selectionInListView) to the box. |
593 | 8597 |
The list has numLines (if nonNil) number of lines shown. |
8598 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8599 |
||
766 | 8600 |
|l| |
8601 |
||
8602 |
l := self addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs. |
|
3812
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8603 |
(aListViewClass canUnderstand:#doubleClickAction:) ifTrue:[ |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8604 |
l doubleClickAction:[:name | self okPressed]. |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8605 |
]. |
766 | 8606 |
^ l |
593 | 8607 |
|
8608 |
" |
|
8609 |
|dialog listView| |
|
8610 |
||
8611 |
dialog := DialogBox new. |
|
8612 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8613 |
||
8614 |
listView := dialog |
|
3812
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8615 |
addListBoxOn:nil |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8616 |
class:FileSelectionList |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8617 |
withNumberOfLines:10 |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8618 |
hScrollable:false |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8619 |
vScrollable:false. |
593 | 8620 |
|
8621 |
listView directory:'/etc'. |
|
8622 |
||
8623 |
dialog addAbortButton; addOkButton. |
|
8624 |
dialog open. |
|
8625 |
||
655 | 8626 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView selectionValue]. |
593 | 8627 |
" |
8628 |
||
8629 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8630 |
"Modified: 27.4.1996 / 18:26:15 / cg" |
|
766 | 8631 |
"Modified: 15.6.1996 / 00:31:20 / stefan" |
593 | 8632 |
! |
8633 |
||
8634 |
addListBoxOn:aModel withNumberOfLines:numLines |
|
8635 |
"add a selectionInListView to the box. |
|
8636 |
The list has numLines (if nonNil) number of lines shown. |
|
8637 |
The listViews ScrollWrapper is returned" |
|
8638 |
||
8639 |
^ self |
|
1401 | 8640 |
addListBoxOn:aModel |
8641 |
withNumberOfLines:numLines |
|
8642 |
hScrollable:false |
|
8643 |
vScrollable:true. |
|
593 | 8644 |
|
8645 |
" |
|
8646 |
|dialog model listView| |
|
8647 |
||
8648 |
model := SelectionInList new. |
|
8649 |
model list:#('one' 'two' 'three' 'four'). |
|
8650 |
model selectionIndex:2. |
|
8651 |
||
8652 |
dialog := DialogBox new. |
|
8653 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8654 |
||
8655 |
listView := dialog addListBoxOn:model withNumberOfLines:3. |
|
8656 |
||
8657 |
dialog addAbortButton; addOkButton. |
|
8658 |
dialog open. |
|
8659 |
||
655 | 8660 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8661 |
" |
8662 |
||
8663 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8664 |
"Modified: 27.4.1996 / 18:27:42 / cg" |
|
8665 |
! |
|
8666 |
||
8667 |
addListBoxOn:aModel withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
8668 |
"add a selectionInListView to the box. |
|
8669 |
The list has numLines (if nonNil) number of lines shown. |
|
8670 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8671 |
||
8672 |
^ self |
|
1401 | 8673 |
addListBoxOn:aModel |
8674 |
class:SelectionInListView |
|
8675 |
withNumberOfLines:numLines |
|
8676 |
hScrollable:hs |
|
8677 |
vScrollable:vs |
|
593 | 8678 |
|
8679 |
" |
|
8680 |
|dialog model listView| |
|
8681 |
||
8682 |
model := SelectionInList new. |
|
8683 |
model list:#('one' 'two' 'three' 'four'). |
|
8684 |
model selectionIndex:2. |
|
8685 |
||
8686 |
dialog := DialogBox new. |
|
8687 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8688 |
||
8689 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:true vScrollable:true. |
|
8690 |
||
8691 |
dialog addAbortButton; addOkButton. |
|
8692 |
dialog open. |
|
8693 |
||
655 | 8694 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8695 |
" |
8696 |
||
8697 |
" |
|
8698 |
|dialog model listView| |
|
8699 |
||
8700 |
model := SelectionInList new. |
|
8701 |
model list:#('one' 'two' 'three' 'four'). |
|
8702 |
model selectionIndex:2. |
|
8703 |
||
8704 |
dialog := DialogBox new. |
|
8705 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8706 |
||
8707 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:false vScrollable:false. |
|
8708 |
||
8709 |
dialog addAbortButton; addOkButton. |
|
8710 |
dialog open. |
|
8711 |
||
655 | 8712 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8713 |
" |
8714 |
||
8715 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8716 |
"Modified: 27.4.1996 / 18:26:36 / cg" |
|
8717 |
! |
|
8718 |
||
8719 |
addPopUpList:labelString on:aModel |
|
8720 |
"create a popUpList with a label on aModel and add it. |
|
8721 |
Returns the box." |
|
8722 |
||
8723 |
^ self addPopUpList:labelString on:aModel tabable:true |
|
8724 |
! |
|
8725 |
||
8726 |
addPopUpList:labelString on:aModel tabable:tabable |
|
8727 |
"create a popUpList on aModel and add it. |
|
8728 |
Returns the popUpList." |
|
8729 |
||
8730 |
|p box l| |
|
8731 |
||
8732 |
p := PopUpList on:aModel. |
|
8733 |
p resize; sizeFixed:true. |
|
8734 |
labelString notNil ifTrue:[ |
|
1401 | 8735 |
box := HorizontalPanelView new. |
8736 |
box borderWidth:0; horizontalLayout:#rightSpace. |
|
8737 |
box add:(l := Label label:labelString). |
|
8738 |
l borderWidth:0. |
|
8739 |
box add:p. |
|
593 | 8740 |
] ifFalse:[ |
1401 | 8741 |
box := p. |
593 | 8742 |
]. |
8743 |
self addComponent:box tabable:tabable tabbedComponent:p. |
|
8744 |
^ p |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
8745 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8746 |
"Modified: 31.5.1996 / 21:25:17 / cg" |
593 | 8747 |
! |
8748 |
||
8749 |
addPopUpListOn:aModel |
|
8750 |
"create a popUpList on aModel and add it. |
|
8751 |
Returns the box." |
|
8752 |
||
8753 |
^ self addPopUpList:nil on:aModel tabable:true |
|
8754 |
! |
|
8755 |
||
8756 |
addPopUpListOn:aModel tabable:tabable |
|
8757 |
"create a popUpList on aModel and add it. |
|
8758 |
Returns the popUpList." |
|
8759 |
||
8760 |
^ self addPopUpList:nil on:aModel tabable:tabable |
|
766 | 8761 |
! |
8762 |
||
4293
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8763 |
addRadioButton:labelString on:aRadioButtonGroupModel value:radioValue tabable:tabable |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8764 |
"create a radio button on aModel and add it. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8765 |
Returns the radio button." |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8766 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8767 |
|r| |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8768 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8769 |
r := RadioButton label:labelString. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8770 |
aRadioButtonGroupModel add:r value:radioValue. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8771 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8772 |
self addComponent:r tabable:tabable. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8773 |
^ r |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8774 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8775 |
"Created: / 23-07-2011 / 17:28:08 / cg" |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8776 |
! |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8777 |
|
766 | 8778 |
addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
8779 |
"add an instance of aListViewClass to the box. |
|
8780 |
The list has numLines (if nonNil) number of lines shown. |
|
8781 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8782 |
||
8783 |
|l scr h dH| |
|
8784 |
||
8785 |
l := aListViewClass new. |
|
8786 |
l model:aModel. |
|
8787 |
||
877 | 8788 |
(vs or:[hs]) ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8789 |
hs ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8790 |
scr := HVScrollableView forView:l miniScrollerH:true . |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8791 |
] ifFalse:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8792 |
scr := ScrollableView forView:l |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8793 |
]. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8794 |
scr resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8795 |
"/ Transcript show:scr height; show:' '; showCR:l height. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8796 |
dH := scr height - l height. |
766 | 8797 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8798 |
l level:-1. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8799 |
scr := l. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8800 |
dH := 0. |
766 | 8801 |
]. |
8802 |
||
8803 |
numLines notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8804 |
h := l heightForLines:numLines. |
766 | 8805 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8806 |
h := l preferredHeight |
766 | 8807 |
]. |
8808 |
self addComponent:scr withHeight:(h + dH). |
|
8809 |
^ scr |
|
8810 |
||
8811 |
" |
|
8812 |
|dialog listView| |
|
8813 |
||
8814 |
dialog := DialogBox new. |
|
8815 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8816 |
||
8817 |
listView := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8818 |
addTextBoxOn:nil |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8819 |
class:EditTextView |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8820 |
withNumberOfLines:10 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8821 |
hScrollable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8822 |
vScrollable:true. |
766 | 8823 |
|
8824 |
||
8825 |
dialog addAbortButton; addOkButton. |
|
8826 |
dialog open. |
|
8827 |
||
8828 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView contents]. |
|
8829 |
" |
|
8830 |
||
8831 |
"Created: 14.6.1996 / 23:33:47 / stefan" |
|
877 | 8832 |
"Modified: 8.11.1996 / 15:31:15 / cg" |
593 | 8833 |
! ! |
8834 |
||
8835 |
!DialogBox methodsFor:'construction-rows & columns'! |
|
8836 |
||
130 | 8837 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock |
8838 |
"add some elements in a vertical column. |
|
8839 |
Equally space elements as returned from aBlock." |
|
8840 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8841 |
self |
1401 | 8842 |
addColumn:aRow |
8843 |
fromX:leftX toX:rightX |
|
8844 |
collect:aBlock |
|
8845 |
tabable:false |
|
130 | 8846 |
|
8847 |
" |
|
8848 |
|dialog| |
|
8849 |
||
8850 |
dialog := Dialog new. |
|
8851 |
dialog |
|
1401 | 8852 |
addColumn:#('label1' 'label2' 'lbl3' 'l4' 'label5') |
8853 |
fromX:0.0 |
|
8854 |
toX:1.0 |
|
8855 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8856 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8857 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8858 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8859 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8860 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8861 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8862 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8863 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8864 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8865 |
dialog |
1401 | 8866 |
addColumn:#('label1' 'label2' 'label3' 'label4' 'label5') |
8867 |
fromX:0.25 |
|
8868 |
toX:0.75 |
|
8869 |
collect:[:label | (Label label:label) adjust:#left]. |
|
130 | 8870 |
|
8871 |
dialog addOkButton. |
|
8872 |
dialog open. |
|
8873 |
" |
|
8874 |
||
8875 |
" |
|
8876 |
|dialog y| |
|
8877 |
||
8878 |
dialog := Dialog new. |
|
8879 |
y := dialog yPosition. |
|
8880 |
dialog |
|
1401 | 8881 |
addColumn:#('a1' 'b1' 'c1' 'd1') |
8882 |
fromX:0 |
|
8883 |
toX:(1/3) |
|
8884 |
collect:[:label | Label label:label]. |
|
130 | 8885 |
|
8886 |
dialog yPosition:y. |
|
8887 |
dialog |
|
1401 | 8888 |
addColumn:#('a2' 'b2' 'c2' 'd2') |
8889 |
fromX:(1/3) |
|
8890 |
toX:(2/3) |
|
8891 |
collect:[:label | Label label:label]. |
|
130 | 8892 |
|
8893 |
dialog yPosition:y. |
|
8894 |
dialog |
|
1401 | 8895 |
addColumn:#('a3' 'b3' 'c3' 'd3') |
8896 |
fromX:(2/3) |
|
8897 |
toX:1 |
|
8898 |
collect:[:label | Label label:label]. |
|
130 | 8899 |
|
8900 |
dialog addOkButton. |
|
8901 |
dialog open. |
|
8902 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8903 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8904 |
"Modified: 9.2.1996 / 22:22:12 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8905 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8906 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8907 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8908 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8909 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8910 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8911 |
self |
1401 | 8912 |
addColumn:aRow |
8913 |
fromX:leftX toX:rightX |
|
8914 |
collect:aBlock |
|
8915 |
tabable:tabable |
|
8916 |
horizontalLayout:#fitSpace |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8917 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8918 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8919 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8920 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8921 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8922 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8923 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8924 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8925 |
dialog |
1401 | 8926 |
addColumn:#('one' 'two' 'three' 'four') |
8927 |
fromX:0 |
|
8928 |
toX:0.3 |
|
8929 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8930 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8931 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8932 |
dialog |
1401 | 8933 |
addColumn:values |
8934 |
fromX:0.3 |
|
8935 |
toX:1.0 |
|
8936 |
collect:[:value | EditField on:value] |
|
8937 |
tabable:true. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8938 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8939 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8940 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8941 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8942 |
dialog accepted ifTrue:[ |
1401 | 8943 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8944 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8945 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8946 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8947 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8948 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8949 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8950 |
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
|
8951 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8952 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8953 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8954 |
dialog |
1401 | 8955 |
addColumn:(1 to:4) |
8956 |
fromX:0 |
|
8957 |
toX:0.5 |
|
8958 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8959 |
tabable:true |
|
8960 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8961 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8962 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8963 |
dialog |
1401 | 8964 |
addColumn:(5 to:8) |
8965 |
fromX:0.5 |
|
8966 |
toX:1.0 |
|
8967 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8968 |
tabable:true |
|
8969 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8970 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8971 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8972 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8973 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8974 |
dialog accepted ifTrue:[ |
1401 | 8975 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8976 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8977 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8978 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8979 |
"Created: 9.2.1996 / 21:51:47 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8980 |
"Modified: 9.2.1996 / 22:22:02 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8981 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8982 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8983 |
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
|
8984 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8985 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8986 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8987 |
|helper component| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8988 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8989 |
helper := VerticalPanelView new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8990 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8991 |
aRow do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8992 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8993 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8994 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8995 |
tabable ifTrue:[self makeTabable:component]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8996 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8997 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8998 |
helper resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8999 |
self addComponent:helper. |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9000 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9001 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9002 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9003 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9004 |
helper horizontalLayout:hLayout. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9005 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9006 |
right:rightX asFloat; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9007 |
leftInset:leftIndent; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9008 |
rightInset:rightIndent. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9009 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9010 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9011 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9012 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9013 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9014 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9015 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9016 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9017 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9018 |
addColumn:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9019 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9020 |
toX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9021 |
collect:[:label | Label label:label]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9022 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9023 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9024 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9025 |
addColumn:values |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9026 |
fromX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9027 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9028 |
collect:[:value | EditField on:value] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9029 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9030 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9031 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9032 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9033 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9034 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9035 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9036 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9037 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9038 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9039 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9040 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9041 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9042 |
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
|
9043 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9044 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9045 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9046 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9047 |
addColumn:(1 to:4) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9048 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9049 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9050 |
collect:[:idx | CheckToggle on:(values at:idx)]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9051 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9052 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9053 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9054 |
addColumn:(5 to:8) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9055 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9056 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9057 |
collect:[:idx | CheckToggle on:(values at:idx)] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9058 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9059 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9060 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9061 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9062 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9063 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9064 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9065 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9066 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9067 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9068 |
"Modified: 9.2.1996 / 22:02:22 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9069 |
"Created: 9.2.1996 / 22:20:31 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9070 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9071 |
|
130 | 9072 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock |
9073 |
"add some elements in a horizontal row. |
|
9074 |
Equally space elements as returned from aBlock. |
|
9075 |
Advance y." |
|
9076 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9077 |
self |
1401 | 9078 |
addRow:aCol |
9079 |
fromX:leftX toX:rightX |
|
9080 |
collect:aBlock |
|
9081 |
tabable:true |
|
9082 |
horizontalLayout:#spread |
|
130 | 9083 |
|
9084 |
" |
|
9085 |
|dialog| |
|
9086 |
||
9087 |
dialog := Dialog new. |
|
9088 |
dialog |
|
1401 | 9089 |
addRow:#('a' 'b' 'c' 'd') |
9090 |
fromX:0 |
|
9091 |
toX:1 |
|
9092 |
collect:[:label | Label label:label]. |
|
130 | 9093 |
|
9094 |
dialog addOkButton. |
|
9095 |
dialog open. |
|
9096 |
" |
|
9097 |
||
9098 |
" |
|
9099 |
|dialog| |
|
9100 |
||
9101 |
dialog := Dialog new. |
|
9102 |
dialog |
|
1401 | 9103 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9104 |
fromX:0 |
|
9105 |
toX:1 |
|
9106 |
collect:[:label | Label label:label]. |
|
130 | 9107 |
|
9108 |
dialog |
|
1401 | 9109 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9110 |
fromX:0 |
|
9111 |
toX:0.5 |
|
9112 |
collect:[:label | Label label:label]. |
|
130 | 9113 |
|
9114 |
dialog |
|
1401 | 9115 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9116 |
fromX:0.5 |
|
9117 |
toX:1 |
|
9118 |
collect:[:label | Label label:label]. |
|
130 | 9119 |
|
9120 |
dialog addOkButton. |
|
9121 |
dialog open. |
|
9122 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9123 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9124 |
"Modified: 9.2.1996 / 22:25:16 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9125 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9126 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9127 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9128 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9129 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9130 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9131 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9132 |
self |
1401 | 9133 |
addRow:aCol |
9134 |
fromX:leftX toX:rightX |
|
9135 |
collect:aBlock |
|
9136 |
tabable:tabable |
|
9137 |
horizontalLayout:#spread |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9138 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9139 |
"Created: 9.2.1996 / 22:25:35 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9140 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9141 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9142 |
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
|
9143 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9144 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9145 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9146 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9147 |
^ self |
1401 | 9148 |
addRow:aCol |
9149 |
fromX:leftX toX:rightX |
|
9150 |
collect:aBlock |
|
9151 |
tabable:tabable |
|
9152 |
horizontalLayout:hLayout |
|
9153 |
verticalLayout:#fit |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9154 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9155 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9156 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9157 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9158 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9159 |
dialog |
1401 | 9160 |
addRow:#('a' 'b' 'c' 'd') |
9161 |
fromX:0 |
|
9162 |
toX:1 |
|
9163 |
collect:[:label | Label label:label] |
|
9164 |
tabable:false |
|
9165 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9166 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9167 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9168 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9169 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9170 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9171 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9172 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9173 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9174 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9175 |
dialog |
1401 | 9176 |
addRow:#('one' 'two' 'three' 'four') |
9177 |
fromX:0 |
|
9178 |
toX:1 |
|
9179 |
collect:[:label | Button label:label] |
|
9180 |
tabable:false |
|
9181 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9182 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9183 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9184 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9185 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9186 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9187 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9188 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9189 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9190 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9191 |
dialog |
1401 | 9192 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9193 |
fromX:0 |
|
9194 |
toX:1 |
|
9195 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9196 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9197 |
dialog |
1401 | 9198 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9199 |
fromX:0 |
|
9200 |
toX:0.5 |
|
9201 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9202 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9203 |
dialog |
1401 | 9204 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9205 |
fromX:0.5 |
|
9206 |
toX:1 |
|
9207 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9208 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9209 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9210 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9211 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9212 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9213 |
"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
|
9214 |
"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
|
9215 |
! |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9216 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9217 |
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
|
9218 |
"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
|
9219 |
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
|
9220 |
Advance y." |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9221 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9222 |
|helper component| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9223 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9224 |
helper := HorizontalPanelView new. |
792 | 9225 |
helper borderWidth:0. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9226 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9227 |
aCol do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9228 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9229 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9230 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9231 |
tabable ifTrue:[self makeTabable:component] |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9232 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9233 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9234 |
helper resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9235 |
self addComponent:helper. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9236 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9237 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9238 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9239 |
"/ Transcript show:'w now: '; showCR:helper preferredWidth |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9240 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9241 |
hLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9242 |
helper horizontalLayout:hLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9243 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9244 |
vLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9245 |
helper verticalLayout:vLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9246 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9247 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9248 |
right:rightX asFloat. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9249 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9250 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9251 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9252 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9253 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9254 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9255 |
addRow:#('a' 'b' 'c' 'd') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9256 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9257 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9258 |
collect:[:label | Label label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9259 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9260 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9261 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9262 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9263 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9264 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9265 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9266 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9267 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9268 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9269 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9270 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9271 |
addRow:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9272 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9273 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9274 |
collect:[:label | Button label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9275 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9276 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9277 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9278 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9279 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9280 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9281 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9282 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9283 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9284 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9285 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9286 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9287 |
addRow:#('a1' 'b1' 'c1' 'd1') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9288 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9289 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9290 |
collect:[:label | Label label:label]. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9291 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9292 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9293 |
addRow:#('a2' 'b2' 'c2' 'd2') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9294 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9295 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9296 |
collect:[:label | Label label:label]. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9297 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9298 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9299 |
addRow:#('a3' 'b3' 'c3' 'd3') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9300 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9301 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9302 |
collect:[:label | Label label:label]. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9303 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9304 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9305 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9306 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9307 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9308 |
"Created: 31.5.1996 / 20:45:31 / cg" |
792 | 9309 |
"Modified: 17.7.1996 / 12:06:08 / cg" |
76 | 9310 |
! ! |
9311 |
||
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9312 |
!DialogBox methodsFor:'explicit focus control'! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9313 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9314 |
focusOnOk |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9315 |
windowGroup focusView:okButton |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9316 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9317 |
"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
|
9318 |
! ! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9319 |
|
4227 | 9320 |
!DialogBox methodsFor:'initialization & release'! |
76 | 9321 |
|
9322 |
initialize |
|
9323 |
super initialize. |
|
9324 |
||
573 | 9325 |
"/ label := 'Dialog'. |
948 | 9326 |
acceptValue := ValueHolder newBoolean. |
76 | 9327 |
|
9328 |
acceptReturnAsOK := true. |
|
125 | 9329 |
acceptOnLeave := true. |
1757 | 9330 |
focusToOKOnLeave := DefaultFocusToOKOnLeave. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9331 |
hideOnAccept := true. |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9332 |
autoAccept := true. |
76 | 9333 |
|
9334 |
buttonPanel := HorizontalPanelView in:self. |
|
118 | 9335 |
buttonPanel |
1757 | 9336 |
origin:(0.0 @ 1.0) corner:(1.0 @ 1.0); |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9337 |
bottomInset:ViewSpacing; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9338 |
topInset:((font height + ViewSpacing) * 2) negated; |
1757 | 9339 |
borderWidth:0; |
9340 |
horizontalLayout:#spread. |
|
118 | 9341 |
|
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9342 |
"/ some viewStyles want ok to be the leftMost button. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9343 |
buttonPanel reverseOrderIfOKAtLeft:true. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9344 |
|
122 | 9345 |
yPosition := ViewSpacing. |
312
008267b920d9
allow more control over the indent when adding components
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
9346 |
leftIndent := rightIndent := (ViewSpacing // 2). |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9347 |
needResize := true. |
76 | 9348 |
|
9349 |
" |
|
9350 |
|b| |
|
9351 |
b := DialogBox new. |
|
118 | 9352 |
b addAbortButton; |
9353 |
addOkButton; |
|
9354 |
showAtPointer |
|
76 | 9355 |
" |
9356 |
" |
|
9357 |
|b| |
|
9358 |
b := DialogBox new. |
|
118 | 9359 |
b addOkButton; |
9360 |
showAtPointer |
|
9361 |
" |
|
76 | 9362 |
" |
118 | 9363 |
|b| |
9364 |
b := DialogBox new. |
|
9365 |
b addTextLabel:'hello world'; |
|
9366 |
addOkButton; |
|
9367 |
showAtPointer |
|
9368 |
" |
|
9369 |
" |
|
9370 |
|b| |
|
9371 |
b := DialogBox new. |
|
9372 |
b addTextLabel:'hello world'; |
|
9373 |
addVerticalSpace:50; |
|
9374 |
addOkButton; |
|
9375 |
showAtPointer |
|
9376 |
" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9377 |
|
1614 | 9378 |
"Modified: / 23.12.1997 / 10:05:24 / md" |
9379 |
"Modified: / 27.7.1998 / 20:16:37 / cg" |
|
76 | 9380 |
! |
9381 |
||
9382 |
reAdjustGeometry |
|
9383 |
"sent late in snapin processing - gives me a chance |
|
9384 |
to resize for changed font dimensions." |
|
9385 |
||
9386 |
super reAdjustGeometry. |
|
9387 |
okButton notNil ifTrue:[okButton resize]. |
|
9388 |
abortButton notNil ifTrue:[abortButton resize]. |
|
9389 |
self resize |
|
9390 |
! ! |
|
9391 |
||
197 | 9392 |
!DialogBox methodsFor:'private'! |
9393 |
||
9394 |
basicAddComponent:aComponent |
|
9395 |
"add a component, dont change its size" |
|
9396 |
||
9397 |
addedComponents isNil ifTrue:[ |
|
2126 | 9398 |
addedComponents := OrderedCollection new. |
197 | 9399 |
]. |
9400 |
addedComponents add:aComponent. |
|
9401 |
self addSubView:aComponent. |
|
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9402 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9403 |
needResize := true. |
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9404 |
"/ must flush any cached preferredExtent, when a component is added (for example, in an aboutToOpen callBack) |
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9405 |
preferredExtent := nil. |
197 | 9406 |
! |
9407 |
||
9408 |
hideAndEvaluate:aBlock |
|
9409 |
"if I am modal, make myself invisible and evaluate aBlock. |
|
9410 |
If nonModal, stay up, but also evaluate the block." |
|
9411 |
||
9412 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9413 |
self hide. |
197 | 9414 |
]. |
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9415 |
aBlock notNil ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9416 |
aBlock numArgs == 0 ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9417 |
aBlock value |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9418 |
] ifFalse:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9419 |
aBlock value:(self actionArgument) |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9420 |
] |
2673
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9421 |
]. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9422 |
|
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9423 |
(windowGroup isNil or:[windowGroup isModal not]) ifTrue:[ |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9424 |
self destroy. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9425 |
]. |
197 | 9426 |
|
9427 |
"Modified: 5.9.1995 / 19:06:33 / claus" |
|
9428 |
! |
|
9429 |
||
2116 | 9430 |
preOpen |
9431 |
||
9432 |
"Created: / 4.2.2000 / 00:10:48 / cg" |
|
9433 |
! |
|
9434 |
||
197 | 9435 |
realize |
9436 |
"if any inputFields where added, activate the first one" |
|
9437 |
||
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9438 |
verticalPanel notNil ifTrue:[ |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9439 |
verticalPanel extent:verticalPanel preferredExtent. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9440 |
preferredExtent := nil. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9441 |
self extent:(self preferredExtent). |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9442 |
]. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9443 |
|
1877
a46bf520f9c6
realize first, then assign focus
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9444 |
super realize. |
3467 | 9445 |
|
9446 |
buttonPanel notNil ifTrue:[ |
|
9447 |
buttonPanel subViews do:[:eachButton | |
|
9448 |
eachButton canTab:true. |
|
9449 |
] |
|
9450 |
]. |
|
9451 |
||
197 | 9452 |
inputFieldGroup notNil ifTrue:[ |
1646 | 9453 |
inputFieldGroup activateFirstIfNoCurrent |
197 | 9454 |
]. |
1646 | 9455 |
|
9456 |
"Modified: / 13.8.1998 / 21:22:40 / cg" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9457 |
! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9458 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9459 |
resize |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9460 |
needResize ifTrue:[ |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9461 |
"/ verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9462 |
"/ verticalPanel extent:verticalPanel preferredExtent. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9463 |
"/ preferredExtent := nil. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9464 |
"/ self extent:(self preferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9465 |
"/ ]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9466 |
needResize := false. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9467 |
super resize |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9468 |
] |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9469 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9470 |
"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
|
9471 |
"Modified: 27.1.1996 / 18:25:40 / cg" |
197 | 9472 |
! ! |
9473 |
||
120 | 9474 |
!DialogBox methodsFor:'queries'! |
118 | 9475 |
|
121 | 9476 |
accepted |
128 | 9477 |
"after the box has closed: |
9478 |
return true if accepted, false if canceled" |
|
125 | 9479 |
|
128 | 9480 |
^ acceptValue value |
121 | 9481 |
! |
9482 |
||
2116 | 9483 |
interfaceSpecFor:aSelector |
9484 |
"return an interface spec. |
|
9485 |
Notice - Dialog should be moved under AppModel so this becomes obsolete." |
|
9486 |
||
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9487 |
^ UISpecification from:(self specificationFor:aSelector) |
2116 | 9488 |
! |
9489 |
||
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9490 |
maxPreferredWidthOfAddedComponents |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9491 |
"helper for computing my preferred extent. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9492 |
That is the max component width" |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9493 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9494 |
^ (addedComponents ? #()) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9495 |
inject:0 |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9496 |
into:[:max :element | |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9497 |
|eExt prefWidth scale rel relX| |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9498 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9499 |
prefWidth := element preferredWidth. |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9500 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9501 |
"/ special (for your convenience) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9502 |
"/ if the element has been added with a relative width, |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9503 |
"/ scale it to get at least its preferred width |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9504 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9505 |
(rel := element relativeExtent) notNil ifTrue:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9506 |
relX := rel x. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9507 |
(relX isNil or:[relX isInteger]) ifFalse:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9508 |
prefWidth := (prefWidth * (1 / relX)) rounded |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9509 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9510 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9511 |
eExt := prefWidth + (element borderWidth * 2). "/ max:element extent x. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9512 |
max max:(eExt + element leftInset + element rightInset)]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9513 |
! |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9514 |
|
120 | 9515 |
positionOffset |
9516 |
"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
|
9517 |
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
|
9518 |
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
|
9519 |
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
|
9520 |
use my superclasses offset." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9521 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9522 |
|idx butt buttons| |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9523 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9524 |
buttonPanel notNil ifTrue:[ |
2332 | 9525 |
buttons := buttonPanel subViews. |
9526 |
buttons size > 0 ifTrue:[ |
|
2732
9a96cfc123c0
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
2718
diff
changeset
|
9527 |
idx := buttons findFirst:[:b | b isDefault]. |
2332 | 9528 |
idx ~~ 0 ifTrue:[ |
9529 |
butt := buttons at:idx. |
|
9530 |
||
9531 |
"get our size (preferredExtent) and compute |
|
9532 |
origin and extent of buttonPanel and okButton. |
|
9533 |
This is normally done on view realization." |
|
9534 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9535 |
needResize ifTrue:[ self resize ]. |
2332 | 9536 |
buttonPanel |
9537 |
pixelOrigin:buttonPanel computeOrigin |
|
9538 |
extent:buttonPanel computeExtent. |
|
9539 |
buttonPanel setChildPositionsIfChanged. |
|
2732
9a96cfc123c0
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
2718
diff
changeset
|
9540 |
^ (butt originRelativeTo:self) + (butt extent // 2). |
2332 | 9541 |
] |
9542 |
] |
|
118 | 9543 |
]. |
913 | 9544 |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9545 |
^ super positionOffset |
912
310c4970e613
Fix #positionOffset to show 'senders' box with cursor on ok-button.
Stefan Vogel <sv@exept.de>
parents:
884
diff
changeset
|
9546 |
|
913 | 9547 |
"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
|
9548 |
"Modified: 16.1.1997 / 22:00:23 / cg" |
118 | 9549 |
! |
9550 |
||
130 | 9551 |
preferredExtent |
132 | 9552 |
"return my preferred extent. |
9553 |
That is the max component width, or my current width (default); |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9554 |
whichever is larger, by the sum of the component's heights." |
118 | 9555 |
|
120 | 9556 |
|w h p| |
118 | 9557 |
|
3756
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9558 |
"/ If I have an explicit preferredExtent.. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9559 |
explicitExtent notNil ifTrue:[ |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9560 |
^ explicitExtent |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9561 |
]. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9562 |
|
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9563 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9564 |
preferredExtent notNil ifTrue:[ |
2801 | 9565 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9566 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9567 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9568 |
h := yPosition + ViewSpacing. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9569 |
verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9570 |
"/ because the vertical panels size was not known until now, |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9571 |
"/ it was not counted in the y-position yet. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9572 |
"/ do this now. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9573 |
verticalPanel extent:(verticalPanel computePreferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9574 |
h := h + verticalPanel height. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9575 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9576 |
|
120 | 9577 |
addedComponents notNil ifTrue:[ |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9578 |
w := self maxPreferredWidthOfAddedComponents. |
120 | 9579 |
] ifFalse:[ |
3618 | 9580 |
w := super preferredExtent x. |
120 | 9581 |
]. |
132 | 9582 |
w := w max:width. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9583 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9584 |
subViews size ~~ 0 ifTrue:[ |
2801 | 9585 |
p := buttonPanel preferredExtent. |
9586 |
w := w max:p x. |
|
9587 |
h := h |
|
9588 |
+ p y |
|
9589 |
+ ViewSpacing. |
|
120 | 9590 |
]. |
118 | 9591 |
|
120 | 9592 |
"/ okButton isNil ifTrue:[ |
130 | 9593 |
"/ ^ super preferredExtent |
120 | 9594 |
"/ ]. |
130 | 9595 |
"/ p := buttonPanel preferredExtent. |
120 | 9596 |
"/ w := p x. |
9597 |
"/ h := ViewSpacing |
|
9598 |
"/ + p y |
|
9599 |
"/ + ViewSpacing. |
|
9600 |
"/ |
|
9601 |
^ w @ h |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9602 |
|
797 | 9603 |
"Modified: 19.7.1996 / 20:43:52 / cg" |
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9604 |
! |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9605 |
|
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9606 |
specificationFor:aKey |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9607 |
"return an interface specs literal encoding. |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9608 |
Notice - Dialog should be moved under AppModel so this becomes obsolete." |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9609 |
|
2568 | 9610 |
^ ApplicationModel |
9611 |
specificationFor:aKey |
|
9612 |
application:self |
|
9613 |
onDevice:(self graphicsDevice) |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9614 |
! ! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9615 |
|
197 | 9616 |
!DialogBox methodsFor:'user actions'! |
76 | 9617 |
|
197 | 9618 |
abortPressed |
9619 |
"sent by the cancel button; user pressed abort button |
|
9620 |
- hide myself and evaluate okAction" |
|
121 | 9621 |
|
197 | 9622 |
abortButton turnOffWithoutRedraw. |
9623 |
acceptValue value:false. |
|
121 | 9624 |
|
197 | 9625 |
"/ actually, only hides if I have been opened modal |
9626 |
self hideAndEvaluate:abortAction |
|
121 | 9627 |
! |
9628 |
||
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9629 |
actionArgument |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9630 |
^ nil |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9631 |
! |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9632 |
|
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9633 |
closeCancel |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9634 |
"closed via escape" |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9635 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9636 |
acceptValue value:false. |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9637 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9638 |
"/ actually, only hides if I have been opened modal |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9639 |
self hideAndEvaluate:abortAction |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9640 |
! |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9641 |
|
197 | 9642 |
doAccept |
9643 |
"let all components accept (i.e. update their model from the values), |
|
9644 |
then set my accept value to true. |
|
9645 |
This is confusing: this method was originally called #accept, |
|
9646 |
but renamed for compatibility with ST-80, where #accept returns the |
|
9647 |
accept-valueHolder (which looks like a bad name to me ...)." |
|
76 | 9648 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9649 |
autoAccept ifTrue:[ |
1401 | 9650 |
addedComponents notNil ifTrue:[ |
9651 |
addedComponents do:[:aComponent | |
|
9652 |
(aComponent respondsTo:#accept) ifTrue:[ |
|
9653 |
aComponent accept |
|
9654 |
] |
|
9655 |
] |
|
9656 |
]. |
|
197 | 9657 |
]. |
9658 |
acceptValue value:true. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9659 |
|
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9660 |
"Modified: 4.3.1996 / 12:14:56 / cg" |
128 | 9661 |
! |
9662 |
||
197 | 9663 |
keyPress:aKey x:x y:y |
2700 | 9664 |
"return-key duplicates ok-function if acceptReturnAsOK is true" |
76 | 9665 |
|
490 | 9666 |
<resource: #keyboard (#Return)> |
9667 |
||
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9668 |
|b| |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9669 |
|
3809 | 9670 |
"/ oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has |
9671 |
"/ no one to inform about RETURN/ESCAPE. So the procesing here is still needed. |
|
9672 |
||
3808
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9673 |
(aKey == #Return) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9674 |
(okButton notNil and:[okButton isReturnButton]) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9675 |
^ self okPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9676 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9677 |
(abortButton notNil and:[abortButton isReturnButton]) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9678 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9679 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9680 |
(buttonPanel notNil and:[(b := buttonPanel subViews detect:[:b | b isReturnButton] ifNone:nil) notNil]) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9681 |
b turnOnWithAction. b turnOffWithAction. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9682 |
^ self. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9683 |
] |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9684 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9685 |
|
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9686 |
(aKey == #Escape) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9687 |
(abortButton notNil) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9688 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9689 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9690 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9691 |
|
197 | 9692 |
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
|
9693 |
|
490 | 9694 |
"Modified: 7.3.1996 / 13:15:09 / cg" |
76 | 9695 |
! |
9696 |
||
197 | 9697 |
lastFieldLeft |
9698 |
"if the dialog involves input fields, this is called |
|
9699 |
when the last field is left by Return-key or NextField-key" |
|
120 | 9700 |
|
197 | 9701 |
acceptOnLeave ifTrue:[ |
1401 | 9702 |
acceptReturnAsOK ifTrue:[ |
9703 |
focusToOKOnLeave ifTrue:[ |
|
9704 |
self focusOnOk. |
|
9705 |
^ self. |
|
9706 |
]. |
|
9707 |
self okPressed |
|
9708 |
] |
|
197 | 9709 |
]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9710 |
inputFieldGroup activateFirst |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
9711 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9712 |
"Modified: 19.4.1996 / 17:09:02 / cg" |
76 | 9713 |
! |
9714 |
||
197 | 9715 |
okPressed |
9716 |
"sent by the okButton; user pressed ok-button |
|
9717 |
- make myself invisible and if an action was specified do it" |
|
128 | 9718 |
|
197 | 9719 |
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
|
9720 |
|
197 | 9721 |
self doAccept. |
9722 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9723 |
acceptCheck notNil ifTrue:[ |
302 | 9724 |
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
|
9725 |
]. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9726 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9727 |
hideOnAccept ifTrue:[ |
302 | 9728 |
"/ actually, only hides if I have been opened modal |
9729 |
self hideAndEvaluate:okAction. |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9730 |
] ifFalse:[ |
302 | 9731 |
okAction value |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9732 |
] |
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9733 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9734 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9735 |
openDialog |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9736 |
self showAtPointer. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9737 |
^ self accepted |
128 | 9738 |
! ! |
240 | 9739 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
9740 |
!DialogBox class methodsFor:'documentation'! |
240 | 9741 |
|
9742 |
version |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
9743 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.323 2012-01-23 10:53:51 cg Exp $' |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9744 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9745 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9746 |
version_CVS |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
9747 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.323 2012-01-23 10:53:51 cg Exp $' |
240 | 9748 |
! ! |
2618 | 9749 |
|
498 | 9750 |
DialogBox initialize! |