author | Claus Gittinger <cg@exept.de> |
Sat, 17 May 2014 14:38:43 +0200 | |
changeset 5028 | 394487f4945d |
parent 5017 | 3e5feb8b83da |
child 5054 | f67199960078 |
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 |
|
5011 | 1195 |
self information:aString title:aString |
197 | 1196 |
|
1197 |
" |
|
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
|
1198 |
Dialog information:'help' |
197 | 1199 |
" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1200 |
|
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1201 |
"Modified: 29.5.1996 / 15:23:03 / cg" |
197 | 1202 |
! |
1203 |
||
4208 | 1204 |
information:aString title:windowTitle |
1205 |
"launch a Dialog to tell user something" |
|
1206 |
||
1207 |
|currentScreen| |
|
1208 |
||
1209 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1210 |
^ currentScreen |
|
1211 |
nativeInformationOK:aString |
|
1212 |
title:windowTitle |
|
1213 |
]. |
|
1214 |
self showAndThenDestroyBox:(InfoBox title:aString label:windowTitle) |
|
1215 |
||
1216 |
" |
|
1217 |
Dialog information:'help' title:'Attention' |
|
1218 |
" |
|
1219 |
||
1220 |
"Created: / 22-12-2010 / 19:33:23 / cg" |
|
1221 |
! |
|
1222 |
||
5011 | 1223 |
informationText:aString title:windowTitle |
1224 |
"launch a Dialog to tell user something. |
|
1225 |
The argument aString is shown as multiline, scrollable text" |
|
1226 |
||
1227 |
|dialog textHolder| |
|
1228 |
||
1229 |
textHolder := ValueHolder new. |
|
1230 |
dialog := Dialog |
|
1231 |
forRequestText:'' editViewClass:TextView |
|
1232 |
lines:15 columns:60 |
|
1233 |
initialAnswer:aString initialSelection:nil |
|
1234 |
model:textHolder. |
|
1235 |
dialog window label:windowTitle. |
|
1236 |
dialog open. |
|
1237 |
||
1238 |
" |
|
1239 |
Dialog |
|
1240 |
informationText:(DialogBox class compiledMethodAt:#information:title:) source |
|
1241 |
title:'Hello' |
|
1242 |
" |
|
1243 |
! |
|
1244 |
||
1245 |
informationText:aString title:title windowTitle:windowTitle |
|
1246 |
"launch a Dialog to tell user something. |
|
1247 |
The argument aString is shown as multiline, scrollable text" |
|
1248 |
||
1249 |
|dialog textHolder| |
|
1250 |
||
1251 |
textHolder := ValueHolder new. |
|
1252 |
dialog := Dialog |
|
1253 |
forRequestText:title editViewClass:TextView |
|
1254 |
lines:15 columns:60 |
|
1255 |
initialAnswer:aString initialSelection:nil |
|
1256 |
model:textHolder. |
|
1257 |
dialog removeAbortButton. |
|
1258 |
dialog okButton beReturnButton. |
|
1259 |
dialog window label:windowTitle. |
|
1260 |
dialog open. |
|
1261 |
||
1262 |
" |
|
1263 |
Dialog |
|
1264 |
informationText:(DialogBox class compiledMethodAt:#information:title:) source |
|
1265 |
title:'Hello - the text is:' |
|
1266 |
windowTitle:'Hello' |
|
1267 |
" |
|
1268 |
! |
|
1269 |
||
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
|
1270 |
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
|
1271 |
"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
|
1272 |
|
2493 | 1273 |
|currentScreen| |
1274 |
||
2781 | 1275 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
2493 | 1276 |
^ currentScreen |
1277 |
nativeWarnOK:aString |
|
1278 |
title:aString |
|
1279 |
]. |
|
2439 | 1280 |
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
|
1281 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1282 |
" |
625 | 1283 |
Dialog warn:'some warning message' |
1284 |
||
1285 |
Dialog warn:('some text with italic emphasis' asText |
|
2439 | 1286 |
emphasizeFrom:16 to:22 with:#italic) |
625 | 1287 |
|
1288 |
Dialog warn:('some warning message' asText |
|
2439 | 1289 |
emphasizeAllWith:(#color->Color red)) |
625 | 1290 |
|
1291 |
Dialog warn:('some text with color emphasis' asText |
|
2439 | 1292 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
1293 |
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
|
1294 |
" |
625 | 1295 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1296 |
"Modified: 29.5.1996 / 15:23:14 / cg" |
4351 | 1297 |
! |
1298 |
||
1299 |
warn:aString title:windowTitle |
|
1300 |
"launch a Dialog to warn user" |
|
1301 |
||
1302 |
|currentScreen| |
|
1303 |
||
1304 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1305 |
^ currentScreen |
|
1306 |
nativeWarnOK:aString |
|
1307 |
title:windowTitle |
|
1308 |
]. |
|
1309 |
self showAndThenDestroyBox:(WarningBox title:aString label:windowTitle) |
|
1310 |
||
1311 |
" |
|
1312 |
Dialog warn:'some warning message' |
|
1313 |
||
1314 |
Dialog warn:('some text with italic emphasis' asText |
|
1315 |
emphasizeFrom:16 to:22 with:#italic) |
|
1316 |
||
1317 |
Dialog warn:('some warning message' asText |
|
1318 |
emphasizeAllWith:(#color->Color red)) |
|
1319 |
||
1320 |
Dialog warn:('some text with color emphasis' asText |
|
1321 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
|
1322 |
emphasizeFrom:16 to:20 with:(#color->Color red)) |
|
1323 |
" |
|
1324 |
||
1325 |
"Modified: / 29-05-1996 / 15:23:14 / cg" |
|
1326 |
"Created: / 20-01-2012 / 15:54:26 / cg" |
|
5017 | 1327 |
! |
1328 |
||
1329 |
withOptoutOption:optOutAction labelled:labelString warn:warnString |
|
1330 |
"launch a Dialog to warn user. Add a 'do not show this dialog again'-like checkbox, |
|
1331 |
and call optOutAction after the warning if checked." |
|
1332 |
||
1333 |
|holder| |
|
1334 |
||
1335 |
holder := false asValue. |
|
1336 |
Dialog aboutToOpenBoxNotificationSignal handle:[:ex | |
|
1337 |
|box| |
|
1338 |
||
1339 |
box := ex box. |
|
1340 |
box verticalPanel |
|
1341 |
add:((CheckBox label:labelString) model:holder). |
|
1342 |
] do:[ |
|
1343 |
self warn:warnString |
|
1344 |
]. |
|
1345 |
holder value ifTrue: optOutAction |
|
1346 |
||
1347 |
" |
|
1348 |
Dialog withOptoutOption:[Transcript flash] labelled:'opt out' warn:'some warning'. |
|
1349 |
" |
|
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 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1352 |
!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
|
1353 |
|
197 | 1354 |
confirm:aString |
3355 | 1355 |
"open a modal yes-no dialog. |
1356 |
Return true for yes, false for no" |
|
197 | 1357 |
|
498 | 1358 |
^ self |
3456 | 1359 |
confirm:aString |
1360 |
title:nil |
|
1361 |
yesLabel:nil noLabel:nil |
|
1362 |
initialAnswer:true. |
|
498 | 1363 |
|
197 | 1364 |
" |
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
|
1365 |
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
|
1366 |
|
655 | 1367 |
Transcript showCR:( |
2298 | 1368 |
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
|
1369 |
) |
197 | 1370 |
" |
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
|
1371 |
|
3456 | 1372 |
"Modified: / 02-03-2007 / 15:25:34 / cg" |
197 | 1373 |
! |
1374 |
||
2317 | 1375 |
confirm:aString default:what |
1376 |
"launch a Dialog, which allows user to enter yes or no. |
|
1377 |
return true for yes, false for no. |
|
1378 |
InitialAnswer must be true or false and defines which button is to be |
|
1379 |
the default (i.e. return-) button" |
|
1380 |
||
3456 | 1381 |
^ self |
1382 |
confirm:aString |
|
1383 |
title:nil |
|
1384 |
yesLabel:nil noLabel:nil |
|
1385 |
initialAnswer:what. |
|
2453 | 1386 |
|
1387 |
" |
|
1388 |
Dialog confirm:'Are you happy' default:true |
|
1389 |
||
1390 |
Dialog confirm:'Are you happy' default:false |
|
1391 |
" |
|
3456 | 1392 |
|
1393 |
"Modified: / 02-03-2007 / 15:25:23 / cg" |
|
2317 | 1394 |
! |
1395 |
||
197 | 1396 |
confirm:aString initialAnswer:what |
1397 |
"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
|
1398 |
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
|
1399 |
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
|
1400 |
the default (i.e. return-) button" |
197 | 1401 |
|
2439 | 1402 |
^ self |
1403 |
confirm:aString |
|
1404 |
title:nil |
|
3456 | 1405 |
yesLabel:nil noLabel:nil |
2439 | 1406 |
initialAnswer:what. |
197 | 1407 |
|
1408 |
" |
|
1409 |
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
|
1410 |
|
655 | 1411 |
Transcript showCR:( |
2361 | 1412 |
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
|
1413 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1414 |
|
655 | 1415 |
Transcript showCR:( |
2361 | 1416 |
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
|
1417 |
) |
197 | 1418 |
" |
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
|
1419 |
|
3456 | 1420 |
"Modified: / 02-03-2007 / 15:24:52 / cg" |
197 | 1421 |
! |
1422 |
||
2618 | 1423 |
confirm:aString initialAnswer:what noLabel:noText |
1424 |
"launch a Dialog, which allows user to enter yes or no. |
|
1425 |
return true for yes, false for no. |
|
1426 |
InitialAnswer must be true or false and defines which button is to be |
|
1427 |
the default (i.e. return-) button" |
|
1428 |
||
1429 |
^ self |
|
1430 |
confirm:aString |
|
1431 |
title:nil |
|
3456 | 1432 |
yesLabel:nil noLabel:noText |
2618 | 1433 |
initialAnswer:what. |
3456 | 1434 |
|
1435 |
"Modified: / 02-03-2007 / 15:24:49 / cg" |
|
2618 | 1436 |
! |
1437 |
||
2079 | 1438 |
confirm:aString noLabel:noText |
1439 |
"launch a Dialog, which allows user to enter yes or no. |
|
1440 |
return true for yes, false for no. |
|
1441 |
The no-button is labeled noText (for example, if you need a 'cancel' there)" |
|
1442 |
||
1443 |
^ self |
|
1444 |
confirm:aString |
|
2493 | 1445 |
title:nil |
3456 | 1446 |
yesLabel:nil noLabel:noText |
1447 |
initialAnswer:true |
|
2079 | 1448 |
|
1449 |
" |
|
1450 |
Dialog confirm:'really ?' |
|
1451 |
||
2493 | 1452 |
Dialog confirm:'really ?' noLabel:'Cancel' |
2079 | 1453 |
" |
3456 | 1454 |
|
1455 |
"Modified: / 02-03-2007 / 15:24:43 / cg" |
|
1456 |
! |
|
1457 |
||
1458 |
confirm:aString title:title |
|
1459 |
"open a modal yes-no dialog. |
|
1460 |
Return true for yes, false for no" |
|
1461 |
||
1462 |
^ self |
|
1463 |
confirm:aString |
|
1464 |
title:nil |
|
1465 |
yesLabel:nil noLabel:nil |
|
1466 |
initialAnswer:true |
|
1467 |
||
1468 |
" |
|
1469 |
Dialog confirm:'really ?' |
|
1470 |
||
1471 |
Transcript showCR:( |
|
1472 |
Dialog confirm:'are you certain ?' |
|
1473 |
) |
|
1474 |
" |
|
1475 |
||
1476 |
"Created: / 02-03-2007 / 15:21:25 / cg" |
|
2079 | 1477 |
! |
1478 |
||
1479 |
confirm:aString title:title noLabel:noText |
|
1480 |
"launch a Dialog, which allows user to enter yes or no. |
|
1481 |
return true for yes, false for no. |
|
1482 |
The no buttons label is defined by noText (for example, to make it 'cancel')." |
|
1483 |
||
1484 |
^ self |
|
2493 | 1485 |
confirm:aString |
1486 |
title:title |
|
1487 |
yesLabel:nil noLabel:noText |
|
3456 | 1488 |
initialAnswer:true |
2079 | 1489 |
|
1490 |
" |
|
1491 |
Dialog |
|
1492 |
confirm:'really ?' |
|
1493 |
title:'fooBar' |
|
2493 | 1494 |
noLabel:'Nope' |
2079 | 1495 |
" |
1496 |
||
1497 |
" |
|
1498 |
Dialog |
|
1499 |
confirm:'really ?' |
|
1500 |
title:nil |
|
2493 | 1501 |
noLabel:'Cancel' |
2079 | 1502 |
" |
3456 | 1503 |
|
1504 |
"Modified: / 02-03-2007 / 15:23:55 / cg" |
|
2079 | 1505 |
! |
1506 |
||
498 | 1507 |
confirm:aString title:title yesLabel:yesText noLabel:noText |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1508 |
"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
|
1509 |
return true for yes, false for no. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1510 |
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
|
1511 |
|
2493 | 1512 |
^ self |
1513 |
confirm:aString |
|
1514 |
title:title |
|
1515 |
yesLabel:yesText noLabel:noText |
|
1516 |
initialAnswer:true |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1517 |
|
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1518 |
" |
498 | 1519 |
Dialog |
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1520 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1521 |
title:'fooBar' |
2493 | 1522 |
yesLabel:'Oh well' |
1523 |
noLabel:'Nope' |
|
498 | 1524 |
" |
1525 |
||
881 | 1526 |
" |
1527 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1528 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1529 |
title:nil |
2493 | 1530 |
yesLabel:'Oh well' |
1531 |
noLabel:'Nope' |
|
881 | 1532 |
" |
1533 |
||
1534 |
" |
|
1535 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1536 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1537 |
title:'' |
2493 | 1538 |
yesLabel:'Oh well' |
1539 |
noLabel:'Nope' |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1540 |
" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1541 |
|
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1542 |
"Created: / 21.2.1996 / 01:10:14 / cg" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1543 |
"Modified: / 18.4.1998 / 19:25:21 / cg" |
498 | 1544 |
! |
1545 |
||
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1546 |
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
|
1547 |
"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
|
1548 |
return true for yes, false for no. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1549 |
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
|
1550 |
|
3456 | 1551 |
|box answer t currentScreen| |
1552 |
||
1553 |
t := title. |
|
1554 |
t isNil ifTrue:[ t := self classResources string:'Confirm' ]. |
|
1555 |
||
1556 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1557 |
"/ experimental |
|
1558 |
^ currentScreen |
|
1559 |
nativeConfirmYesNo:aString |
|
1560 |
title:t |
|
1561 |
initialAnswer:what |
|
1562 |
]. |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1563 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1564 |
box := YesNoBox title:aString. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1565 |
yesText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1566 |
box yesLabel:yesText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1567 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1568 |
noText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1569 |
box noLabel:noText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1570 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1571 |
answer := false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1572 |
box yesAction:[answer := true]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1573 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1574 |
box label:t. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1575 |
what == false ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1576 |
box okButton isReturnButton:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1577 |
box acceptReturnAsOK:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1578 |
box cancelButton beReturnButton. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1579 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1580 |
|
2439 | 1581 |
self showAndThenDestroyBox:box. |
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1582 |
box yesAction:nil noAction:nil. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1583 |
^ answer |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1584 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1585 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1586 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1587 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1588 |
title:'fooBar' |
2493 | 1589 |
yesLabel:'Oh well' |
1590 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1591 |
initialAnswer:true |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1592 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1593 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1594 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1595 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1596 |
title:'fooBar' |
2493 | 1597 |
yesLabel:'Oh well' |
1598 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1599 |
initialAnswer:false |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1600 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1601 |
|
3456 | 1602 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1603 |
"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
|
1604 |
! |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1605 |
|
2710 | 1606 |
confirm:msg withCancel:aBoolean |
1607 |
"launch a Dialog, which allows user to enter yes, no and optionally: cancel. |
|
1608 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1609 |
||
1610 |
aBoolean ifTrue:[ |
|
1611 |
^ Dialog confirmWithCancel:msg. |
|
1612 |
] ifFalse:[ |
|
1613 |
^ Dialog confirm:msg. |
|
1614 |
]. |
|
1615 |
||
1616 |
" |
|
1617 |
Dialog confirm:'really ?' withCancel:false |
|
1618 |
Dialog confirm:'really ?' withCancel:true |
|
1619 |
" |
|
1620 |
! |
|
1621 |
||
3357
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1622 |
confirm:msg withCancel:aBoolean default:default |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1623 |
"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
|
1624 |
return true for 'yes', false for 'no', nil for 'cancel'" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1625 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1626 |
aBoolean ifTrue:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1627 |
^ Dialog confirmWithCancel:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1628 |
] ifFalse:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1629 |
^ Dialog confirm:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1630 |
]. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1631 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1632 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1633 |
Dialog confirm:'really ?' withCancel:false |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1634 |
Dialog confirm:'really ?' withCancel:true |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1635 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1636 |
! |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1637 |
|
3382 | 1638 |
confirm:aString yesLabel:yesText |
1639 |
"launch a Dialog, which allows user to enter yes or no. |
|
1640 |
return true for yes, false for no. |
|
1641 |
The yes button's label is defined by yesText." |
|
1642 |
||
1643 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:nil |
|
1644 |
||
1645 |
" |
|
1646 |
Dialog |
|
1647 |
confirm:'really ?' |
|
1648 |
yesLabel:'Oh well' |
|
1649 |
" |
|
1650 |
||
1651 |
"Created: / 04-09-2006 / 11:18:50 / cg" |
|
1652 |
! |
|
1653 |
||
498 | 1654 |
confirm:aString yesLabel:yesText noLabel:noText |
1655 |
"launch a Dialog, which allows user to enter yes or no. |
|
1656 |
return true for yes, false for no. |
|
3382 | 1657 |
The yes/no buttons' labels are defined by yesText/noText." |
498 | 1658 |
|
1659 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText |
|
1660 |
||
1661 |
" |
|
2493 | 1662 |
Dialog |
1663 |
confirm:'really ?' |
|
1664 |
yesLabel:'Oh well' |
|
1665 |
noLabel:'Nope' |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1666 |
" |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1667 |
|
3382 | 1668 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1669 |
"Modified: / 04-09-2006 / 11:19:00 / cg" |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1670 |
! |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1671 |
|
3255 | 1672 |
confirm:aString yesLabel:yesText noLabel:noText initialAnswer:what |
1673 |
"launch a Dialog, which allows user to enter yes or no. |
|
1674 |
return true for yes, false for no. |
|
1675 |
The yes/no buttons labels are defined by yesText/noText." |
|
1676 |
||
1677 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText initialAnswer:what |
|
1678 |
||
1679 |
" |
|
1680 |
Dialog |
|
1681 |
confirm:'really ?' |
|
1682 |
yesLabel:'Oh well' |
|
1683 |
noLabel:'Nope' |
|
1684 |
initialAnswer:false |
|
1685 |
" |
|
1686 |
||
1687 |
"Created: 21.2.1996 / 01:10:14 / cg" |
|
1688 |
"Modified: 8.3.1996 / 21:15:06 / cg" |
|
1689 |
! |
|
1690 |
||
2790 | 1691 |
confirmOKCancel:aString |
1692 |
"launch a Dialog, which allows user to enter OK or Cancel. |
|
1693 |
return true for OK, false for Cancel." |
|
1694 |
||
1695 |
|resources| |
|
1696 |
||
1697 |
resources := self classResources. |
|
1698 |
^ self |
|
1699 |
confirm:aString |
|
1700 |
yesLabel:(resources string:'OK') |
|
1701 |
noLabel:(resources string:'Cancel') |
|
1702 |
||
1703 |
" |
|
1704 |
Dialog confirmOKCancel:'really ?' |
|
1705 |
" |
|
1706 |
! |
|
1707 |
||
197 | 1708 |
confirmWithCancel:aString |
1709 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1710 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1711 |
||
3456 | 1712 |
^ self |
1713 |
confirmWithCancel:aString |
|
1714 |
default:nil |
|
1715 |
title:nil |
|
1004 | 1716 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1717 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1718 |
Dialog confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1719 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1720 |
|
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1721 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1722 |
Transcript showCR:( |
3456 | 1723 |
Dialog confirmWithCancel:'really ?' |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1724 |
) |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1725 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1726 |
|
3456 | 1727 |
"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
|
1728 |
! |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1729 |
|
1004 | 1730 |
confirmWithCancel:aString default:default |
1731 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1732 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1733 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1734 |
||
3456 | 1735 |
^ self |
2415 | 1736 |
confirmWithCancel:aString |
3456 | 1737 |
default:default |
1738 |
title:nil |
|
2790 | 1739 |
|
1004 | 1740 |
" |
1741 |
Dialog confirmWithCancel:'really ?' default:false |
|
2437 | 1742 |
Dialog confirmWithCancel:'really ?' default:true |
1004 | 1743 |
" |
3456 | 1744 |
|
1745 |
"Modified: / 02-03-2007 / 15:26:13 / cg" |
|
1004 | 1746 |
! |
1747 |
||
2788
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1748 |
confirmWithCancel:aString default:defaultValue onCancel:cancelValue |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1749 |
"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
|
1750 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1751 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1752 |
|answer| |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1753 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1754 |
answer := self confirmWithCancel:aString default:defaultValue. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1755 |
answer isNil ifTrue:[ |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1756 |
^ cancelValue value |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1757 |
]. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1758 |
^ answer |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1759 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1760 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1761 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1762 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1763 |
! |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1764 |
|
3456 | 1765 |
confirmWithCancel:aString default:default title:titleString |
1766 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1767 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1768 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1769 |
||
1770 |
^ self |
|
1771 |
confirmWithCancel:aString |
|
1772 |
labels:(self classResources array:#('Cancel' 'No' 'Yes') ) |
|
1773 |
values:#(nil false true) |
|
1774 |
default:(#(nil false true) indexOf:default ifAbsent:nil) |
|
1775 |
title:titleString |
|
1776 |
||
1777 |
" |
|
1778 |
Dialog confirmWithCancel:'really ?' default:false |
|
1779 |
Dialog confirmWithCancel:'really ?' default:true |
|
1780 |
" |
|
1781 |
||
1782 |
"Created: / 02-03-2007 / 15:09:56 / cg" |
|
1783 |
! |
|
1784 |
||
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1785 |
confirmWithCancel:aString labels:labelArray |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1786 |
"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
|
1787 |
Return true for 'yes', false for 'no', nil for 'cancel'. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1788 |
The default is yes. |
4682 | 1789 |
The buttons labels are given in labelArray, cancel being first, yes being last |
1790 |
(notice that the order may get reversed in some styles)" |
|
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1791 |
|
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1792 |
^ self |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1793 |
confirmWithCancel:aString |
3456 | 1794 |
labels:(self classResources array:labelArray) |
1795 |
default:3 |
|
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1796 |
" |
2493 | 1797 |
Dialog confirmWithCancel:'really ?' labels:#( 'Oops' 'Nope' 'Yea') |
4682 | 1798 |
Dialog confirmWithCancel:'really ?' |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1799 |
" |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1800 |
|
3456 | 1801 |
"Modified: / 02-03-2007 / 15:10:34 / cg" |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1802 |
! |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1803 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1804 |
confirmWithCancel:aString labels:buttonLabels default:default |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1805 |
"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
|
1806 |
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
|
1807 |
The strings for cancel, no and yes are to be passed in |
1004 | 1808 |
buttonLabels; |
1809 |
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
|
1810 |
return button (1 to 3)" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1811 |
|
1707 | 1812 |
^ self |
1813 |
confirmWithCancel:aString |
|
1814 |
labels:buttonLabels |
|
1815 |
values:#(nil false true) |
|
1816 |
default:default |
|
1817 |
||
1818 |
" |
|
1819 |
Transcript showCR:( |
|
1820 |
Dialog |
|
1821 |
confirmWithCancel:'really ?' |
|
2493 | 1822 |
labels:#('mhmh' 'Maybe' 'Definitely') |
1707 | 1823 |
default:3 |
1824 |
) |
|
1825 |
" |
|
1826 |
||
1827 |
"Created: / 18.10.1996 / 14:50:51 / cg" |
|
1828 |
"Modified: / 21.10.1998 / 15:49:16 / cg" |
|
1829 |
! |
|
1830 |
||
1831 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default |
|
1832 |
"launch a Dialog, which allows user to click on any button. |
|
1833 |
Return the corresponding value from the values array. |
|
1834 |
The labels for for the buttons are to be passed in |
|
1835 |
buttonLabels; |
|
1836 |
The default argument (if non-nil) defines the index of the |
|
1837 |
return button (1 to n)" |
|
1838 |
||
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1839 |
^ self |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1840 |
confirmWithCancel:aString |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1841 |
labels:buttonLabels |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1842 |
values:buttonValues |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1843 |
default:default |
3456 | 1844 |
title:nil |
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1845 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1846 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1847 |
Transcript showCR:( |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1848 |
Dialog |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1849 |
confirmWithCancel:'really ?' |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1850 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1851 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1852 |
default:3 |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1853 |
) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1854 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1855 |
|
3456 | 1856 |
"Created: / 18-10-1996 / 14:50:51 / cg" |
1857 |
"Modified: / 02-03-2007 / 15:09:24 / cg" |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1858 |
! |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1859 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1860 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default boxLabel:boxLabelOrNil |
3456 | 1861 |
"obsolete - for backward compatibility" |
1862 |
||
1863 |
^ self |
|
1864 |
confirmWithCancel:aString |
|
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1865 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1866 |
values:buttonValues |
3456 | 1867 |
default:default |
1868 |
title:boxLabelOrNil |
|
1869 |
||
1870 |
"Modified: / 02-03-2007 / 15:09:11 / cg" |
|
1871 |
! |
|
1872 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1873 |
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
|
1874 |
"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
|
1875 |
Return the corresponding value from the values array. |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1876 |
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
|
1877 |
buttonLabels; |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1878 |
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
|
1879 |
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
|
1880 |
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
|
1881 |
|
3701 | 1882 |
|box buttons answer i| |
197 | 1883 |
|
1708
dc23c5ca439e
fixed button-creation in confirmWithCancel.
Claus Gittinger <cg@exept.de>
parents:
1707
diff
changeset
|
1884 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1885 |
box buttonTitles:buttonLabels |
1707 | 1886 |
actions:(buttonValues collect:[:v | [answer := v]]). |
2972
d66d46e04cd4
Use #image:/#label: instead of obsolete #form:
Stefan Vogel <sv@exept.de>
parents:
2966
diff
changeset
|
1887 |
box image:(YesNoBox iconBitmap). |
3622 | 1888 |
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
|
1889 |
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
|
1890 |
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
|
1891 |
ifFalse:[ buttonValues indexOf:default]) |
3622 | 1892 |
]. |
2493 | 1893 |
box label:(boxLabelOrNil ? (self classResources string:'Confirm')). |
3701 | 1894 |
buttons := box buttons. |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1895 |
(i := buttonValues indexOf:true) ~~ 0 ifTrue:[ |
3701 | 1896 |
i <= buttons size ifTrue:[ |
1897 |
(buttons at:i) cursor:(Cursor thumbsUp). |
|
3218 | 1898 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1899 |
]. |
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1900 |
(i := buttonValues indexOf:false) ~~ 0 ifTrue:[ |
3701 | 1901 |
i <= buttons size ifTrue:[ |
1902 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1903 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1904 |
]. |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1905 |
(i := buttonValues indexOf:nil) ~~ 0 ifTrue:[ |
3701 | 1906 |
i <= buttons size ifTrue:[ |
1907 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1908 |
] |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1909 |
]. |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1910 |
checkLabelOrNil notNil ifTrue:[ |
4380
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
1911 |
box addCheckBoxAtBottom:checkLabelOrNil on:checkHolderOrNil. |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1912 |
]. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1913 |
|
2439 | 1914 |
self showAndThenDestroyBox:box. |
197 | 1915 |
box actions:nil. |
1916 |
^ answer |
|
1917 |
||
1918 |
" |
|
1707 | 1919 |
Transcript showCR:( |
1920 |
Dialog |
|
1921 |
confirmWithCancel:'really ?' |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1922 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1923 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1924 |
default:3 |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1925 |
check:'Again' on:(true asValue) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1926 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1927 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1928 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1929 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1930 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1931 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1932 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1933 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1934 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1935 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1936 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1937 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1938 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1939 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1940 |
"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
|
1941 |
! |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1942 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1943 |
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
|
1944 |
"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
|
1945 |
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
|
1946 |
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
|
1947 |
buttonLabels; |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1948 |
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
|
1949 |
return button (1 to n)" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1950 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1951 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1952 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1953 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1954 |
values:buttonValues |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1955 |
default:default |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1956 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1957 |
title:boxLabelOrNil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1958 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1959 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1960 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1961 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1962 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1963 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1964 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1965 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1966 |
title:'hello there' |
1707 | 1967 |
) |
1968 |
" |
|
1969 |
||
3456 | 1970 |
"Created: / 02-03-2007 / 15:08:49 / cg" |
2787
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1971 |
! |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1972 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1973 |
confirmWithCancel:aString onCancel:cancelValue |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1974 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1975 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1976 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1977 |
|answer| |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1978 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1979 |
answer := self confirmWithCancel:aString. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1980 |
answer isNil ifTrue:[ |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1981 |
^ cancelValue value |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1982 |
]. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1983 |
^ answer |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1984 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1985 |
" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1986 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1987 |
" |
3456 | 1988 |
! |
1989 |
||
1990 |
confirmWithCancel:aString title:titleString |
|
1991 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1992 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1993 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1994 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1995 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1996 |
default:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1997 |
title:titleString |
3456 | 1998 |
|
1999 |
" |
|
2000 |
Dialog confirmWithCancel:'really ?' |
|
2001 |
" |
|
2002 |
||
2003 |
" |
|
2004 |
Transcript showCR:( |
|
2005 |
Dialog confirmWithCancel:'really ?' |
|
2006 |
) |
|
2007 |
" |
|
2008 |
||
2009 |
"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
|
2010 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2011 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
2012 |
!DialogBox class methodsFor:'defaults'! |
573 | 2013 |
|
2014 |
defaultLabel |
|
2015 |
"return the boxes default window title." |
|
2016 |
||
2017 |
^ 'Dialog' |
|
2018 |
||
2019 |
"Created: 23.4.1996 / 17:13:10 / cg" |
|
1757 | 2020 |
! |
2021 |
||
2022 |
updateStyleCache |
|
2023 |
"extract values from the styleSheet and cache them in class variables" |
|
2024 |
||
2025 |
<resource: #style (#'dialogBox.returnShiftsFocusToOK')> |
|
2026 |
||
2027 |
DefaultFocusToOKOnLeave := StyleSheet at:'dialogBox.returnShiftsFocusToOK' default:false. |
|
2028 |
||
573 | 2029 |
! ! |
2030 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
2031 |
!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
|
2032 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2033 |
requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2034 |
"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
|
2035 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2036 |
^ self |
2825 | 2037 |
requestDirectoryName:'Select Directory' |
2038 |
default:nil |
|
2039 |
ok:nil abort:nil |
|
2040 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2041 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2042 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2043 |
Dialog requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2044 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2045 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2046 |
"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
|
2047 |
"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
|
2048 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2049 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2050 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2051 |
"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
|
2052 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2053 |
^ self |
2825 | 2054 |
requestDirectoryName:title |
2055 |
default:nil |
|
2056 |
ok:nil abort:nil |
|
2057 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2058 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2059 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2060 |
Dialog |
2825 | 2061 |
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
|
2062 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2063 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2064 |
"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
|
2065 |
"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
|
2066 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2067 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2068 |
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
|
2069 |
"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
|
2070 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2071 |
^ self |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2072 |
requestDirectoryName:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2073 |
default:aFileName |
2825 | 2074 |
ok:nil abort:nil |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2075 |
ifFail:'' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2076 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2077 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2078 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2079 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2080 |
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
|
2081 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2082 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2083 |
"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
|
2084 |
"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
|
2085 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2086 |
|
2966 | 2087 |
requestDirectoryName:title default:aFileName acceptReturnAsOK:aBoolean |
2088 |
"same as requestFileName, but only show directories" |
|
2089 |
||
2090 |
^ self |
|
2091 |
requestDirectoryName:title |
|
2092 |
default:aFileName |
|
2093 |
ok:nil abort:nil |
|
2094 |
ifFail:'' |
|
2095 |
acceptReturnAsOK:aBoolean |
|
2096 |
||
2097 |
" |
|
2098 |
Dialog |
|
2099 |
requestDirectoryName:'which directory ?' |
|
2100 |
default:'/etc' |
|
2101 |
" |
|
2102 |
||
2103 |
"Created: 19.4.1996 / 14:29:10 / cg" |
|
2104 |
"Modified: 19.4.1996 / 14:31:52 / cg" |
|
2105 |
! |
|
2106 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2107 |
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
|
2108 |
"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
|
2109 |
|
2825 | 2110 |
^ self |
2111 |
requestDirectoryName:title |
|
2112 |
default:aFileName |
|
2113 |
ok:nil abort:nil |
|
2114 |
ifFail:failBlock |
|
2115 |
||
2116 |
" |
|
2117 |
Dialog |
|
2118 |
requestDirectoryName:'which directory ?' |
|
2119 |
default:'/etc' |
|
2120 |
ifFail:'none' 'none' |
|
2121 |
" |
|
2122 |
||
2123 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2124 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2125 |
! |
|
2126 |
||
2127 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText |
|
2128 |
"same as requestFileName, but only show directories" |
|
2129 |
||
2130 |
^ self |
|
2131 |
requestDirectoryName:title |
|
2132 |
default:aFileName |
|
2133 |
ok:okText abort:abortText |
|
2134 |
ifFail:'' |
|
2135 |
||
2136 |
" |
|
2137 |
Dialog |
|
2138 |
requestDirectoryName:'which directory ?' |
|
2139 |
default:'/etc' |
|
2140 |
ok:'Yes' abort:'No' |
|
2141 |
" |
|
2142 |
||
2143 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2144 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2145 |
! |
|
2146 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2147 |
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
|
2148 |
"Same as requestFileName, but only show directories." |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2149 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2150 |
^ self |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2151 |
requestDirectoryName:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2152 |
default:aFileName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2153 |
ok:okText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2154 |
abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2155 |
ifFail:failBlock |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2156 |
acceptReturnAsOK:false |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2157 |
|
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2158 |
"Modified (format): / 23-01-2012 / 11:46:08 / cg" |
2966 | 2159 |
! |
2160 |
||
2161 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
|
2162 |
"Same as requestFileName, but only show directories. |
|
2163 |
Extended to accept return as ok if wanted." |
|
2825 | 2164 |
|
2165 |
|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
|
2166 |
|
2621 | 2167 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2168 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2169 |
^ "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
|
2170 |
] |
2621 | 2171 |
]. |
2789 | 2172 |
|
2173 |
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
|
2174 |
fileBox := FileSelectionBox |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2175 |
title:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2176 |
action:[:fileName | enteredName := fileName]. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2177 |
|
3352 | 2178 |
fileBox acceptReturnAsOK:aBoolean. |
2966 | 2179 |
|
2825 | 2180 |
okText notNil |
2181 |
ifTrue:[ t := okText ] |
|
2182 |
ifFalse:[ t := resources string:'OK' ]. |
|
2183 |
fileBox okText:t. |
|
2184 |
||
2185 |
abortText notNil |
|
2186 |
ifTrue:[ t := abortText ] |
|
2187 |
ifFalse:[ t := resources string:'Cancel' ]. |
|
2188 |
fileBox abortText:t. |
|
2189 |
||
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2190 |
fN := aFileName. |
1780
bfc30a82aae3
dont get confused with a nil default
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
2191 |
dirF := (aFileName ? '.') asFilename. |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2192 |
dirF name = dirF baseName ifFalse:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2193 |
dir := dirF directoryName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2194 |
fN := dirF baseName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2195 |
] ifTrue:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2196 |
dir := FileSelectionBox lastFileSelectionDirectory. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2197 |
]. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2198 |
dir notNil ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2199 |
fileBox directory:dir. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2200 |
]. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2201 |
|
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2202 |
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
|
2203 |
fileBox selectingDirectory:true. |
2439 | 2204 |
|
2205 |
self showAndThenDestroyBox:fileBox. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2206 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2207 |
(enteredName isEmptyOrNil) ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2208 |
^ failBlock value |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2209 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2210 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2211 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2212 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2213 |
^ enteredName |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2214 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2215 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2216 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2217 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2218 |
default:'/etc' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2219 |
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
|
2220 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2221 |
|
3352 | 2222 |
"Created: / 19-04-1996 / 14:31:04 / cg" |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2223 |
"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
|
2224 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2225 |
|
2631 | 2226 |
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2227 |
"same as requestFileName, but only show directories" |
|
2228 |
||
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2229 |
UserPreferences current useNewFileDialog ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2230 |
FileDialog notNil ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2231 |
^ FileDialog |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2232 |
requestDirectoryName:titleString |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2233 |
default:aFileName |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2234 |
ok:okText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2235 |
abort:abortText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2236 |
version:versionSymbol |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2237 |
pattern:pattern |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2238 |
fromDirectory:aDirectoryPath |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2239 |
ifFail:failBlock |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2240 |
whenBoxCreatedEvaluate:boxCreatedCallback |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2241 |
asLoadDialog:aBoolean. |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2242 |
]. |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2243 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2244 |
^ self |
2631 | 2245 |
requestDirectoryName:titleString |
2246 |
default:aFileName |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2247 |
ok:okText abort:abortText |
2631 | 2248 |
ifFail:failBlock |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2249 |
acceptReturnAsOK:true |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2250 |
|
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2251 |
"Modified: / 23-01-2012 / 17:23:27 / cg" |
2631 | 2252 |
! |
2253 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2254 |
requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2255 |
"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
|
2256 |
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
|
2257 |
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
|
2258 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2259 |
^ self |
1401 | 2260 |
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
|
2261 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2262 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2263 |
Dialog requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2264 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2265 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2266 |
"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
|
2267 |
"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
|
2268 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2269 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2270 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2271 |
"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
|
2272 |
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
|
2273 |
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
|
2274 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2275 |
^ self |
1401 | 2276 |
requestFileName:titleString |
2277 |
default:'file.ext' |
|
183 | 2278 |
|
197 | 2279 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2280 |
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
|
2281 |
Dialog requestFileName:'enter a fileName:' |
183 | 2282 |
" |
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
|
2283 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2284 |
"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
|
2285 |
"Modified: 19.4.1996 / 13:53:17 / cg" |
118 | 2286 |
! |
2287 |
||
100 | 2288 |
requestFileName:titleString default:defaultName |
2289 |
"launch a Dialog, which allows user to enter a filename. |
|
2290 |
The box will not allow pressing 'ok' without an entered string. |
|
2291 |
Return the pathname string consisting of the full pathname of the filename, |
|
2292 |
or an empty string (if cancel was pressed)." |
|
2293 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2294 |
^ self |
4357
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2295 |
requestFileName:titleString |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2296 |
default:defaultName |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2297 |
version:nil |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2298 |
ifFail:'' |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2299 |
|
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2300 |
" |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2301 |
Dialog requestFileName:'Enter a fileName:' default:'' |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2302 |
Dialog requestFileName:'Enter a fileName:' default:'Makefile.bak' |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2303 |
" |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2304 |
|
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2305 |
"Modified: / 19-04-1996 / 13:47:44 / cg" |
157138969646
comment/format in: #requestFileName:default:
Claus Gittinger <cg@exept.de>
parents:
4354
diff
changeset
|
2306 |
"Modified (comment): / 23-01-2012 / 18:02:51 / cg" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2307 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2308 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2309 |
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
|
2310 |
"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
|
2311 |
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
|
2312 |
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
|
2313 |
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
|
2314 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2315 |
^ self |
4181 | 2316 |
requestFileName:titleString |
2317 |
default:defaultName |
|
2318 |
version:nil |
|
2319 |
ifFail:'' |
|
2320 |
pattern:nil |
|
2321 |
fromDirectory:aDirectoryPath |
|
2322 |
forSave:false |
|
2323 |
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
|
2324 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2325 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2326 |
Dialog |
4181 | 2327 |
requestFileName:'enter a fileName:' |
2328 |
default:'Makefile.bak' |
|
2329 |
fromDirectory:'..' |
|
2330 |
" |
|
2331 |
||
2332 |
"Modified: / 27-10-2010 / 10:40:42 / cg" |
|
100 | 2333 |
! |
2334 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2335 |
requestFileName:titleString default:defaultName ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2336 |
"launch a Dialog, which allows user to enter a filename. |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2337 |
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
|
2338 |
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
|
2339 |
or an empty string (if cancel was pressed)." |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2340 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2341 |
^ self |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2342 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2343 |
default:defaultName |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2344 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2345 |
ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2346 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2347 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2348 |
Dialog requestFileName:'enter a fileName:' default:'' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2349 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2350 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2351 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2352 |
"Modified: 19.4.1996 / 13:47:44 / cg" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2353 |
! |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2354 |
|
1736 | 2355 |
requestFileName:titleString default:defaultName ifFail:failReturn pattern:pattern fromDirectory:dir |
2356 |
"launch a Dialog, which allows user to enter a filename. |
|
2357 |
The files presented initially are those from dir. |
|
2358 |
The box will show ok/cancel in its buttons. |
|
2359 |
The matchPattern is set to pattern initially. |
|
2360 |
Return the string or failReturn if cancel was pressed." |
|
2361 |
||
2362 |
^ self |
|
2363 |
requestFileName:titleString |
|
2364 |
default:defaultName |
|
2365 |
version:nil |
|
2366 |
ifFail:failReturn |
|
2367 |
pattern:pattern |
|
2368 |
fromDirectory:dir |
|
2369 |
||
2370 |
! |
|
2371 |
||
2825 | 2372 |
requestFileName:titleString default:defaultName ok:okText abort:abortText |
2373 |
"launch a Dialog, which allows user to enter a filename. |
|
2374 |
The files presented initially are those from the current directory. |
|
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 abort:abortText |
|
2383 |
pattern:'*' |
|
2384 |
||
2385 |
" |
|
2386 |
Dialog |
|
2387 |
requestFileName:'enter a fileName:' |
|
2388 |
default:'' |
|
2389 |
ok:'yeah' |
|
2390 |
abort:'oh, no' |
|
2391 |
" |
|
2392 |
! |
|
2393 |
||
197 | 2394 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
2395 |
"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
|
2396 |
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
|
2397 |
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
|
2398 |
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
|
2399 |
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
|
2400 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2401 |
^ self |
1401 | 2402 |
requestFileName:titleString |
2403 |
default:defaultName |
|
2404 |
ok:okText |
|
2405 |
abort:abortText |
|
2406 |
pattern:pattern |
|
2407 |
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
|
2408 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2409 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2410 |
Dialog |
1401 | 2411 |
requestFileName:'enter a fileName:' |
2412 |
default:'' |
|
2413 |
ok:'yeah' |
|
2414 |
abort:'oh, no' |
|
2415 |
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
|
2416 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2417 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2418 |
"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
|
2419 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2420 |
|
2218 | 2421 |
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
|
2422 |
"launch a Dialog, which allows user to enter a filename. |
2218 | 2423 |
The files presented initially are those in aDirectoryPathOrNil, or the |
2424 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
197 | 2425 |
The box will show okText in its okButton, abortText in the abortButton. |
2426 |
The matchPattern is set to pattern initially. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2427 |
Return the string, or nil if cancel was pressed." |
197 | 2428 |
|
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2429 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2430 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2431 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2432 |
ok:okText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2433 |
abort:abortText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2434 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2435 |
fromDirectory:aDirectoryPathOrNil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2436 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2437 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2438 |
|
4181 | 2439 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil forSave:forSave |
2440 |
"launch a Dialog, which allows user to enter a filename. |
|
2441 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2442 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2443 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2444 |
The matchPattern is set to pattern initially. |
|
2445 |
Return the string, or nil if cancel was pressed." |
|
2446 |
||
2447 |
^ self |
|
2448 |
requestFileName:titleString |
|
2449 |
default:defaultName |
|
2450 |
ok:okText |
|
2451 |
abort:abortText |
|
2452 |
pattern:pattern |
|
2453 |
fromDirectory:aDirectoryPathOrNil |
|
2454 |
forSave:forSave |
|
2455 |
whenBoxCreatedEvaluate:nil |
|
2456 |
||
2457 |
"Created: / 27-10-2010 / 11:22:58 / cg" |
|
2458 |
! |
|
2459 |
||
2460 |
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
|
2461 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2462 |
The files presented initially are those in aDirectoryPathOrNil, or the |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2463 |
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
|
2464 |
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
|
2465 |
The matchPattern is set to pattern initially. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2466 |
Return the string, or nil if cancel was pressed." |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2467 |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2468 |
|box defaultDir defaultNm dir enteredName| |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2469 |
|
4164 | 2470 |
Screen current nativeFileDialogs ifTrue:[ |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2471 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2472 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2473 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2474 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2475 |
save:forSave |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2476 |
title:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2477 |
inDirectory:aDirectoryPathOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2478 |
initialAnswer:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2479 |
filter:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2480 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2481 |
]. |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2482 |
]. |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2483 |
]. |
2620 | 2484 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2485 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2486 |
^ FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2487 |
requestFileName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2488 |
default:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2489 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2490 |
pattern:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2491 |
fromDirectory:aDirectoryPathOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2492 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2493 |
] |
2620 | 2494 |
]. |
2495 |
||
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2496 |
defaultNm := defaultName. |
2218 | 2497 |
defaultDir := aDirectoryPathOrNil. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2498 |
defaultDir isNil ifTrue:[ |
2218 | 2499 |
defaultNm notNil ifTrue:[ |
2500 |
defaultDir := defaultName asFilename directoryName. |
|
2501 |
defaultNm := defaultNm asFilename baseName. |
|
2502 |
defaultDir = Filename currentDirectory name ifTrue:[ |
|
2503 |
defaultName asFilename isExplicitRelative ifFalse:[ |
|
2504 |
defaultDir := nil |
|
2505 |
] |
|
2506 |
] |
|
2507 |
]. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2508 |
]. |
197 | 2509 |
|
2510 |
box := FileSelectionBox |
|
2218 | 2511 |
title:titleString |
2512 |
okText:okText |
|
2513 |
abortText:abortText |
|
2514 |
action:[:fileName | enteredName := fileName]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2515 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2516 |
defaultDir notNil ifTrue:[ |
2218 | 2517 |
box directory:defaultDir |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2518 |
] ifFalse:[ |
2218 | 2519 |
dir := FileSelectionBox lastFileSelectionDirectory. |
2520 |
dir notNil ifTrue:[ |
|
2521 |
box directory:dir. |
|
2522 |
]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2523 |
]. |
197 | 2524 |
box pattern:pattern. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2525 |
box initialText:defaultNm. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2526 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2527 |
|
2528 |
self showAndThenDestroyBox:box. |
|
197 | 2529 |
box action:nil. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2530 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2531 |
(enteredName notEmptyOrNil) ifTrue:[ |
2218 | 2532 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2533 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2534 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2535 |
^ enteredName |
197 | 2536 |
|
2537 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2538 |
Dialog |
2218 | 2539 |
requestFileName:'enter a fileName:' |
2540 |
default:'' |
|
2541 |
ok:'yeah' |
|
2542 |
abort:'oh, no' |
|
2543 |
pattern:'rc*' |
|
2544 |
fromDirectory:'/etc' |
|
197 | 2545 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2546 |
|
4164 | 2547 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
4181 | 2548 |
"Created: / 27-10-2010 / 11:21:05 / cg" |
2549 |
! |
|
2550 |
||
2551 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
2552 |
"launch a Dialog, which allows user to enter a filename. |
|
2553 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2554 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2555 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2556 |
The matchPattern is set to pattern initially. |
|
2557 |
Return the string, or nil if cancel was pressed." |
|
2558 |
||
2559 |
^ self |
|
2560 |
requestFileName:titleString |
|
2561 |
default:defaultName |
|
2562 |
ok:okText |
|
2563 |
abort:abortText |
|
2564 |
pattern:pattern |
|
2565 |
fromDirectory:aDirectoryPathOrNil |
|
2566 |
forSave:false |
|
2567 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2568 |
||
2569 |
" |
|
2570 |
Dialog |
|
2571 |
requestFileName:'enter a fileName:' |
|
2572 |
default:'' |
|
2573 |
ok:'yeah' |
|
2574 |
abort:'oh, no' |
|
2575 |
pattern:'rc*' |
|
2576 |
fromDirectory:'/etc' |
|
2577 |
" |
|
2578 |
||
2579 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
2580 |
"Modified: / 27-10-2010 / 11:21:44 / cg" |
|
197 | 2581 |
! |
2582 |
||
2631 | 2583 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2584 |
"launch a Dialog, which allows user to enter a filename. |
|
2585 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2586 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2587 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2588 |
The matchPattern is set to pattern initially. |
|
2589 |
Return the string, or nil if cancel was pressed |
|
2590 |
The version argument allows validation of the files existance; |
|
2591 |
it may be any of: |
|
2592 |
#mustBeNew - fail (return empty string) if the file exists |
|
2593 |
#new - confirm if the file exists |
|
2594 |
#mustBeOld - fail if the file does not exist |
|
2595 |
#old - confirm if the file does not exist |
|
2596 |
#any (other) - no validation |
|
2597 |
" |
|
2598 |
||
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2599 |
UserPreferences current useNewFileDialog ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2600 |
FileDialog notNil ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2601 |
^ FileDialog |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2602 |
requestFileName:titleString |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2603 |
default:defaultName |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2604 |
ok:okText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2605 |
abort:abortText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2606 |
version:versionSymbol |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2607 |
ifFail:failBlock |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2608 |
pattern:pattern |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2609 |
fromDirectory:aDirectoryPath |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2610 |
whenBoxCreatedEvaluate:boxCreatedCallback |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2611 |
asLoadDialog:aBoolean. |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2612 |
]. |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2613 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2614 |
^ self |
2631 | 2615 |
requestFileName:titleString |
2616 |
default:defaultName |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2617 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2618 |
pattern:pattern fromDirectory:aDirectoryPath forSave:aBoolean not |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2619 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2620 |
|
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
2621 |
"Modified: / 23-01-2012 / 17:22:57 / cg" |
2631 | 2622 |
! |
2623 |
||
1030 | 2624 |
requestFileName:titleString default:defaultName pattern:pattern |
2625 |
"launch a Dialog, which allows user to enter a filename. |
|
2626 |
The files presented initially are those from the current directory. |
|
2627 |
The box will show ok/cancel in its buttons. |
|
2628 |
The matchPattern is set to pattern initially. |
|
2629 |
Return the string or nil if cancel was pressed." |
|
2630 |
||
2415 | 2631 |
|resources| |
2632 |
||
2633 |
resources := self classResources. |
|
1030 | 2634 |
^ self |
2415 | 2635 |
requestFileName:titleString |
2636 |
default:defaultName |
|
3276 | 2637 |
ok:(resources string:'OK') |
2415 | 2638 |
abort:(resources string:'Cancel') |
2639 |
pattern:pattern |
|
2640 |
fromDirectory:nil |
|
1030 | 2641 |
|
2642 |
" |
|
2643 |
Dialog |
|
2415 | 2644 |
requestFileName:'enter a fileName:' |
2645 |
default:'' |
|
2646 |
pattern:'*.st' |
|
1030 | 2647 |
" |
2648 |
" |
|
2649 |
Dialog |
|
2415 | 2650 |
requestFileName:'enter a fileName:' |
2651 |
default:'' |
|
2652 |
pattern:'*.st;*.h' |
|
1030 | 2653 |
" |
2654 |
||
2655 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2656 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2657 |
! |
|
2658 |
||
2525 | 2659 |
requestFileName:titleString default:defaultName pattern:pattern fromDirectory:aDirectory |
2660 |
"launch a Dialog, which allows user to enter a filename. |
|
2661 |
The files presented initially are those from the current directory. |
|
2662 |
The box will show ok/cancel in its buttons. |
|
2663 |
The matchPattern is set to pattern initially. |
|
2664 |
Return the string or nil if cancel was pressed." |
|
2665 |
||
2666 |
|resources| |
|
2667 |
||
2668 |
resources := self classResources. |
|
2669 |
^ self |
|
2670 |
requestFileName:titleString |
|
2671 |
default:defaultName |
|
3276 | 2672 |
ok:(resources string:'OK') |
2525 | 2673 |
abort:(resources string:'Cancel') |
2674 |
pattern:pattern |
|
2675 |
fromDirectory:aDirectory |
|
2676 |
||
2677 |
" |
|
2678 |
Dialog |
|
2679 |
requestFileName:'enter a fileName:' |
|
2680 |
default:'' |
|
2681 |
pattern:'*.st' |
|
2682 |
" |
|
2683 |
" |
|
2684 |
Dialog |
|
2685 |
requestFileName:'enter a fileName:' |
|
2686 |
default:'' |
|
2687 |
pattern:'*.st;*.h' |
|
2688 |
" |
|
2689 |
||
2690 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2691 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2692 |
! |
|
2693 |
||
100 | 2694 |
requestFileName:titleString default:defaultName version:versionSymbol |
2695 |
"launch a Dialog, which allows user to enter a filename. |
|
2696 |
The box will not allow pressing 'ok' without an entered string. |
|
2697 |
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
|
2698 |
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
|
2699 |
it may be any of: |
1401 | 2700 |
#mustBeNew - fail (return empty string) if the file exists |
2701 |
#new - confirm if the file exists |
|
2702 |
#mustBeOld - fail if the file does not exist |
|
2703 |
#old - confirm if the file does not exist |
|
2704 |
#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
|
2705 |
" |
100 | 2706 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2707 |
^ self |
1401 | 2708 |
requestFileName:titleString |
2709 |
default:defaultName |
|
2710 |
version:versionSymbol |
|
2711 |
ifFail:'' |
|
100 | 2712 |
|
2713 |
" |
|
2714 |
Dialog requestFileName:'enter a fileName:' |
|
1401 | 2715 |
default:'' |
2716 |
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
|
2717 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2718 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2719 |
default:'' |
2720 |
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
|
2721 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2722 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2723 |
default:'' |
2724 |
version:#new |
|
100 | 2725 |
" |
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
|
2726 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2727 |
"Modified: 19.4.1996 / 13:53:58 / cg" |
100 | 2728 |
! |
2729 |
||
2730 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
2731 |
"launch a Dialog, which allows user to enter a filename. |
|
2732 |
The box will not allow pressing 'ok' without an entered string. |
|
2733 |
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
|
2734 |
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
|
2735 |
it may be any of: |
1401 | 2736 |
#mustBeNew - fail (return empty string) if the file exists |
2737 |
#new - confirm if the file exists |
|
2738 |
#mustBeOld - fail if the file does not exist |
|
2739 |
#old - confirm if the file does not exist |
|
2740 |
#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
|
2741 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2742 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2743 |
^ self |
1401 | 2744 |
requestFileName:titleString |
2745 |
default:defaultName |
|
2746 |
version:versionSymbol |
|
2747 |
ifFail:failBlock |
|
2748 |
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
|
2749 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2750 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2751 |
Dialog |
1401 | 2752 |
requestFileName:'enter a fileName:' |
2753 |
default:'' |
|
2754 |
version:nil |
|
2755 |
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
|
2756 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2757 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2758 |
Dialog |
1401 | 2759 |
requestFileName:'enter a fileName:' |
2760 |
default:'' |
|
2761 |
version:#old |
|
2762 |
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
|
2763 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2764 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2765 |
"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
|
2766 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2767 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2768 |
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
|
2769 |
"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
|
2770 |
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
|
2771 |
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
|
2772 |
it may be any of: |
1736 | 2773 |
#mustBeNew - fail (return empty string) if the file exists |
2774 |
#new - confirm if the file exists |
|
2775 |
#mustBeOld - fail if the file does not exist |
|
2776 |
#old - confirm if the file does not exist |
|
2777 |
#any (other) - no validation |
|
2778 |
" |
|
2779 |
||
2780 |
^ self |
|
2781 |
requestFileName:titleString |
|
2782 |
default:defaultName |
|
2783 |
version:versionSymbol |
|
2784 |
ifFail:failBlock |
|
2785 |
pattern:nil |
|
2786 |
fromDirectory:aDirectoryPath |
|
1031 | 2787 |
|
2788 |
" |
|
2789 |
Dialog |
|
1736 | 2790 |
requestFileName:'enter a fileName:' |
2791 |
default:'' |
|
2792 |
version:nil |
|
2793 |
ifFail:['none'] |
|
2794 |
fromDirectory:'/etc' |
|
1031 | 2795 |
" |
2796 |
" |
|
2797 |
Dialog |
|
1736 | 2798 |
requestFileName:'enter a fileName:' |
2799 |
default:'' |
|
2800 |
version:#old |
|
2801 |
ifFail:['none'] |
|
2802 |
fromDirectory:'/etc' |
|
1031 | 2803 |
" |
2804 |
" |
|
2805 |
Dialog |
|
1736 | 2806 |
requestFileName:'enter a fileName:' |
2807 |
default:'' |
|
2808 |
version:#mustBeNew |
|
2809 |
ifFail:['none'] |
|
2810 |
fromDirectory:'/etc' |
|
1031 | 2811 |
" |
2812 |
||
2813 |
"Modified: 20.2.1997 / 18:12:28 / cg" |
|
2814 |
"Modified: 21.2.1997 / 14:27:27 / stefan" |
|
2815 |
! |
|
2816 |
||
2817 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
2818 |
"launch a Dialog, which allows user to enter a filename. |
|
2819 |
Return the string or the value of failBlock if cancel was pressed. |
|
2820 |
The version argument allows validation of the files existance; |
|
2821 |
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
|
2822 |
#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
|
2823 |
#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
|
2824 |
#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
|
2825 |
#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
|
2826 |
#any (other) - no validation |
1031 | 2827 |
" |
2828 |
||
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2829 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2830 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2831 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2832 |
version:versionSymbol |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2833 |
ifFail:failBlock |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2834 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2835 |
fromDirectory:aDirectoryPath |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2836 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2837 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2838 |
|
4181 | 2839 |
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
|
2840 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2841 |
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
|
2842 |
The version argument allows validation of the files existance; |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2843 |
it may be any of: |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2844 |
#mustBeNew - fail (return empty string) if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2845 |
#new - confirm if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2846 |
#mustBeOld - fail if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2847 |
#old - confirm if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2848 |
#any (other) - no validation |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2849 |
" |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2850 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2851 |
|box defaultDir defaultNm| |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2852 |
|
4164 | 2853 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 2854 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2855 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2856 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2857 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2858 |
save:forSave |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2859 |
title:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2860 |
inDirectory:aDirectoryPath |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2861 |
initialAnswer:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2862 |
filter:pattern |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2863 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2864 |
] |
3574 | 2865 |
]. |
2866 |
]. |
|
2867 |
||
2621 | 2868 |
UserPreferences current useNewFileDialog ifTrue:[ |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2869 |
FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2870 |
^ FileDialog |
2769 | 2871 |
requestFileName:titleString |
2872 |
default:defaultName |
|
2873 |
version:versionSymbol |
|
2874 |
ifFail:failBlock |
|
2875 |
pattern:pattern |
|
2876 |
fromDirectory:aDirectoryPath |
|
2877 |
whenBoxCreatedEvaluate:boxCreatedCallback. |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2878 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2879 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
2880 |
|
2773 | 2881 |
defaultName notNil ifTrue:[defaultNm := defaultName asFilename name]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2882 |
defaultDir := aDirectoryPath. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2883 |
defaultDir isNil ifTrue:[ |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2884 |
defaultNm notNil ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2885 |
defaultName asFilename withoutSuffix baseName = '*' ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2886 |
defaultDir := FileSelectionBox lastFileSelectionDirectory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2887 |
defaultNm := ''. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2888 |
] ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2889 |
defaultDir := defaultName asFilename directoryName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2890 |
defaultNm := defaultNm asFilename baseName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2891 |
] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2892 |
]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2893 |
]. |
100 | 2894 |
|
2895 |
box := FileSelectionBox title:titleString. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2896 |
defaultDir notNil ifTrue:[box directory:defaultDir]. |
1031 | 2897 |
pattern notNil ifTrue:[box pattern:pattern]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2898 |
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
|
2899 |
box action:[:name | |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2900 |
versionSymbol == #mustBeNew ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2901 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2902 |
name asFilename exists ifTrue:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2903 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2904 |
versionSymbol == #new ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2905 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2906 |
name asFilename exists ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2907 |
(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
|
2908 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2909 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2910 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2911 |
versionSymbol == #mustBeOld ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2912 |
name asFilename exists ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2913 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2914 |
versionSymbol == #old ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2915 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2916 |
name asFilename exists ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2917 |
(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
|
2918 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2919 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2920 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2921 |
FileSelectionBox lastFileSelectionDirectory:box directory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2922 |
box destroy. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2923 |
^ 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
|
2924 |
]. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2925 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2926 |
self showAndThenDestroyBox:box. |
100 | 2927 |
box action:nil. |
2928 |
^ failBlock value |
|
2929 |
||
2930 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2931 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2932 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2933 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2934 |
version:nil |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2935 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2936 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2937 |
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
|
2938 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2939 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2940 |
Dialog |
4354
398565cdbe6c
comment/format in: #requestFileName:default:version:ifFail:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4353
diff
changeset
|
2941 |
requestFileName:'Enter a fileName:' |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2942 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2943 |
version:#old |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2944 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2945 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2946 |
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
|
2947 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2948 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2949 |
Dialog |
4354
398565cdbe6c
comment/format in: #requestFileName:default:version:ifFail:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4353
diff
changeset
|
2950 |
requestFileName:'Enter a fileName:' |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2951 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2952 |
version:#mustBeNew |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2953 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2954 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2955 |
fromDirectory:'/etc' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2956 |
" |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2957 |
|
4181 | 2958 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
2959 |
"Created: / 27-10-2010 / 10:38:10 / cg" |
|
2960 |
! |
|
2961 |
||
2962 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
2963 |
"launch a Dialog, which allows user to enter a filename. |
|
2964 |
Return the string or the value of failBlock if cancel was pressed. |
|
2965 |
The version argument allows validation of the files existance; |
|
2966 |
it may be any of: |
|
2967 |
#mustBeNew - fail (return empty string) if the file exists |
|
2968 |
#new - confirm if the file exists |
|
2969 |
#mustBeOld - fail if the file does not exist |
|
2970 |
#old - confirm if the file does not exist |
|
2971 |
#any (other) - no validation |
|
2972 |
" |
|
2973 |
||
2974 |
^ self |
|
2975 |
requestFileName:titleString |
|
2976 |
default:defaultName |
|
2977 |
version:versionSymbol |
|
2978 |
ifFail:failBlock |
|
2979 |
pattern:pattern |
|
2980 |
fromDirectory:aDirectoryPath |
|
2981 |
forSave:false |
|
2982 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2983 |
||
2984 |
" |
|
2985 |
Dialog |
|
2986 |
requestFileName:'enter a fileName:' |
|
2987 |
default:'' |
|
2988 |
version:nil |
|
2989 |
ifFail:['none'] |
|
2990 |
pattern:'*.conf' |
|
2991 |
fromDirectory:'/etc' |
|
2992 |
" |
|
2993 |
" |
|
2994 |
Dialog |
|
2995 |
requestFileName:'enter a fileName:' |
|
2996 |
default:'' |
|
2997 |
version:#old |
|
2998 |
ifFail:['none'] |
|
2999 |
pattern:'*.conf' |
|
3000 |
fromDirectory:'/etc' |
|
3001 |
" |
|
3002 |
" |
|
3003 |
Dialog |
|
3004 |
requestFileName:'enter a fileName:' |
|
3005 |
default:'' |
|
3006 |
version:#mustBeNew |
|
3007 |
ifFail:['none'] |
|
3008 |
pattern:'*.conf' |
|
3009 |
fromDirectory:'/etc' |
|
3010 |
" |
|
3011 |
||
4164 | 3012 |
"Created: / 21-02-1997 / 14:23:44 / stefan" |
3013 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
|
4181 | 3014 |
"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
|
3015 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3016 |
|
3877 | 3017 |
requestFileName:titleString fromDirectory:aDirectory |
3018 |
"launch a Dialog, which allows user to enter a filename. |
|
3019 |
The files presented initially are those from the current directory. |
|
3020 |
The box will show ok/cancel in its buttons. |
|
3021 |
Return the string or nil if cancel was pressed." |
|
3022 |
||
3023 |
^ self |
|
3024 |
requestFileName:titleString |
|
3025 |
default:nil |
|
3026 |
pattern:'*' |
|
3027 |
fromDirectory:aDirectory |
|
3028 |
||
3029 |
" |
|
3030 |
Dialog |
|
3031 |
requestFileName:'enter a fileName:' |
|
3032 |
fromDirectory:'../../libbasic' |
|
3033 |
" |
|
3034 |
! |
|
3035 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3036 |
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
|
3037 |
"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
|
3038 |
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
|
3039 |
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
|
3040 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3041 |
^ self |
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3042 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3043 |
default:'file.ext' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3044 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3045 |
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
|
3046 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3047 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3048 |
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
|
3049 |
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
|
3050 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3051 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
3052 |
"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
|
3053 |
"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
|
3054 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3055 |
|
2524 | 3056 |
requestFileName:titleString pattern:pattern |
3057 |
"launch a Dialog, which allows user to enter a filename. |
|
3058 |
The files presented initially are those from the current directory. |
|
3059 |
The box will show ok/cancel in its buttons. |
|
3060 |
The matchPattern is set to pattern initially. |
|
3061 |
Return the string or nil if cancel was pressed." |
|
3062 |
||
3063 |
^ self |
|
3064 |
requestFileName:titleString |
|
3065 |
default:nil |
|
3066 |
pattern:pattern |
|
3067 |
||
3068 |
" |
|
3069 |
Dialog |
|
3070 |
requestFileName:'enter a fileName:' |
|
3071 |
pattern:'*.st' |
|
3072 |
" |
|
3073 |
" |
|
3074 |
Dialog |
|
3075 |
requestFileName:'enter a fileName:' |
|
3076 |
pattern:'*.st;*.h' |
|
3077 |
" |
|
3078 |
! |
|
3079 |
||
2525 | 3080 |
requestFileName:titleString pattern:pattern fromDirectory:aDirectory |
3081 |
"launch a Dialog, which allows user to enter a filename. |
|
3082 |
The files presented initially are those from the current directory. |
|
3083 |
The box will show ok/cancel in its buttons. |
|
3084 |
The matchPattern is set to pattern initially. |
|
3085 |
Return the string or nil if cancel was pressed." |
|
3086 |
||
3087 |
^ self |
|
3088 |
requestFileName:titleString |
|
3089 |
default:nil |
|
3090 |
pattern:pattern |
|
3091 |
fromDirectory:aDirectory |
|
3092 |
" |
|
3093 |
Dialog |
|
3094 |
requestFileName:'enter a fileName:' |
|
3095 |
pattern:'*.st' |
|
3096 |
" |
|
3097 |
" |
|
3098 |
Dialog |
|
3099 |
requestFileName:'enter a fileName:' |
|
3100 |
pattern:'*.st;*.h' |
|
3101 |
" |
|
3102 |
! |
|
3103 |
||
4181 | 3104 |
requestFileNameForSave:titleString |
3105 |
"launch a Dialog, which allows user to enter a filename. |
|
3106 |
Return the pathname string consisting of the full pathname of the filename, |
|
3107 |
or an empty string (if cancel was pressed)." |
|
3108 |
||
3109 |
^ self |
|
3110 |
requestFileNameForSave:titleString |
|
3111 |
default:'file.ext' |
|
3112 |
||
3113 |
" |
|
3114 |
Dialog requestFileName:'enter a fileName:' |
|
3115 |
Dialog requestFileName:'enter a fileName:' |
|
3116 |
" |
|
3117 |
||
3118 |
"Created: / 27-10-2010 / 11:31:52 / cg" |
|
3119 |
! |
|
3120 |
||
3121 |
requestFileNameForSave:titleString default:defaultName |
|
3122 |
"launch a Dialog, which allows user to enter a filename. |
|
3123 |
The box will not allow pressing 'ok' without an entered string. |
|
3124 |
Return the pathname string consisting of the full pathname of the filename, |
|
3125 |
or an empty string (if cancel was pressed)." |
|
3126 |
||
3127 |
^ self |
|
4182
46fec1281cbc
changed: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4181
diff
changeset
|
3128 |
requestFileNameForSave:titleString |
4181 | 3129 |
default:defaultName |
3130 |
version:nil |
|
3131 |
ifFail:'' |
|
3132 |
||
3133 |
" |
|
3134 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
4183
c775db615fdf
comment/format in: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4182
diff
changeset
|
3135 |
Dialog requestFileNameForSave:'enter a fileName:' default:'' |
4181 | 3136 |
" |
3137 |
||
3138 |
"Created: / 27-10-2010 / 11:32:06 / cg" |
|
3139 |
! |
|
3140 |
||
3141 |
requestFileNameForSave:titleString default:defaultName fromDirectory:aDirectoryPath |
|
3142 |
"launch a Dialog, which allows user to enter a filename. |
|
3143 |
The box will not allow pressing 'ok' without an entered string. |
|
3144 |
Return the pathname string consisting of the full pathname of the filename, |
|
3145 |
or an empty string (if cancel was pressed)." |
|
3146 |
||
3147 |
^ self |
|
3148 |
requestFileName:titleString |
|
3149 |
default:defaultName |
|
3150 |
version:nil |
|
3151 |
ifFail:'' |
|
3152 |
pattern:nil |
|
3153 |
fromDirectory:aDirectoryPath |
|
3154 |
forSave:true |
|
3155 |
whenBoxCreatedEvaluate:nil |
|
3156 |
||
3157 |
" |
|
3158 |
Dialog |
|
3159 |
requestFileName:'enter a fileName:' |
|
3160 |
default:'Makefile.bak' |
|
3161 |
fromDirectory:'..' |
|
3162 |
" |
|
3163 |
||
3164 |
"Created: / 27-10-2010 / 10:41:04 / cg" |
|
3165 |
! |
|
3166 |
||
3167 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
|
3168 |
"launch a Dialog, which allows user to enter a filename. |
|
3169 |
The files presented initially are those from the current directory. |
|
3170 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3171 |
The matchPattern is set to pattern initially. |
|
3172 |
Return the string or nil if cancel was pressed." |
|
3173 |
||
3174 |
^ self |
|
3175 |
requestFileNameForSave:titleString |
|
3176 |
default:defaultName |
|
3177 |
ok:okText |
|
3178 |
abort:abortText |
|
3179 |
pattern:pattern |
|
3180 |
fromDirectory:nil |
|
3181 |
||
3182 |
" |
|
3183 |
Dialog |
|
3184 |
requestFileName:'enter a fileName:' |
|
3185 |
default:'' |
|
3186 |
ok:'yeah' |
|
3187 |
abort:'oh, no' |
|
3188 |
pattern:'*.st' |
|
3189 |
" |
|
3190 |
||
3191 |
"Created: / 27-10-2010 / 11:29:20 / cg" |
|
3192 |
! |
|
3193 |
||
3194 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil |
|
3195 |
"launch a Dialog, which allows user to enter a filename. |
|
3196 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3197 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3198 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3199 |
The matchPattern is set to pattern initially. |
|
3200 |
Return the string, or nil if cancel was pressed." |
|
3201 |
||
3202 |
^ self |
|
3203 |
requestFileName:titleString |
|
3204 |
default:defaultName |
|
3205 |
ok:okText |
|
3206 |
abort:abortText |
|
3207 |
pattern:pattern |
|
3208 |
fromDirectory:aDirectoryPathOrNil |
|
3209 |
forSave:true |
|
3210 |
whenBoxCreatedEvaluate:nil |
|
3211 |
||
3212 |
"Created: / 27-10-2010 / 11:24:37 / cg" |
|
3213 |
! |
|
3214 |
||
3215 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
3216 |
"launch a Dialog, which allows user to enter a filename. |
|
3217 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3218 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3219 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3220 |
The matchPattern is set to pattern initially. |
|
3221 |
Return the string, or nil if cancel was pressed." |
|
3222 |
||
3223 |
^ self |
|
3224 |
requestFileName:titleString |
|
3225 |
default:defaultName |
|
3226 |
ok:okText |
|
3227 |
abort:abortText |
|
3228 |
pattern:pattern |
|
3229 |
fromDirectory:aDirectoryPathOrNil |
|
3230 |
forSave:true |
|
3231 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3232 |
||
3233 |
" |
|
3234 |
Dialog |
|
3235 |
requestFileName:'enter a fileName:' |
|
3236 |
default:'' |
|
3237 |
ok:'yeah' |
|
3238 |
abort:'oh, no' |
|
3239 |
pattern:'rc*' |
|
3240 |
fromDirectory:'/etc' |
|
3241 |
" |
|
3242 |
||
3243 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
3244 |
"Created: / 27-10-2010 / 11:23:40 / cg" |
|
3245 |
! |
|
3246 |
||
3247 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
3248 |
"launch a Dialog, which allows user to enter a filename. |
|
3249 |
The box will not allow pressing 'ok' without an entered string. |
|
3250 |
Return the string or the value of failBlock if cancel was pressed. |
|
3251 |
The version argument allows validation of the files existance; |
|
3252 |
it may be any of: |
|
3253 |
#mustBeNew - fail (return empty string) if the file exists |
|
3254 |
#new - confirm if the file exists |
|
3255 |
#mustBeOld - fail if the file does not exist |
|
3256 |
#old - confirm if the file does not exist |
|
3257 |
#any (other) - no validation |
|
3258 |
" |
|
3259 |
||
3260 |
^ self |
|
3261 |
requestFileNameForSave:titleString |
|
3262 |
default:defaultName |
|
3263 |
version:versionSymbol |
|
3264 |
ifFail:failBlock |
|
3265 |
fromDirectory:nil |
|
3266 |
||
3267 |
" |
|
3268 |
Dialog |
|
3269 |
requestFileName:'enter a fileName:' |
|
3270 |
default:'' |
|
3271 |
version:nil |
|
3272 |
ifFail:['none'] |
|
3273 |
" |
|
3274 |
" |
|
3275 |
Dialog |
|
3276 |
requestFileName:'enter a fileName:' |
|
3277 |
default:'' |
|
3278 |
version:#old |
|
3279 |
ifFail:['none'] |
|
3280 |
" |
|
3281 |
||
3282 |
"Created: / 27-10-2010 / 11:32:03 / cg" |
|
3283 |
! |
|
3284 |
||
3285 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath |
|
3286 |
"launch a Dialog, which allows user to enter a filename. |
|
3287 |
Return the string or the value of failBlock if cancel was pressed. |
|
3288 |
The version argument allows validation of the files existance; |
|
3289 |
it may be any of: |
|
3290 |
#mustBeNew - fail (return empty string) if the file exists |
|
3291 |
#new - confirm if the file exists |
|
3292 |
#mustBeOld - fail if the file does not exist |
|
3293 |
#old - confirm if the file does not exist |
|
3294 |
#any (other) - no validation |
|
3295 |
" |
|
3296 |
||
3297 |
^ self |
|
3298 |
requestFileNameForSave:titleString |
|
3299 |
default:defaultName |
|
3300 |
version:versionSymbol |
|
3301 |
ifFail:failBlock |
|
3302 |
pattern:nil |
|
3303 |
fromDirectory:aDirectoryPath |
|
3304 |
||
3305 |
" |
|
3306 |
Dialog |
|
3307 |
requestFileName:'enter a fileName:' |
|
3308 |
default:'' |
|
3309 |
version:nil |
|
3310 |
ifFail:['none'] |
|
3311 |
fromDirectory:'/etc' |
|
3312 |
" |
|
3313 |
" |
|
3314 |
Dialog |
|
3315 |
requestFileName:'enter a fileName:' |
|
3316 |
default:'' |
|
3317 |
version:#old |
|
3318 |
ifFail:['none'] |
|
3319 |
fromDirectory:'/etc' |
|
3320 |
" |
|
3321 |
" |
|
3322 |
Dialog |
|
3323 |
requestFileName:'enter a fileName:' |
|
3324 |
default:'' |
|
3325 |
version:#mustBeNew |
|
3326 |
ifFail:['none'] |
|
3327 |
fromDirectory:'/etc' |
|
3328 |
" |
|
3329 |
||
3330 |
"Modified: / 21-02-1997 / 14:27:27 / stefan" |
|
3331 |
"Created: / 27-10-2010 / 11:32:22 / cg" |
|
3332 |
! |
|
3333 |
||
3334 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
3335 |
"launch a Dialog, which allows user to enter a filename. |
|
3336 |
Return the string or the value of failBlock if cancel was pressed. |
|
3337 |
The version argument allows validation of the files existance; |
|
3338 |
it may be any of: |
|
3339 |
#mustBeNew - fail (return empty string) if the file exists |
|
3340 |
#new - confirm if the file exists |
|
3341 |
#mustBeOld - fail if the file does not exist |
|
3342 |
#old - confirm if the file does not exist |
|
3343 |
#any (other) - no validation |
|
3344 |
" |
|
3345 |
||
3346 |
^ self |
|
3347 |
requestFileName:titleString |
|
3348 |
default:defaultName |
|
3349 |
version:versionSymbol |
|
3350 |
ifFail:failBlock |
|
3351 |
pattern:pattern |
|
3352 |
fromDirectory:aDirectoryPath |
|
3353 |
forSave:true |
|
3354 |
whenBoxCreatedEvaluate:nil |
|
3355 |
||
3356 |
"Created: / 27-10-2010 / 11:32:55 / cg" |
|
3357 |
! |
|
3358 |
||
2631 | 3359 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog |
3360 |
"launch a Dialog, which allows user to enter a filename. |
|
3361 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3362 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3363 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3364 |
The matchPattern is set to pattern initially. |
|
3365 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
|
3366 |
" |
|
3367 |
||
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3368 |
UserPreferences current useNewFileDialog ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3369 |
FileDialog notNil ifTrue:[ |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3370 |
^ FileDialog |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3371 |
requestFileNames:titleString |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3372 |
default:defaultName |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3373 |
ok:okText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3374 |
abort:abortText |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3375 |
ifFail:failBlock |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3376 |
pattern:pattern |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3377 |
fromDirectory:aDirectoryPath |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3378 |
whenBoxCreatedEvaluate:boxCreatedCallback |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3379 |
asLoadDialog:asLoadDialog. |
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3380 |
]. |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3381 |
]. |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3382 |
^ self |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3383 |
requestFileName:titleString |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3384 |
default:defaultName |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3385 |
ok:okText abort:abortText |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3386 |
pattern:pattern fromDirectory:aDirectoryPath forSave:asLoadDialog not |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3387 |
whenBoxCreatedEvaluate:boxCreatedCallback |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3388 |
|
4353
f49df92ebf0a
comment/format in: #requestFileName:default:ok:abort:pattern:fromDirectory:forSave:whenBoxCreatedEvaluate:
Claus Gittinger <cg@exept.de>
parents:
4352
diff
changeset
|
3389 |
"Modified: / 23-01-2012 / 17:24:06 / cg" |
2631 | 3390 |
! |
3391 |
||
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
|
3392 |
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
|
3393 |
"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
|
3394 |
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
|
3395 |
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
|
3396 |
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
|
3397 |
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
|
3398 |
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
|
3399 |
|
1736 | 3400 |
^ self |
3401 |
requestFileName:titleString |
|
3402 |
default:defaultName |
|
3403 |
version:#new |
|
3404 |
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
|
3405 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3406 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3407 |
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
|
3408 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3409 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3410 |
"Modified: 27.1.1996 / 13:44:13 / cg" |
2694 | 3411 |
! |
3412 |
||
3413 |
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction:appendActionOrNil |
|
3418 | 3414 |
"save contents into a file - ask user for filename using a fileSelectionBox. |
3415 |
Append is NOT offered, if appendActionOrNil is nil." |
|
2694 | 3416 |
|
2789 | 3417 |
|doAppend fileBox fileName dialog default resources| |
2694 | 3418 |
|
3419 |
default := defaultOrNil. |
|
3420 |
default notNil ifTrue:[ default := default asString]. |
|
3421 |
||
2789 | 3422 |
resources := self classResources. |
3423 |
||
4164 | 3424 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 3425 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
3426 |
appendActionOrNil isNil ifTrue:[ |
|
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3427 |
Win32FileDialog notNil ifTrue:[ |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3428 |
^ Win32FileDialog |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3429 |
fileDialogFor:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3430 |
save:true |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3431 |
title:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3432 |
inDirectory:directoryOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3433 |
initialAnswer:default |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3434 |
filter:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3435 |
extension:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3436 |
] |
3574 | 3437 |
]. |
3438 |
]. |
|
3439 |
]. |
|
3440 |
||
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3441 |
(UserPreferences current useNewFileDialog and:[FileDialog notNil]) ifTrue:[ |
2694 | 3442 |
fileName := FileDialog |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3443 |
requestFileName:title |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3444 |
default:default |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3445 |
ok:(resources string:'Save') |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3446 |
abort:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3447 |
version:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3448 |
ifFail:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3449 |
pattern:nil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3450 |
fromDirectory:directoryOrNil |
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3451 |
whenBoxCreatedEvaluate:[:box | (dialog := box) appendButtonVisibleHolder value:appendActionOrNil notNil]. |
2694 | 3452 |
|
3453 |
doAppend := dialog appendWasPressed |
|
3454 |
] ifFalse:[ |
|
3455 |
fileBox := FileSaveBox |
|
3456 |
title:title |
|
2789 | 3457 |
okText:(resources string:'Save') |
3458 |
abortText:(resources string:'Cancel') |
|
2694 | 3459 |
action:[:fn | doAppend := false. fileName := fn]. |
3460 |
fileBox appendAction:[:fn | doAppend := true. fileName := fn]. |
|
3461 |
directoryOrNil notNil ifTrue:[ fileBox directory:directoryOrNil]. |
|
3462 |
default notNil ifTrue:[fileBox initialText:default]. |
|
3463 |
fileBox showAtPointer. |
|
3464 |
fileBox destroy. |
|
3465 |
]. |
|
3466 |
||
3467 |
fileName size > 0 ifTrue:[ |
|
2705
a7c0e46f20fb
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction
tm
parents:
2700
diff
changeset
|
3468 |
(doAppend ifTrue:[appendActionOrNil] ifFalse:[action]) |
2694 | 3469 |
value:fileName |
3470 |
]. |
|
3471 |
^ self. |
|
3418 | 3472 |
|
3473 |
" |
|
3474 |
Dialog |
|
3475 |
requestSaveFileName:'Save dialog example with append' |
|
3476 |
default:'xxx.txt' |
|
3477 |
fromDirectory:(Filename homeDirectory) |
|
3478 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3479 |
appendAction:[:fn | Transcript showCR:'append ',fn] |
|
3480 |
||
3481 |
Dialog |
|
3482 |
requestSaveFileName:'Save dialog example' |
|
3483 |
default:'xxx.txt' |
|
3484 |
fromDirectory:(Filename homeDirectory) |
|
3485 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3486 |
appendAction:nil |
|
3487 |
" |
|
3488 |
||
4164 | 3489 |
"Modified: / 24-08-2010 / 17:29:12 / sr" |
4352
9fc90b8f931c
care for fileDialog not present
Claus Gittinger <cg@exept.de>
parents:
4351
diff
changeset
|
3490 |
"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
|
3491 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3492 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
3493 |
!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
|
3494 |
|
4556 | 3495 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText initialSelection:anIntervalOrNil model:textModel |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3496 |
"return a dialog asking for multiline text. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3497 |
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
|
3498 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3499 |
^ self |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3500 |
forRequestText:title |
4875 | 3501 |
editViewClass:editViewClass |
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3502 |
lines:numLines columns:numCols |
4556 | 3503 |
initialAnswer:initialText |
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3504 |
setupWith: |
4556 | 3505 |
[:textView :dialog| |
3506 |
initialText notEmptyOrNil ifTrue:[ |
|
3507 |
textModel value:initialText |
|
3508 |
]. |
|
5011 | 3509 |
textView scrolledView model:textModel. |
3510 |
textView scrolledView |
|
3511 |
perform:#acceptChannel: |
|
3512 |
with:(dialog acceptChannel) |
|
3513 |
ifNotUnderstood:[]. |
|
3514 |
||
4556 | 3515 |
anIntervalOrNil notNil ifTrue:[ |
3516 |
textView scrolledView selectFromCharacterPosition:anIntervalOrNil start to:anIntervalOrNil stop. |
|
3517 |
]. |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3518 |
] |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3519 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3520 |
"Modified: / 12-10-2006 / 13:59:21 / cg" |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3521 |
! |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3522 |
|
4556 | 3523 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel |
3524 |
"return a dialog asking for multiline text. |
|
3525 |
The box is not shown yet, for further customization" |
|
3526 |
||
3527 |
^ self |
|
3528 |
forRequestText:title |
|
3529 |
editViewClass:editViewClass |
|
3530 |
lines:numLines columns:numCols |
|
3531 |
initialAnswer:initialText initialSelection:nil |
|
3532 |
model:textModel |
|
3533 |
! |
|
3534 |
||
3535 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText setupWith:aSetupBlockOrNil |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3536 |
"return a dialog asking for multiline text. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3537 |
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
|
3538 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3539 |
|dialog textView| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3540 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3541 |
dialog := self new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3542 |
(dialog addTextLabel:(self classResources string:title)) adjust:#left. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3543 |
textView := dialog addTextBoxOn:nil |
2315 | 3544 |
class:editViewClass |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3545 |
withNumberOfLines:numLines |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3546 |
hScrollable:true |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3547 |
vScrollable:true. |
4556 | 3548 |
initialText notEmptyOrNil ifTrue:[ |
3549 |
textView contents:initialText |
|
3550 |
]. |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3551 |
dialog width:(textView preferredExtentForLines:numLines cols:numCols) x. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3552 |
dialog addAbortAndOkButtons. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3553 |
dialog okButton isReturnButton:false. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3554 |
dialog makeTabable:textView. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3555 |
dialog stickAtBottomWithVariableHeight:textView. |
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3556 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3557 |
aSetupBlockOrNil notNil ifTrue:[ |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3558 |
aSetupBlockOrNil valueWithOptionalArgument:textView and:dialog |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3559 |
]. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3560 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3561 |
^ dialog |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3562 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3563 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3564 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3565 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3566 |
textHolder := ValueHolder new. |
2315 | 3567 |
dialog := Dialog |
3568 |
forRequestText:'foo' |
|
3569 |
editViewClass:EditTextView |
|
3570 |
lines:10 columns:40 |
|
3571 |
initialAnswer:'hello' model:textHolder. |
|
3572 |
dialog open. |
|
3573 |
dialog accepted ifTrue:[ |
|
3574 |
^ textHolder value |
|
3575 |
]. |
|
3576 |
^ nil |
|
3577 |
" |
|
3578 |
||
3579 |
" |
|
3580 |
|dialog textHolder| |
|
3581 |
||
3582 |
textHolder := ValueHolder new. |
|
3583 |
dialog := Dialog |
|
3584 |
forRequestText:'foo' |
|
3585 |
editViewClass:CodeView |
|
3586 |
lines:10 columns:40 |
|
3587 |
initialAnswer:'hello' model:textHolder. |
|
3588 |
dialog open. |
|
3589 |
dialog accepted ifTrue:[ |
|
3590 |
^ textHolder value |
|
3591 |
]. |
|
3592 |
^ nil |
|
3593 |
" |
|
3594 |
||
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3595 |
"Created: / 12-10-2006 / 13:59:27 / cg" |
2315 | 3596 |
! |
3597 |
||
4556 | 3598 |
forRequestText:title lines:numLines columns:numCols initialAnswer:initialText initialSelection:anIntervalOrNil model:textModel |
3599 |
"return a dialog asking for multiline text. |
|
3600 |
The box is not shown yet, for further customization" |
|
3601 |
||
3602 |
^ self |
|
3603 |
forRequestText:title |
|
3604 |
editViewClass:EditTextView |
|
3605 |
lines:numLines columns:numCols |
|
3606 |
initialAnswer:initialText initialSelection:anIntervalOrNil |
|
3607 |
model:textModel |
|
3608 |
||
3609 |
" |
|
3610 |
|dialog textHolder| |
|
3611 |
||
3612 |
textHolder := ValueHolder new. |
|
3613 |
dialog := Dialog forRequestText:'foo' lines:10 columns:40 initialAnswer:'hello' model:textHolder. |
|
3614 |
dialog open. |
|
3615 |
dialog accepted ifTrue:[ |
|
3616 |
^ textHolder value |
|
3617 |
]. |
|
3618 |
^ nil |
|
3619 |
" |
|
3620 |
||
3621 |
"Modified: / 12-10-2006 / 12:45:47 / cg" |
|
3622 |
! |
|
3623 |
||
2315 | 3624 |
forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textModel |
3625 |
"return a dialog asking for multiline text. |
|
3626 |
The box is not shown yet, for further customization" |
|
3627 |
||
3628 |
^ self |
|
3629 |
forRequestText:title |
|
3630 |
editViewClass:EditTextView |
|
3631 |
lines:numLines columns:numCols |
|
4556 | 3632 |
initialAnswer:initialText initialSelection:nil |
3633 |
model:textModel |
|
2315 | 3634 |
|
3635 |
" |
|
3636 |
|dialog textHolder| |
|
3637 |
||
3638 |
textHolder := ValueHolder new. |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3639 |
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
|
3640 |
dialog open. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3641 |
dialog accepted ifTrue:[ |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3642 |
^ textHolder value |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3643 |
]. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3644 |
^ nil |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3645 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3646 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3647 |
"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
|
3648 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3649 |
|
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
|
3650 |
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
|
3651 |
"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
|
3652 |
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
|
3653 |
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
|
3654 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3655 |
^ self |
2439 | 3656 |
request:aString |
3657 |
displayAt:nil |
|
3658 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
3659 |
action:nil |
|
3660 |
initialAnswer:'' |
|
3661 |
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
|
3662 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3663 |
" |
4633 | 3664 |
Dialog 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
|
3665 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3666 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3667 |
"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
|
3668 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3669 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3670 |
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
|
3671 |
"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
|
3672 |
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
|
3673 |
that point. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3674 |
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
|
3675 |
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
|
3676 |
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
|
3677 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3678 |
^ self |
2444 | 3679 |
request:aString |
3680 |
displayAt:aPoint |
|
3681 |
centered:centered |
|
3682 |
action:resultAction |
|
3683 |
initialAnswer:initial |
|
3684 |
okLabel:nil |
|
3685 |
cancelLabel:nil |
|
3686 |
title:nil |
|
4093 | 3687 |
onCancel:nil |
2444 | 3688 |
list:nil |
3689 |
initialSelection:nil |
|
3690 |
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
|
3691 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3692 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3693 |
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
|
3694 |
|
2444 | 3695 |
Dialog |
2548 | 3696 |
request:'Enter a string:' |
2444 | 3697 |
displayAt:200@200 |
3698 |
centered:true |
|
3699 |
action:[:result | result printNewline] |
|
3700 |
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
|
3701 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3702 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3703 |
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
|
3704 |
|
2444 | 3705 |
Dialog |
2548 | 3706 |
request:'Enter a string:' |
2444 | 3707 |
displayAt:200@200 |
3708 |
centered:false |
|
3709 |
action:[:result | result printNewline] |
|
3710 |
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
|
3711 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3712 |
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
|
3713 |
|
2444 | 3714 |
Dialog |
2548 | 3715 |
request:'Enter a string:' |
2444 | 3716 |
displayAt:nil |
3717 |
centered:false |
|
3718 |
action:[:result | result printNewline] |
|
3719 |
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
|
3720 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3721 |
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
|
3722 |
|
2444 | 3723 |
Dialog |
2548 | 3724 |
request:'Enter a string:' |
2444 | 3725 |
displayAt:nil |
3726 |
centered:true |
|
3727 |
action:[:result | result printNewline] |
|
3728 |
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
|
3729 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3730 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3731 |
"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
|
3732 |
"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
|
3733 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3734 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3735 |
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
|
3736 |
"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
|
3737 |
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
|
3738 |
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
|
3739 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3740 |
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
|
3741 |
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
|
3742 |
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
|
3743 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3744 |
^ self |
2444 | 3745 |
request:aString |
3746 |
displayAt:aPoint |
|
3747 |
centered:centered |
|
3748 |
action:resultAction |
|
3749 |
initialAnswer:initial |
|
3750 |
okLabel:okLabel |
|
3751 |
cancelLabel:cancelLabel |
|
3752 |
title:nil |
|
3753 |
onCancel:cancelValue |
|
3754 |
list:nil |
|
3755 |
initialSelection:nil |
|
3756 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3757 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3758 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3759 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 3760 |
Dialog |
2548 | 3761 |
request:'Enter a string:' |
2444 | 3762 |
displayAt:0@0 |
3763 |
centered:true |
|
3764 |
action:[:result | result printNewline] |
|
3765 |
initialAnswer:'the default' |
|
2548 | 3766 |
okLabel:'Yes' |
3767 |
cancelLabel:'No' |
|
2444 | 3768 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3769 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3770 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3771 |
|
2444 | 3772 |
Dialog |
2548 | 3773 |
request:'Enter a string:' |
2444 | 3774 |
displayAt:200@200 |
3775 |
centered:true |
|
3776 |
action:[:result | result printNewline] |
|
3777 |
initialAnswer:'the default' |
|
2548 | 3778 |
okLabel:'Yes' |
3779 |
cancelLabel:'No' |
|
2444 | 3780 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3781 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3782 |
topLeft of box at 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3783 |
|
2444 | 3784 |
Dialog |
2548 | 3785 |
request:'Enter a string:' |
2444 | 3786 |
displayAt:200@200 |
3787 |
centered:false |
|
3788 |
action:[:result | result printNewline] |
|
3789 |
initialAnswer:'the default' |
|
2548 | 3790 |
okLabel:'Yes' |
3791 |
cancelLabel:'No' |
|
2444 | 3792 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3793 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3794 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3795 |
|
2444 | 3796 |
Dialog |
2548 | 3797 |
request:'Enter a string:' |
2444 | 3798 |
displayAt:nil |
3799 |
centered:false |
|
3800 |
action:[:result | result printNewline] |
|
3801 |
initialAnswer:'the default' |
|
2548 | 3802 |
okLabel:'Yes' |
3803 |
cancelLabel:'No' |
|
2444 | 3804 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3805 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3806 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3807 |
|
2444 | 3808 |
Dialog |
2548 | 3809 |
request:'Enter a string:' |
2444 | 3810 |
displayAt:nil |
3811 |
centered:true |
|
3812 |
action:[:result | result printNewline] |
|
3813 |
initialAnswer:'the default' |
|
2548 | 3814 |
okLabel:'Yes' |
3815 |
cancelLabel:'No' |
|
2444 | 3816 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3817 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3818 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3819 |
"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
|
3820 |
"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
|
3821 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3822 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3823 |
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
|
3824 |
"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
|
3825 |
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
|
3826 |
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
|
3827 |
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
|
3828 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3829 |
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
|
3830 |
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
|
3831 |
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
|
3832 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3833 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3834 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3835 |
displayAt:aPoint |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3836 |
centered:centered |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3837 |
action:resultAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3838 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3839 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3840 |
cancelLabel:cancelLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3841 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3842 |
onCancel:cancelValue |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3843 |
list:nil |
2444 | 3844 |
initialSelection:nil |
3845 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3846 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3847 |
|
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3848 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3849 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3850 |
onCancel:cancelValue list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3851 |
"launch a Dialog, which allows user to enter a string. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3852 |
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
|
3853 |
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
|
3854 |
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
|
3855 |
screen center (if centered is true). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3856 |
The ok-button is labelled okLabel (or the default, ifNil), |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3857 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3858 |
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
|
3859 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3860 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3861 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3862 |
displayAt:aPoint |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3863 |
centered:centered |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3864 |
action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3865 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3866 |
okLabel:okLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3867 |
cancelLabel:cancelLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3868 |
title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3869 |
onCancel:cancelValue |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3870 |
list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3871 |
initialSelection:nil |
2444 | 3872 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3873 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3874 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3875 |
centered around 200@200: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3876 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3877 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3878 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3879 |
displayAt:200@200 |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3880 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3881 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3882 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3883 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3884 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3885 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3886 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3887 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3888 |
under mouse pointer: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3889 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3890 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3891 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3892 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3893 |
centered:false |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3894 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3895 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3896 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3897 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3898 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3899 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3900 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3901 |
centered on the screen: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3902 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3903 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3904 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3905 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3906 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3907 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3908 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3909 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3910 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3911 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3912 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3913 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3914 |
with a list: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3915 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3916 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3917 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3918 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3919 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3920 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3921 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3922 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3923 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3924 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3925 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3926 |
list:#(foo bar baz) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3927 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3928 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3929 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3930 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3931 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3932 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3933 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3934 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
4556 | 3935 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anIntervalOrNil |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3936 |
"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
|
3937 |
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
|
3938 |
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
|
3939 |
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
|
3940 |
screen center (if centered is true). |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3941 |
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
|
3942 |
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
|
3943 |
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
|
3944 |
|
2444 | 3945 |
^ self |
3946 |
request:aString |
|
3947 |
displayAt:aPoint |
|
3948 |
centered:centered |
|
3949 |
action:resultAction |
|
3950 |
initialAnswer:initial |
|
3951 |
okLabel:okLabel |
|
3952 |
cancelLabel:cancelLabel |
|
3953 |
title:titleString |
|
3954 |
onCancel:cancelValue |
|
3955 |
list:listToSelectFrom |
|
4556 | 3956 |
initialSelection:anIntervalOrNil |
2444 | 3957 |
entryCompletionBlock:nil |
3958 |
||
3959 |
" |
|
3960 |
centered around 200@200: |
|
3961 |
||
3962 |
Dialog |
|
2548 | 3963 |
request:'Enter a string:' |
2444 | 3964 |
displayAt:200@200 |
3965 |
centered:true |
|
3966 |
action:[:result | result printNewline] |
|
3967 |
initialAnswer:'the default' |
|
2548 | 3968 |
okLabel:'Yes' |
3969 |
cancelLabel:'No' |
|
2444 | 3970 |
title:'foo' |
3971 |
onCancel:#foo |
|
3972 |
||
3973 |
under mouse pointer: |
|
3974 |
||
3975 |
Dialog |
|
2548 | 3976 |
request:'Enter a string:' |
2444 | 3977 |
displayAt:nil |
3978 |
centered:false |
|
3979 |
action:[:result | result printNewline] |
|
3980 |
initialAnswer:'the default' |
|
2548 | 3981 |
okLabel:'Yes' |
3982 |
cancelLabel:'No' |
|
2444 | 3983 |
title:'foo' |
3984 |
onCancel:#foo |
|
3985 |
||
3986 |
centered on the screen: |
|
3987 |
||
3988 |
Dialog |
|
2548 | 3989 |
request:'Enter a string:' |
2444 | 3990 |
displayAt:nil |
3991 |
centered:true |
|
3992 |
action:[:result | result printNewline] |
|
3993 |
initialAnswer:'the default' |
|
2548 | 3994 |
okLabel:'Yes' |
3995 |
cancelLabel:'No' |
|
2444 | 3996 |
title:'foo' |
3997 |
onCancel:#foo |
|
3998 |
||
3999 |
with a list: |
|
4000 |
||
4001 |
Dialog |
|
2548 | 4002 |
request:'Enter a string:' |
2444 | 4003 |
displayAt:nil |
4004 |
centered:true |
|
4005 |
action:[:result | result printNewline] |
|
4006 |
initialAnswer:'the default' |
|
2548 | 4007 |
okLabel:'Yes' |
4008 |
cancelLabel:'No' |
|
2444 | 4009 |
title:'foo' |
4010 |
onCancel:#foo |
|
4011 |
list:#(foo bar baz) |
|
4012 |
" |
|
4013 |
||
4014 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
|
4015 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
|
4016 |
! |
|
4017 |
||
4018 |
request:aString displayAt:aPoint centered:centeredOrNil action:resultAction |
|
4019 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
|
4556 | 4020 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anIntervalOrNil |
2444 | 4021 |
entryCompletionBlock:entryCompletionBlock |
4022 |
"launch a Dialog, which allows user to enter a string. |
|
4023 |
The dialogs window is titled titleString, or the default (if nil). |
|
4024 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
|
4025 |
If it is nil, it is shown at the current pointer position or at the |
|
4026 |
screen center (if centered is true). |
|
4027 |
The ok-button is labelled okLabel (or the default, ifNil), |
|
4028 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
|
4029 |
Return the string or the value of cancelValue (if cancel was pressed)" |
|
4030 |
||
4031 |
|box centered| |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4032 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4033 |
listToSelectFrom isNil ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4034 |
box := EnterBox title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4035 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4036 |
box := EnterBoxWithList title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4037 |
box list:listToSelectFrom. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4038 |
]. |
2685 | 4039 |
initial notNil ifTrue:[ box initialText:initial printString ]. |
4556 | 4040 |
anIntervalOrNil notNil ifTrue:[ |
4041 |
box selectFromCharacterPosition:anIntervalOrNil start to:anIntervalOrNil stop. |
|
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4042 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
4043 |
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
|
4044 |
okLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4045 |
box okText:okLabel. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4046 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4047 |
cancelLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4048 |
box abortText:cancelLabel |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4049 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4050 |
resultAction isNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4051 |
box action:[:val | box destroy. ^ val] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4052 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4053 |
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
|
4054 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4055 |
titleString notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4056 |
box label:titleString |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4057 |
]. |
2444 | 4058 |
entryCompletionBlock notNil ifTrue:[ |
2517 | 4059 |
"/ box entryCompletionBlock:[:text | box |
4060 |
"/ initialText:(entryCompletionBlock value:text) |
|
4061 |
"/ selected:false]. |
|
4062 |
box entryCompletionBlock:entryCompletionBlock. |
|
2444 | 4063 |
]. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4064 |
|
2444 | 4065 |
centered := centeredOrNil ? (ForceModalBoxesToOpenAtCenter ? false). |
4066 |
||
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4067 |
aPoint notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4068 |
box showAt:aPoint center:centered |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4069 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4070 |
centered ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4071 |
box showAtCenter |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4072 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4073 |
box showAtPointer |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4074 |
] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4075 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
4076 |
box destroy. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4077 |
^ cancelValue value. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4078 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4079 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4080 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4081 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4082 |
Dialog |
2548 | 4083 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4084 |
displayAt:200@200 |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4085 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4086 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4087 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4088 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4089 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4090 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4091 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4092 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4093 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4094 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4095 |
Dialog |
2548 | 4096 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4097 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4098 |
centered:false |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4099 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4100 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4101 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4102 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4103 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4104 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4105 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4106 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4107 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4108 |
Dialog |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4109 |
request:'enter a string:' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4110 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4111 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4112 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4113 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4114 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4115 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4116 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4117 |
onCancel:#foo |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4118 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4119 |
with a list: |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4120 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4121 |
Dialog |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4122 |
request:'enter a string:' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4123 |
displayAt:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4124 |
centered:true |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4125 |
action:[:result | result printNewline] |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4126 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4127 |
okLabel:'yes' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4128 |
cancelLabel:'no' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4129 |
title:'foo' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4130 |
onCancel:#foo |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4131 |
list:#(foo bar baz) |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4132 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4133 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4134 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4135 |
"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
|
4136 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4137 |
|
d3fe810390cb
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 |
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
|
4139 |
"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
|
4140 |
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
|
4141 |
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
|
4142 |
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
|
4143 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4144 |
^ self |
2444 | 4145 |
request:aString |
4146 |
displayAt:aPoint |
|
4147 |
centered:centered |
|
4148 |
action:resultAction |
|
4149 |
initialAnswer:initial |
|
4150 |
okLabel:nil |
|
4151 |
cancelLabel:nil |
|
4152 |
title:nil |
|
4153 |
onCancel:cancelValue |
|
4154 |
list:nil |
|
4155 |
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
|
4156 |
|
100 | 4157 |
" |
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
|
4158 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 4159 |
Dialog |
4160 |
request:'enter a string:' |
|
4161 |
displayAt:0@0 |
|
4162 |
centered:true |
|
4163 |
action:[:result | result printNewline] |
|
4164 |
initialAnswer:'the default' |
|
4165 |
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
|
4166 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4167 |
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
|
4168 |
|
2444 | 4169 |
Dialog |
4170 |
request:'enter a string:' |
|
4171 |
displayAt:200@200 |
|
4172 |
centered:true |
|
4173 |
action:[:result | result printNewline] |
|
4174 |
initialAnswer:'the default' |
|
4175 |
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
|
4176 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4177 |
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
|
4178 |
|
2444 | 4179 |
Dialog |
4180 |
request:'enter a string:' |
|
4181 |
displayAt:200@200 |
|
4182 |
centered:false |
|
4183 |
action:[:result | result printNewline] |
|
4184 |
initialAnswer:'the default' |
|
4185 |
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
|
4186 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4187 |
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
|
4188 |
|
2444 | 4189 |
Dialog |
4190 |
request:'enter a string:' |
|
4191 |
displayAt:nil |
|
4192 |
centered:false |
|
4193 |
action:[:result | result printNewline] |
|
4194 |
initialAnswer:'the default' |
|
4195 |
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
|
4196 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4197 |
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
|
4198 |
|
2444 | 4199 |
Dialog |
4200 |
request:'enter a string:' |
|
4201 |
displayAt:nil |
|
4202 |
centered:true |
|
4203 |
action:[:result | result printNewline] |
|
4204 |
initialAnswer:'the default' |
|
4205 |
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
|
4206 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4207 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4208 |
"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
|
4209 |
"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
|
4210 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4211 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4212 |
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
|
4213 |
"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
|
4214 |
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
|
4215 |
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
|
4216 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4217 |
^ self |
2439 | 4218 |
request:aString |
4219 |
displayAt:aPoint |
|
4220 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4221 |
action:nil |
|
4222 |
initialAnswer:initial |
|
4093 | 4223 |
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
|
4224 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4225 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4226 |
Dialog |
2439 | 4227 |
request:'enter a string:' |
4228 |
displayAt:(250 @ 250) |
|
4229 |
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
|
4230 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4231 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4232 |
"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
|
4233 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4234 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4235 |
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
|
4236 |
"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
|
4237 |
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
|
4238 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4239 |
^ self |
2439 | 4240 |
request:aString |
4241 |
displayAt:nil |
|
4242 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4243 |
action:nil |
|
2444 | 4244 |
initialAnswer:initial |
4245 |
okLabel:nil |
|
4246 |
cancelLabel:nil |
|
4247 |
title:nil |
|
4093 | 4248 |
onCancel:nil |
2444 | 4249 |
list:nil |
4250 |
initialSelection:nil |
|
4251 |
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
|
4252 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4253 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4254 |
Dialog |
2439 | 4255 |
request:'enter a string:' |
4256 |
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
|
4257 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4258 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4259 |
"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
|
4260 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4261 |
|
2444 | 4262 |
request:aString initialAnswer:initial entryCompletionBlock:entryCompletionBlock |
4263 |
"launch a Dialog, which allows user to enter something. |
|
4264 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4265 |
||
4266 |
^ self |
|
4267 |
request:aString |
|
4268 |
displayAt:nil |
|
4269 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4270 |
action:nil |
|
4271 |
initialAnswer:initial |
|
4272 |
okLabel:nil |
|
4273 |
cancelLabel:nil |
|
4274 |
title:nil |
|
4093 | 4275 |
onCancel:nil |
2444 | 4276 |
list:nil |
4277 |
initialSelection:nil |
|
4278 |
entryCompletionBlock:entryCompletionBlock |
|
4279 |
||
4280 |
" |
|
4281 |
Dialog |
|
4282 |
request:'enter a selector:' |
|
4283 |
initialAnswer:'at:p' |
|
4284 |
entryCompletionBlock:[:s | |completion| |
|
4285 |
||
4286 |
completion := Smalltalk selectorCompletion:s. |
|
4287 |
completion second size > 1 ifTrue:[ Screen current beep]. |
|
4288 |
completion first |
|
4289 |
]. |
|
4290 |
" |
|
4291 |
||
4292 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4293 |
! |
|
4294 |
||
4556 | 4295 |
request:aString initialAnswer:initial initialSelection:anIntervalOrNil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4296 |
"launch a Dialog, which allows user to enter something. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4297 |
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
|
4298 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4299 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4300 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4301 |
displayAt:nil |
2439 | 4302 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4303 |
action:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4304 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4305 |
okLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4306 |
cancelLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4307 |
title:nil |
4093 | 4308 |
onCancel:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4309 |
list:nil |
4556 | 4310 |
initialSelection:anIntervalOrNil |
2444 | 4311 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4312 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4313 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4314 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4315 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4316 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4317 |
initialSelection:(1 to:3) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4318 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4319 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4320 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4321 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4322 |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4323 |
request:aString initialAnswer:initial list:aList |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4324 |
"launch a Dialog, which allows user to enter something, |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4325 |
or select from a list of values. |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4326 |
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
|
4327 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4328 |
^ self |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4329 |
request:aString |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4330 |
displayAt:nil |
2439 | 4331 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4332 |
action:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4333 |
initialAnswer:initial |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4334 |
okLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4335 |
cancelLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4336 |
title:nil |
4093 | 4337 |
onCancel:nil |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4338 |
list:aList |
2444 | 4339 |
initialSelection:nil |
4340 |
entryCompletionBlock:nil |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4341 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4342 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4343 |
Dialog |
2548 | 4344 |
request:'Enter a string:' |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4345 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4346 |
list:#('foo' 'bar' 'baz') |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4347 |
" |
2110 | 4348 |
" |
4349 |
Dialog |
|
4350 |
request:'enter a string:' |
|
4351 |
initialAnswer:'the default' |
|
4352 |
list:((1 to:30) collect:[:i | i printString]) |
|
4353 |
" |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4354 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4355 |
"Modified: / 5.5.1999 / 10:53:45 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4356 |
! |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4357 |
|
2550 | 4358 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString |
4359 |
"launch a Dialog, which allows user to enter something. |
|
4360 |
Return the entered string (may be empty string) |
|
4361 |
or cancelValue (if cancel was pressed)" |
|
4362 |
||
4363 |
^ self |
|
4364 |
request:aString |
|
4365 |
displayAt:nil |
|
4366 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4367 |
action:nil |
|
4368 |
initialAnswer:initial |
|
4369 |
okLabel:okLabel |
|
4370 |
cancelLabel:nil |
|
4371 |
title:titleString |
|
4372 |
onCancel:nil |
|
4373 |
list:nil |
|
4374 |
initialSelection:nil |
|
4375 |
entryCompletionBlock:nil |
|
4376 |
||
4377 |
" |
|
4378 |
Dialog |
|
4379 |
request:'Enter a string:' |
|
4380 |
initialAnswer:'the default' |
|
4381 |
okLabel:'Yes' |
|
4382 |
title:'Only a Test' |
|
4383 |
" |
|
4384 |
||
4385 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4386 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4387 |
! |
|
4388 |
||
2551 | 4389 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString list:list |
4390 |
"launch a Dialog, which allows user to enter something. |
|
4391 |
Return the entered string (may be empty string) |
|
4392 |
or cancelValue (if cancel was pressed)" |
|
4393 |
||
4394 |
^ self |
|
4395 |
request:aString |
|
4396 |
displayAt:nil |
|
4397 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4398 |
action:nil |
|
4399 |
initialAnswer:initial |
|
4400 |
okLabel:okLabel |
|
4401 |
cancelLabel:nil |
|
4402 |
title:titleString |
|
4403 |
onCancel:nil |
|
4404 |
list:list |
|
4405 |
initialSelection:nil |
|
4406 |
entryCompletionBlock:nil |
|
4407 |
||
4408 |
" |
|
4409 |
Dialog |
|
4410 |
request:'Enter or select a string:' |
|
4411 |
initialAnswer:'the default' |
|
4412 |
okLabel:'Yes' |
|
4413 |
title:'Only a Test' |
|
4414 |
list:#('a' 'b' 'c') |
|
4415 |
" |
|
4416 |
||
4417 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4418 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4419 |
! |
|
4420 |
||
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4421 |
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
|
4422 |
"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
|
4423 |
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
|
4424 |
or cancelValue (if cancel was pressed)" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4425 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4426 |
^ self |
2439 | 4427 |
request:aString |
4428 |
displayAt:nil |
|
4429 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4430 |
action:nil |
|
4431 |
initialAnswer:initial |
|
4432 |
okLabel:okLabel |
|
4433 |
cancelLabel:nil |
|
4434 |
title:titleString |
|
4435 |
onCancel:cancelAction |
|
2444 | 4436 |
list:nil |
4437 |
initialSelection:nil |
|
4438 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4439 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4440 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4441 |
Dialog |
2548 | 4442 |
request:'Enter a string:' |
2439 | 4443 |
initialAnswer:'the default' |
4444 |
onCancel:['foooo'] |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4445 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4446 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4447 |
"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
|
4448 |
"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
|
4449 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4450 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4451 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices |
2548 | 4452 |
"launch a Dialog, which allows user to enter something |
4453 |
(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
|
4454 |
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
|
4455 |
or cancelValue (if cancel was pressed)" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4456 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4457 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4458 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4459 |
displayAt:nil |
2439 | 4460 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4461 |
action:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4462 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4463 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4464 |
cancelLabel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4465 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4466 |
onCancel:cancelAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4467 |
list:listOfChoices |
2444 | 4468 |
initialSelection:nil |
4469 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4470 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4471 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4472 |
Dialog |
2548 | 4473 |
request:'Enter a String:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4474 |
initialAnswer:'the default' |
2548 | 4475 |
okLabel:'OK' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4476 |
title:'demo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4477 |
onCancel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4478 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4479 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4480 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4481 |
"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
|
4482 |
"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
|
4483 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4484 |
|
2517 | 4485 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices entryCompletionBlock:entryCompletionBlock |
2548 | 4486 |
"launch a Dialog, which allows user to enter something |
4487 |
(with a list of choices for fast input). |
|
2517 | 4488 |
Return the entered string (may be empty string) |
4489 |
or cancelValue (if cancel was pressed)" |
|
4490 |
||
4491 |
^ self |
|
4492 |
request:aString |
|
4493 |
displayAt:nil |
|
4494 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4495 |
action:nil |
|
4496 |
initialAnswer:initial |
|
4497 |
okLabel:okLabel |
|
4498 |
cancelLabel:nil |
|
4499 |
title:titleString |
|
4500 |
onCancel:cancelAction |
|
4501 |
list:listOfChoices |
|
4502 |
initialSelection:nil |
|
4503 |
entryCompletionBlock:entryCompletionBlock |
|
4504 |
||
4505 |
" |
|
4506 |
Dialog |
|
2548 | 4507 |
request:'Enter a String:' |
2517 | 4508 |
initialAnswer:'the default' |
2548 | 4509 |
okLabel:'OK' |
2517 | 4510 |
title:'demo' |
4511 |
onCancel:nil |
|
4512 |
list:#('foo' 'bar' 'baz') |
|
4513 |
" |
|
4514 |
||
4515 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4516 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4517 |
! |
|
4518 |
||
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
|
4519 |
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
|
4520 |
"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
|
4521 |
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
|
4522 |
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
|
4523 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4524 |
^ self |
2439 | 4525 |
request:aString |
4526 |
displayAt:nil |
|
4527 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4528 |
action:nil |
|
4529 |
initialAnswer:initial |
|
2444 | 4530 |
okLabel:nil |
4531 |
cancelLabel:nil |
|
4532 |
title:nil |
|
2439 | 4533 |
onCancel:cancelAction |
2444 | 4534 |
list:nil |
4535 |
initialSelection:nil |
|
4536 |
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
|
4537 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4538 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4539 |
Dialog |
2439 | 4540 |
request:'enter a string:' |
4541 |
initialAnswer:'the default' |
|
4542 |
onCancel:['foooo'] |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4543 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4544 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4545 |
"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
|
4546 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4547 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4548 |
request:aString list:listOfChoices |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4549 |
"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
|
4550 |
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
|
4551 |
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
|
4552 |
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
|
4553 |
|
4302 | 4554 |
^ 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
|
4555 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4556 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4557 |
Dialog |
2548 | 4558 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4559 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4560 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4561 |
|
4302 | 4562 |
"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
|
4563 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4564 |
|
4301
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4565 |
request:aString list:listOfChoices initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4566 |
"launch a Dialog, which allows user to enter something, |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4567 |
but adds a list of choices for fast input. |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4568 |
Return the entered string (may be empty string) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4569 |
or the empty string (if cancel was pressed)" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4570 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4571 |
^ self |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4572 |
request:aString |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4573 |
displayAt:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4574 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4575 |
action:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4576 |
initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4577 |
okLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4578 |
cancelLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4579 |
title:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4580 |
onCancel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4581 |
list:listOfChoices |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4582 |
initialSelection:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4583 |
entryCompletionBlock:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4584 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4585 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4586 |
Dialog |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4587 |
request:'Enter a string:' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4588 |
list:#('foo' 'bar' 'baz') |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4589 |
initialAnswer:'foe' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4590 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4591 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4592 |
"Modified: / 29-05-1996 / 14:26:25 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4593 |
"Created: / 18-08-2011 / 19:28:13 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4594 |
! |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4595 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4596 |
request:aString okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4597 |
"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
|
4598 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4599 |
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
|
4600 |
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
|
4601 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4602 |
^ self |
2439 | 4603 |
request:aString |
4604 |
displayAt:nil |
|
4605 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4606 |
action:nil |
|
4607 |
initialAnswer:'' |
|
4608 |
okLabel:okLabel |
|
4609 |
cancelLabel:nil |
|
2444 | 4610 |
title:nil |
4611 |
onCancel:nil |
|
4612 |
list:nil |
|
4613 |
initialSelection:nil |
|
4614 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4615 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4616 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4617 |
Dialog |
2548 | 4618 |
request:'Enter a string:' |
4619 |
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
|
4620 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4621 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4622 |
"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
|
4623 |
"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
|
4624 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4625 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4626 |
request:aString okLabel:okLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4627 |
"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
|
4628 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4629 |
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
|
4630 |
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
|
4631 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4632 |
^ self |
2439 | 4633 |
request:aString |
4634 |
displayAt:nil |
|
4635 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4636 |
action:nil |
|
4637 |
initialAnswer:'' |
|
4638 |
okLabel:okLabel |
|
4639 |
cancelLabel:nil |
|
2444 | 4640 |
title:nil |
2439 | 4641 |
onCancel:cancelValue |
2444 | 4642 |
list:nil |
4643 |
initialSelection:nil |
|
4644 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4645 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4646 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4647 |
Dialog |
2548 | 4648 |
request:'Enter a string:' |
4649 |
okLabel:'Yes' |
|
2439 | 4650 |
onCancel:nil |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4651 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4652 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4653 |
"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
|
4654 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4655 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4656 |
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
|
4657 |
"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
|
4658 |
The okButton is labelled as okLabel. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4659 |
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
|
4660 |
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
|
4661 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4662 |
^ self |
2439 | 4663 |
request:aString |
4664 |
displayAt:nil |
|
4665 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4666 |
action:nil |
|
4667 |
initialAnswer:'' |
|
4668 |
okLabel:okLabel |
|
4669 |
cancelLabel:nil |
|
4670 |
title:titleString |
|
4671 |
onCancel:cancelValue |
|
2444 | 4672 |
list:nil |
4673 |
initialSelection:nil |
|
4674 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4675 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4676 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4677 |
Dialog |
2548 | 4678 |
request:'Enter a String:' |
4679 |
okLabel:'Yes' |
|
2439 | 4680 |
title:'foo' |
4681 |
onCancel:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4682 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4683 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4684 |
"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
|
4685 |
"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
|
4686 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4687 |
|
2360 | 4688 |
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
|
4689 |
"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
|
4690 |
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
|
4691 |
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
|
4692 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4693 |
^ self |
2360 | 4694 |
request:aString |
4695 |
displayAt:nil |
|
2439 | 4696 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2360 | 4697 |
action:nil |
4698 |
initialAnswer:'' |
|
2444 | 4699 |
okLabel:nil |
4700 |
cancelLabel:nil |
|
4701 |
title:nil |
|
2360 | 4702 |
onCancel:cancelActionOrValue |
2444 | 4703 |
list:nil |
4704 |
initialSelection:nil |
|
4705 |
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
|
4706 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4707 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4708 |
Dialog |
2548 | 4709 |
request:'Enter a String:' |
2360 | 4710 |
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
|
4711 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4712 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4713 |
"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
|
4714 |
"Modified: 29.5.1996 / 14:28:59 / cg" |
100 | 4715 |
! |
4716 |
||
2718 | 4717 |
request:aString title:titleString initialAnswer:initial |
4718 |
"launch a Dialog, which allows user to enter something. |
|
4719 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4720 |
||
4721 |
^ self |
|
4722 |
request:aString |
|
4723 |
displayAt:nil |
|
4724 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4725 |
action:nil |
|
4726 |
initialAnswer:initial |
|
4727 |
okLabel:nil |
|
4728 |
cancelLabel:nil |
|
4729 |
title:titleString |
|
4093 | 4730 |
onCancel:nil |
2718 | 4731 |
list:nil |
4732 |
initialSelection:nil |
|
4733 |
entryCompletionBlock:nil |
|
4734 |
||
4735 |
" |
|
4736 |
Dialog |
|
4737 |
request:'enter a string:' |
|
4738 |
initialAnswer:'the default' |
|
4739 |
" |
|
4740 |
||
4741 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4742 |
! |
|
4743 |
||
3152 | 4744 |
requestNumber:aString |
4745 |
"launch a Dialog, which allows user to enter a number. |
|
4746 |
Return the numeric value or nil |
|
4747 |
(for an invalid number or if cancel was pressed)" |
|
4748 |
||
4749 |
|string| |
|
4750 |
||
4751 |
string := self request:aString. |
|
4752 |
^ Number readFrom:string onError:nil. |
|
4753 |
||
4754 |
" |
|
4755 |
Dialog requestNumber:'Enter your Age:' |
|
4756 |
" |
|
4757 |
||
4758 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
4759 |
! |
|
4760 |
||
3321 | 4761 |
requestNumber:aString initialAnswer: aNumber |
4762 |
"launch a Dialog, which allows user to enter a number. |
|
4763 |
Return the numeric value or nil |
|
4764 |
(for an invalid number or if cancel was pressed)" |
|
4765 |
||
4766 |
|string| |
|
4767 |
||
4768 |
string := self request:aString initialAnswer: aNumber. |
|
4769 |
^ Number readFrom:string onError:nil. |
|
4770 |
||
4771 |
" |
|
4772 |
Dialog requestNumber:'Enter your Age:' initialAnswer: 25 |
|
4773 |
" |
|
4774 |
||
4775 |
"Created: / 26-07-2006 / 12:22:23 / fm" |
|
4776 |
"Modified: / 07-08-2006 / 15:31:30 / fm" |
|
4777 |
! |
|
4778 |
||
197 | 4779 |
requestPassword:aString |
4780 |
"launch a Dialog, which allows user to enter something invisibly. |
|
4781 |
Return the entered string (may be empty string) |
|
4782 |
or nil (if cancel was pressed)" |
|
100 | 4783 |
|
197 | 4784 |
^ EnterBox requestPassword:aString |
133 | 4785 |
|
4786 |
" |
|
4787 |
Dialog |
|
2548 | 4788 |
requestPassword:'Enter Secret:' |
133 | 4789 |
" |
197 | 4790 |
|
4791 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
2014 | 4792 |
! |
4793 |
||
4882 | 4794 |
requestPassword:aString initialAnswer:defaultAnswer |
4880 | 4795 |
"launch a Dialog, which allows user to enter something invisibly. |
4796 |
Return the entered string (may be empty string) |
|
4797 |
or nil (if cancel was pressed)" |
|
4798 |
||
4799 |
^ EnterBox new initialText:defaultAnswer; requestPassword:aString |
|
4800 |
||
4801 |
" |
|
4802 |
Dialog |
|
4803 |
requestPassword:'Enter Secret:' |
|
4804 |
initialText:'blabla' |
|
4805 |
" |
|
4806 |
! |
|
4807 |
||
4139 | 4808 |
requestText:title |
4809 |
"open a dialog asking for multiline text. |
|
4810 |
Return a stringCollection or nil if cancelled." |
|
4811 |
||
4812 |
^ self |
|
4556 | 4813 |
requestText:title initialAnswer:'' initialSelection:nil |
4139 | 4814 |
|
4815 |
" |
|
4816 |
Dialog requestText:'Bla' |
|
4817 |
" |
|
4818 |
! |
|
4819 |
||
4556 | 4820 |
requestText:title initialAnswer:initialAnswer |
4139 | 4821 |
"open a dialog asking for multiline text. |
4822 |
Return a stringCollection or nil if cancelled." |
|
4823 |
||
4824 |
^ self |
|
4556 | 4825 |
requestText:title initialAnswer:initialAnswer initialSelection:nil |
4139 | 4826 |
|
4827 |
" |
|
4828 |
Dialog requestText:'Bla' initialAnswer:'Hello world' |
|
4829 |
" |
|
4830 |
! |
|
4831 |
||
4556 | 4832 |
requestText:title initialAnswer:initialAnswer initialSelection:anIntervalOrNil |
4833 |
"open a dialog asking for multiline text. |
|
4834 |
Return a stringCollection or nil if cancelled." |
|
4835 |
||
4836 |
^ self |
|
4837 |
requestText:title lines:10 columns:60 initialAnswer:initialAnswer initialSelection:anIntervalOrNil |
|
4838 |
||
4839 |
" |
|
4840 |
Dialog requestText:'Bla' initialAnswer:'Hello world' initialSelection:(1 to:5) |
|
4841 |
" |
|
4842 |
! |
|
4843 |
||
2014 | 4844 |
requestText:title lines:numLines columns:numCols initialAnswer:initialText |
4845 |
"open a dialog asking for multiline text. |
|
4846 |
Return a stringCollection or nil if cancelled." |
|
4847 |
||
4556 | 4848 |
^ self |
4849 |
requestText:title lines:numLines columns:numCols |
|
4850 |
initialAnswer:initialText initialSelection:nil |
|
4851 |
||
4852 |
" |
|
4853 |
Dialog requestText:'Bla' lines:8 columns:40 initialAnswer:'hello world' |
|
4854 |
" |
|
4855 |
||
4856 |
"Modified: / 18.8.2000 / 21:45:41 / cg" |
|
4857 |
! |
|
4858 |
||
4859 |
requestText:title lines:numLines columns:numCols initialAnswer:initialText initialSelection:anIntervalOrNil |
|
4860 |
"open a dialog asking for multiline text. |
|
4861 |
Return a stringCollection or nil if cancelled." |
|
4862 |
||
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4863 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4864 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4865 |
textHolder := ValueHolder new. |
4556 | 4866 |
dialog := Dialog |
4867 |
forRequestText:title editViewClass:EditTextView |
|
4868 |
lines:numLines columns:numCols |
|
4869 |
initialAnswer:initialText initialSelection:anIntervalOrNil |
|
4870 |
model:textHolder. |
|
2014 | 4871 |
dialog open. |
4872 |
dialog accepted ifTrue:[ |
|
2675 | 4873 |
^ textHolder value |
2014 | 4874 |
]. |
4875 |
^ nil |
|
4876 |
||
2675 | 4877 |
" |
4556 | 4878 |
Dialog |
4879 |
requestText:'Bla' lines:8 columns:40 initialAnswer:'hello world' |
|
4880 |
||
4881 |
Dialog |
|
4882 |
requestText:'Bla2' lines:8 columns:40 initialAnswer:'hello world' initialSelection:(1 to:5) |
|
4883 |
" |
|
2675 | 4884 |
|
4885 |
"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
|
4886 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4887 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
4888 |
!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
|
4889 |
|
3234 | 4890 |
choose:aString fromList:list lines:maxLines |
4891 |
"launch a Dialog showing the message and list. |
|
4581 | 4892 |
The user can select an item and click ok; in this case, the value |
4893 |
from list is returned (doubleclick works as well). |
|
3234 | 4894 |
If cancel is pressed, the value of cancelBlock is returned. |
4895 |
Pressing ok without a selection is treated like cancel." |
|
4896 |
||
4897 |
^ self |
|
4898 |
choose:aString |
|
3455 | 4899 |
fromList:(list collect:[:each| each printString]) values:list |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4900 |
initialSelection:nil |
3455 | 4901 |
buttons:nil values:nil |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4902 |
default:nil |
3234 | 4903 |
lines:maxLines |
4904 |
cancel:nil |
|
4905 |
multiple:false |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4906 |
title:nil |
3234 | 4907 |
postBuildBlock:nil |
4908 |
||
4909 |
" |
|
4910 |
Transcript showCR:( |
|
4911 |
Dialog |
|
4912 |
choose:'choose any' |
|
4913 |
fromList:#(1 2 3 4 5 6 7) |
|
4914 |
lines:4 |
|
4915 |
) |
|
4916 |
" |
|
4917 |
||
3455 | 4918 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
3234 | 4919 |
! |
4920 |
||
3307 | 4921 |
choose:aString fromList:list lines:maxLines initialSelection:initialSelection |
4922 |
"launch a Dialog showing the message and list. |
|
4581 | 4923 |
The user can select an item and click ok; in this case, the value |
4924 |
from list is returned (doubleclick works as well). |
|
3307 | 4925 |
If cancel is pressed, the value of cancelBlock is returned. |
4926 |
Pressing ok without a selection is treated like cancel." |
|
4927 |
||
4928 |
^ self |
|
4929 |
choose:aString |
|
4930 |
fromList:list values:list initialSelection:initialSelection |
|
4931 |
buttons:nil values:nil |
|
4932 |
lines:maxLines |
|
4933 |
cancel:nil |
|
4934 |
multiple:false |
|
4935 |
postBuildBlock:nil |
|
4936 |
||
4937 |
" |
|
4938 |
Transcript showCR:( |
|
4939 |
Dialog |
|
4940 |
choose:'choose any' |
|
4941 |
fromList:#(1 2 3 4 5 6 7) |
|
4942 |
lines:4 |
|
4943 |
initialSelection:4 |
|
4944 |
) |
|
4945 |
" |
|
4946 |
||
4947 |
"Modified: 27.1.1996 / 14:17:07 / cg" |
|
4948 |
! |
|
4949 |
||
3455 | 4950 |
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
|
4951 |
"launch a Dialog showing the message and list. |
4581 | 4952 |
The user can select an item and click ok; in this case, the value |
4953 |
from list is returned (doubleclick works as well). |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4954 |
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
|
4955 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4956 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4957 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4958 |
choose:aString |
3455 | 4959 |
fromList:(list collect:[:each| each printString]) values:list |
4960 |
initialSelection:initialSelection |
|
4961 |
buttons:nil values:nil |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4962 |
default:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4963 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4964 |
cancel:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4965 |
multiple:false |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4966 |
title:windowTitle |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4967 |
postBuildBlock:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4968 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4969 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4970 |
Transcript showCR:( |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4971 |
Dialog |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4972 |
choose:'choose any' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4973 |
fromList:#(1 2 3 4 5 6 7) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4974 |
lines:4 |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4975 |
title:'Choose' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4976 |
) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4977 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4978 |
|
3455 | 4979 |
"Created: / 02-03-2007 / 12:06:39 / cg" |
4980 |
! |
|
4981 |
||
4982 |
choose:aString fromList:list lines:maxLines title:windowTitle |
|
4983 |
"launch a Dialog showing the message and list. |
|
4581 | 4984 |
The user can select an item and click ok; in this case, the value |
4985 |
from list is returned (doubleclick works as well). |
|
3455 | 4986 |
If cancel is pressed, the value of cancelBlock is returned. |
4987 |
Pressing ok without a selection is treated like cancel." |
|
4988 |
||
4989 |
^ self |
|
4990 |
choose:aString |
|
4991 |
fromList:(list collect:[:each| each printString]) values:list |
|
4992 |
initialSelection:nil |
|
4993 |
buttons:nil values:nil |
|
4994 |
default:nil |
|
4995 |
lines:maxLines |
|
4996 |
cancel:nil |
|
4997 |
multiple:false |
|
4998 |
title:windowTitle |
|
4999 |
postBuildBlock:nil |
|
5000 |
||
5001 |
" |
|
5002 |
Transcript showCR:( |
|
5003 |
Dialog |
|
5004 |
choose:'choose any' |
|
5005 |
fromList:#(1 2 3 4 5 6 7) |
|
5006 |
lines:4 |
|
5007 |
title:'Choose' |
|
5008 |
) |
|
5009 |
" |
|
5010 |
||
5011 |
"Modified: / 02-03-2007 / 12:08:20 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5012 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5013 |
|
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
|
5014 |
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
|
5015 |
"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
|
5016 |
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
|
5017 |
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
|
5018 |
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
|
5019 |
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
|
5020 |
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
|
5021 |
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
|
5022 |
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
|
5023 |
|
2111 | 5024 |
^ self |
5025 |
choose:aString |
|
3455 | 5026 |
fromList:list values:listValues |
5027 |
buttons:buttonLabels values:buttonValues |
|
2111 | 5028 |
lines:maxLines |
5029 |
cancel:cancelBlock |
|
5030 |
multiple:false |
|
5031 |
||
5032 |
" |
|
5033 |
full example: |
|
5034 |
||
5035 |
Transcript showCR:( |
|
5036 |
Dialog |
|
5037 |
choose:'choose any' |
|
5038 |
fromList:#('one' 'two' 'three' 'four') |
|
5039 |
values:#(1 2 3 4) |
|
5040 |
buttons:#('five' 'six' 'seven') |
|
5041 |
values:#(5 6 7) |
|
5042 |
lines:10 |
|
5043 |
cancel:nil |
|
5044 |
) |
|
5045 |
||
5046 |
||
5047 |
no buttons: |
|
5048 |
||
5049 |
Transcript showCR:( |
|
5050 |
Dialog |
|
5051 |
choose:'choose any' |
|
5052 |
fromList:#('one' 'two' 'three' 'four') |
|
5053 |
values:#(1 2 3 4) |
|
5054 |
buttons:nil |
|
5055 |
values:nil |
|
5056 |
lines:4 |
|
5057 |
cancel:nil |
|
5058 |
) |
|
5059 |
||
5060 |
||
5061 |
no list (lines argument is ignored): |
|
5062 |
||
5063 |
Transcript showCR:( |
|
5064 |
Dialog |
|
5065 |
choose:'choose any' |
|
5066 |
fromList:nil |
|
5067 |
values:nil |
|
5068 |
buttons:#('one' 'two' 'three' 'four') |
|
5069 |
values:#(1 2 3 4) |
|
5070 |
lines:nil |
|
5071 |
cancel:nil |
|
5072 |
) |
|
5073 |
||
5074 |
||
5075 |
full including cancel value: |
|
5076 |
||
5077 |
Transcript showCR:( |
|
5078 |
Dialog |
|
5079 |
choose:'choose example' |
|
5080 |
fromList:#('one' 'two' 'three' 'four') |
|
5081 |
values:#(1 2 3 4) |
|
5082 |
buttons:#('five' 'six' 'seven') |
|
5083 |
values:#(5 6 7) |
|
5084 |
lines:4 |
|
5085 |
cancel:[Transcript flash. #aborted] |
|
5086 |
) |
|
5087 |
||
5088 |
||
5089 |
degenerated: |
|
5090 |
||
5091 |
Transcript showCR:( |
|
5092 |
Dialog |
|
5093 |
choose:'choose any' |
|
5094 |
fromList:nil |
|
5095 |
values:nil |
|
5096 |
buttons:nil |
|
5097 |
values:nil |
|
5098 |
lines:nil |
|
5099 |
cancel:nil |
|
5100 |
) |
|
5101 |
||
5102 |
||
5103 |
" |
|
5104 |
||
3455 | 5105 |
"Modified: / 02-03-2007 / 12:08:12 / cg" |
2111 | 5106 |
! |
5107 |
||
5108 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple |
|
5109 |
"launch a Dialog showing the message and list. |
|
5110 |
The user can select an item and click ok; in this case, the corresponding value |
|
5111 |
from listValues is returned (doubleclick works as well). |
|
5112 |
The list may be suppressed (if the list arg is nil). |
|
5113 |
If a list is present, multiple controls if multiple selections are allowed. |
|
5114 |
Below the list, an optional row of buttons is shown, which can also be |
|
5115 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5116 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4642 | 5117 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
2111 | 5118 |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5119 |
^ self |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5120 |
choose:aString |
3455 | 5121 |
fromList:list values:listValues |
5122 |
buttons:buttonLabels values:buttonValues |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5123 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5124 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5125 |
multiple:multiple |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5126 |
postBuildBlock:nil |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5127 |
|
3455 | 5128 |
"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
|
5129 |
! |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5130 |
|
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5131 |
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
|
5132 |
"launch a Dialog showing the message and list. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5133 |
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
|
5134 |
from listValues is returned (doubleclick works as well). |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5135 |
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
|
5136 |
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
|
5137 |
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
|
5138 |
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
|
5139 |
If cancel is pressed, the value of cancelBlock is returned. |
4642 | 5140 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5141 |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5142 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5143 |
choose:aString |
3455 | 5144 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5145 |
initialSelection:nil |
3455 | 5146 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5147 |
default:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5148 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5149 |
cancel:cancelBlock |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5150 |
multiple:multiple |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5151 |
title:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5152 |
postBuildBlock:aBlockOrNil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5153 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5154 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5155 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5156 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5157 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5158 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5159 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5160 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5161 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5162 |
buttons:#('five' 'six' 'seven') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5163 |
values:#(5 6 7) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5164 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5165 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5166 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5167 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5168 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5169 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5170 |
no buttons: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5171 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5172 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5173 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5174 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5175 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5176 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5177 |
buttons:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5178 |
values:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5179 |
lines:4 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5180 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5181 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5182 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5183 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5184 |
|
3455 | 5185 |
"Modified: / 02-03-2007 / 12:08:02 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5186 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5187 |
|
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5188 |
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
|
5189 |
"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
|
5190 |
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
|
5191 |
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
|
5192 |
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
|
5193 |
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
|
5194 |
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
|
5195 |
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
|
5196 |
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
|
5197 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5198 |
^ self |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5199 |
choose:aString |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5200 |
fromList:list values:listValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5201 |
buttons:buttonLabels values:buttonValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5202 |
lines:maxLines |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5203 |
cancel:cancelBlock |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5204 |
multiple:false |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5205 |
postBuildBlock:postBuildBlock. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5206 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5207 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5208 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5209 |
full example: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5210 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5211 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5212 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5213 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5214 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5215 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5216 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5217 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5218 |
lines:10 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5219 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5220 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5221 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5222 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5223 |
no buttons: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5224 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5225 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5226 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5227 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5228 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5229 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5230 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5231 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5232 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5233 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5234 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5235 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5236 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5237 |
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
|
5238 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5239 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5240 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5241 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5242 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5243 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5244 |
buttons:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5245 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5246 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5247 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5248 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5249 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5250 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5251 |
full including cancel value: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5252 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5253 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5254 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5255 |
choose:'choose example' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5256 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5257 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5258 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5259 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5260 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5261 |
cancel:[Transcript flash. #aborted] |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5262 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5263 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5264 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5265 |
degenerated: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5266 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5267 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5268 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5269 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5270 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5271 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5272 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5273 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5274 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5275 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5276 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5277 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5278 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5279 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5280 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5281 |
"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
|
5282 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5283 |
|
3340 | 5284 |
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
|
5285 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5286 |
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
|
5287 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5288 |
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
|
5289 |
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
|
5290 |
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
|
5291 |
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
|
5292 |
If cancel is pressed, the value of cancelBlock is returned. |
4642 | 5293 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5294 |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5295 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5296 |
choose:aString |
3455 | 5297 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5298 |
initialSelection:initialListSelectionOrNil |
3455 | 5299 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5300 |
default:defaultValue |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5301 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5302 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5303 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5304 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5305 |
postBuildBlock:aBlockOrNil |
3455 | 5306 |
|
5307 |
"Modified: / 02-03-2007 / 12:07:57 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5308 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5309 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5310 |
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
|
5311 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5312 |
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
|
5313 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5314 |
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
|
5315 |
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
|
5316 |
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
|
5317 |
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
|
5318 |
If cancel is pressed, the value of cancelBlock is returned. |
4642 | 5319 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5320 |
|
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
|
5321 |
^ 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
|
5322 |
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
|
5323 |
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
|
5324 |
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
|
5325 |
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
|
5326 |
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
|
5327 |
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
|
5328 |
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
|
5329 |
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
|
5330 |
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
|
5331 |
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
|
5332 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5333 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5334 |
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
|
5335 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5336 |
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
|
5337 |
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
|
5338 |
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
|
5339 |
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
|
5340 |
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
|
5341 |
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
|
5342 |
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
|
5343 |
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
|
5344 |
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
|
5345 |
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
|
5346 |
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
|
5347 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5348 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5349 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5350 |
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
|
5351 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5352 |
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
|
5353 |
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
|
5354 |
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
|
5355 |
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
|
5356 |
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
|
5357 |
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
|
5358 |
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
|
5359 |
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
|
5360 |
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
|
5361 |
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
|
5362 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5363 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5364 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5365 |
"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
|
5366 |
! |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5367 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5368 |
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
|
5369 |
"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
|
5370 |
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
|
5371 |
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
|
5372 |
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
|
5373 |
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
|
5374 |
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
|
5375 |
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
|
5376 |
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
|
5377 |
If cancel is pressed, the value of cancelBlock is returned. |
4642 | 5378 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
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
|
5379 |
|
3469 | 5380 |
|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
|
5381 |
|
4871 | 5382 |
haveDefault := false. |
5383 |
||
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
|
5384 |
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
|
5385 |
(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
|
5386 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5387 |
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
|
5388 |
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
|
5389 |
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
|
5390 |
"/ 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
|
5391 |
"/ 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
|
5392 |
"/ ] ifFalse:[ |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5393 |
"/ 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
|
5394 |
"/ 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
|
5395 |
"/ ]. |
2111 | 5396 |
listView list:list. |
2116 | 5397 |
listView doubleClickAction:[:selectionIndex | |
4530 | 5398 |
|val okButton| |
2111 | 5399 |
|
2116 | 5400 |
multiple ifTrue:[ |
5401 |
val := selectionIndex collect:[:idx | listValues at:idx]. |
|
5402 |
] ifFalse:[ |
|
5403 |
val := listValues at:selectionIndex. |
|
5404 |
]. |
|
4530 | 5405 |
(box okButton notNil and:[box okButton isReturnButton]) ifTrue:[ |
5406 |
box destroy. |
|
5407 |
] ifFalse:[ |
|
5408 |
okButton := box allSubViewsDetect:[:v | v isDefault] ifNone:nil. |
|
5409 |
okButton notNil ifTrue:[ |
|
5410 |
okButton controller performAction |
|
5411 |
] |
|
5412 |
]. |
|
2111 | 5413 |
^ val |
5414 |
]. |
|
5415 |
listView multipleSelectOk:multiple. |
|
4530 | 5416 |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5417 |
initialListSelectionOrNil notNil ifTrue:[ |
3005 | 5418 |
multiple ifTrue:[ |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5419 |
listView selection:(initialListSelectionOrNil collect:[:each| listValues indexOf:each]) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5420 |
] ifFalse:[ |
3005 | 5421 |
listView selection:(listValues indexOf:initialListSelectionOrNil) |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5422 |
] |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5423 |
]. |
2111 | 5424 |
box addComponent:listView indent:(ViewSpacing // 2) withHeight:(listView heightForLines:maxLines). |
5425 |
box makeTabable:listView. |
|
3340 | 5426 |
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
|
5427 |
]. |
d3fe810390cb
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 |
|
2112 | 5429 |
buttonLabels size > 0 ifTrue:[ |
2111 | 5430 |
panel := HorizontalPanelView new. |
5431 |
panel horizontalLayout:#fitSpace. |
|
5432 |
buttonLabels keysAndValuesDo:[:index :label | |
|
5433 |
|b| |
|
5434 |
||
5435 |
b := Button label:label. |
|
5436 |
b action:[ |
|
4387
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5437 |
|val selectionValues listSelection| |
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5438 |
|
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5439 |
listSelection := listView selection. |
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5440 |
listSelection notNil ifTrue:[ |
4871 | 5441 |
listSelection isCollection ifFalse:[ listSelection := Array with:listSelection ]. |
4387
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5442 |
selectionValues := listValues isNil |
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5443 |
ifTrue:[ listSelection ] |
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5444 |
ifFalse:[ listSelection collect:[:idx | listValues at:idx]]. |
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
5445 |
]. |
2111 | 5446 |
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
|
5447 |
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
|
5448 |
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
|
5449 |
] 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
|
5450 |
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
|
5451 |
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
|
5452 |
]. |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5453 |
]. |
2111 | 5454 |
box destroy. |
5455 |
^ val |
|
5456 |
]. |
|
3340 | 5457 |
haveDefault ifFalse:[ |
5458 |
defaultValue notNil ifTrue:[ |
|
5459 |
(buttonValues at:index) = defaultValue ifTrue:[ |
|
5460 |
b isReturnButton:true. |
|
5461 |
haveDefault := true. |
|
5462 |
]. |
|
5463 |
]. |
|
5464 |
]. |
|
2111 | 5465 |
panel add:b. |
5466 |
box makeTabable:b. |
|
5467 |
]. |
|
5468 |
box addComponent:panel indent:0. "/ panel has its own idea of indenting |
|
3340 | 5469 |
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
|
5470 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5471 |
box addAbortButton. |
3340 | 5472 |
list notNil ifTrue:[ |
5473 |
haveDefault ifTrue:[ |
|
5474 |
(box addOkButton) isReturnButton:false. |
|
5475 |
] ifFalse:[ |
|
5476 |
box addOkButton. |
|
5477 |
]. |
|
5478 |
]. |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5479 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5480 |
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
|
5481 |
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
|
5482 |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5483 |
aBlockOrNil notNil ifTrue:[ |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5484 |
aBlockOrNil value:box |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5485 |
]. |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5486 |
windowTitle notNil ifTrue:[ |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5487 |
box label:windowTitle. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5488 |
]. |
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
|
5489 |
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
|
5490 |
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
|
5491 |
] 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
|
5492 |
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
|
5493 |
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
|
5494 |
] |
4104
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5495 |
]. |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5496 |
|
2439 | 5497 |
self showBox:box. |
4530 | 5498 |
|
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
|
5499 |
"/ 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
|
5500 |
"/ is the value returned by the button-value (which might be a block) |
2111 | 5501 |
|
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
|
5502 |
box accepted ifTrue:[ |
2111 | 5503 |
(sel := listView selection) notNil ifTrue:[ |
5504 |
box destroy. |
|
5505 |
sel isInteger ifTrue:[ |
|
5506 |
^ listValues at:sel |
|
3340 | 5507 |
]. |
5508 |
^ sel collect:[:idx | listValues at:idx] |
|
5509 |
]. |
|
5510 |
box destroy. |
|
4642 | 5511 |
^ multiple ifTrue:[ #() ] ifFalse:[ 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
|
5512 |
]. |
2111 | 5513 |
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
|
5514 |
^ cancelBlock value |
197 | 5515 |
|
5516 |
" |
|
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
|
5517 |
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
|
5518 |
|
2111 | 5519 |
Transcript showCR:( |
5520 |
Dialog |
|
5521 |
choose:'choose any' |
|
3340 | 5522 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
5523 |
initialSelection: nil |
|
5524 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
|
5525 |
default:6 |
|
2111 | 5526 |
lines:10 |
5527 |
cancel:nil |
|
5528 |
multiple:true |
|
3340 | 5529 |
postBuildBlock:nil |
2111 | 5530 |
) |
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
|
5531 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5532 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5533 |
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
|
5534 |
|
2111 | 5535 |
Transcript showCR:( |
5536 |
Dialog |
|
5537 |
choose:'choose any' |
|
5538 |
fromList:#('one' 'two' 'three' 'four') |
|
5539 |
values:#(1 2 3 4) |
|
5540 |
buttons:nil |
|
5541 |
values:nil |
|
5542 |
lines:4 |
|
5543 |
cancel:nil |
|
5544 |
multiple:true |
|
5545 |
) |
|
133 | 5546 |
" |
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
|
5547 |
|
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
|
5548 |
"Created: / 08-11-2011 / 12:15:20 / cg" |
3340 | 5549 |
! |
5550 |
||
5551 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
|
5552 |
"launch a Dialog showing the message and list. |
|
5553 |
The user can select an item and click ok; in this case, the corresponding value |
|
5554 |
from listValues is returned (doubleclick works as well). |
|
5555 |
The list may be suppressed (if the list arg is nil). |
|
5556 |
If a list is present, multiple controls if multiple selections are allowed. |
|
5557 |
Below the list, an optional row of buttons is shown, which can also be |
|
5558 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5559 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4642 | 5560 |
Pressing ok without a selection returns nil or an empty collection (if multiple is true)." |
3340 | 5561 |
|
5562 |
^ self |
|
5563 |
choose:aString |
|
3455 | 5564 |
fromList:list values:listValues |
3340 | 5565 |
initialSelection:initialListSelectionOrNil |
3455 | 5566 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5567 |
default:nil |
3340 | 5568 |
lines:maxLines |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5569 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5570 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5571 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5572 |
postBuildBlock:aBlockOrNil |
3340 | 5573 |
|
3455 | 5574 |
"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
|
5575 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5576 |
|
4581 | 5577 |
choose:aString fromList:list values:listValues lines:maxLines |
5578 |
"launch a Dialog showing the message and list. |
|
5579 |
The user can select an item and click ok; in this case, the corresponding value |
|
5580 |
from listValues is returned (doubleclick works as well). |
|
5581 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5582 |
Pressing ok without a selection is treated like cancel." |
|
5583 |
||
5584 |
^ self |
|
5585 |
choose:aString |
|
5586 |
fromList:(list collect:[:each| each printString]) values:listValues |
|
5587 |
initialSelection:nil |
|
5588 |
buttons:nil values:nil |
|
5589 |
default:nil |
|
5590 |
lines:maxLines |
|
5591 |
cancel:nil |
|
5592 |
multiple:false |
|
5593 |
title:nil |
|
5594 |
postBuildBlock:nil |
|
5595 |
||
5596 |
" |
|
5597 |
Transcript showCR:( |
|
5598 |
Dialog |
|
5599 |
choose:'choose any' |
|
5600 |
fromList:#('one' 'two' 'three') |
|
5601 |
values:#(1 2 3) |
|
5602 |
lines:4 |
|
5603 |
) |
|
5604 |
" |
|
5605 |
||
5606 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
|
5607 |
! |
|
5608 |
||
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
|
5609 |
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
|
5610 |
"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
|
5611 |
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
|
5612 |
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
|
5613 |
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
|
5614 |
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
|
5615 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5616 |
^ self |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5617 |
choose:aString |
3455 | 5618 |
fromList:list values:listValues |
5619 |
buttons:nil values:nil |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5620 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5621 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5622 |
multiple:false |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5623 |
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
|
5624 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5625 |
" |
655 | 5626 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5627 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5628 |
choose:'choose any' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5629 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5630 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5631 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5632 |
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
|
5633 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5634 |
|
655 | 5635 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5636 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5637 |
choose:'choose example' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5638 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5639 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5640 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5641 |
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
|
5642 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5643 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5644 |
|
3455 | 5645 |
"Modified: / 02-03-2007 / 12:07:42 / cg" |
5646 |
! |
|
5647 |
||
3630 | 5648 |
choose:aString fromList:list values:values lines:maxLines cancel:cancelBlock title:windowTitle |
5649 |
"launch a Dialog showing the message and list. |
|
5650 |
The user can select an item and click ok; in this case, the corresponding value |
|
5651 |
from listValues is returned (doubleclick works as well). |
|
5652 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5653 |
Pressing ok without a selection is treated like cancel." |
|
5654 |
||
5655 |
^ self |
|
5656 |
choose:aString |
|
5657 |
fromList:list values:values |
|
5658 |
initialSelection:nil |
|
5659 |
buttons:nil values:nil |
|
5660 |
default:nil |
|
5661 |
lines:maxLines |
|
5662 |
cancel:cancelBlock |
|
5663 |
multiple:false |
|
5664 |
title:windowTitle |
|
5665 |
postBuildBlock:nil |
|
5666 |
||
5667 |
" |
|
5668 |
Transcript showCR:( |
|
5669 |
Dialog |
|
5670 |
choose:'choose any' |
|
5671 |
fromList:#(1 2 3 4 5 6 7) |
|
5672 |
lines:4 |
|
5673 |
title:'Choose' |
|
5674 |
) |
|
5675 |
" |
|
5676 |
||
5677 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5678 |
! |
|
5679 |
||
3455 | 5680 |
choose:aString fromList:list values:values lines:maxLines initialSelection:initialSelection title:windowTitle |
5681 |
"launch a Dialog showing the message and list. |
|
5682 |
The user can select an item and click ok; in this case, the corresponding value |
|
5683 |
from listValues is returned (doubleclick works as well). |
|
5684 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5685 |
Pressing ok without a selection is treated like cancel." |
|
5686 |
||
5687 |
^ self |
|
5688 |
choose:aString |
|
5689 |
fromList:list values:values |
|
5690 |
initialSelection:initialSelection |
|
5691 |
buttons:nil values:nil |
|
5692 |
default:nil |
|
5693 |
lines:maxLines |
|
5694 |
cancel:nil |
|
5695 |
multiple:false |
|
5696 |
title:windowTitle |
|
5697 |
postBuildBlock:nil |
|
5698 |
||
5699 |
" |
|
5700 |
Transcript showCR:( |
|
5701 |
Dialog |
|
5702 |
choose:'choose any' |
|
5703 |
fromList:#(1 2 3 4 5 6 7) |
|
5704 |
lines:4 |
|
5705 |
title:'Choose' |
|
5706 |
) |
|
5707 |
" |
|
5708 |
||
5709 |
"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
|
5710 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5711 |
|
3630 | 5712 |
choose:aString fromList:list values:values lines:maxLines title:windowTitle |
5713 |
"launch a Dialog showing the message and list. |
|
5714 |
The user can select an item and click ok; in this case, the corresponding value |
|
5715 |
from listValues is returned (doubleclick works as well). |
|
5716 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5717 |
Pressing ok without a selection is treated like cancel." |
|
5718 |
||
5719 |
^ self |
|
5720 |
choose:aString |
|
5721 |
fromList:list values:values |
|
5722 |
initialSelection:nil |
|
5723 |
buttons:nil values:nil |
|
5724 |
default:nil |
|
5725 |
lines:maxLines |
|
5726 |
cancel:nil |
|
5727 |
multiple:false |
|
5728 |
title:windowTitle |
|
5729 |
postBuildBlock:nil |
|
5730 |
||
5731 |
" |
|
5732 |
Transcript showCR:( |
|
5733 |
Dialog |
|
5734 |
choose:'choose any' |
|
5735 |
fromList:#(1 2 3 4 5 6 7) |
|
5736 |
lines:4 |
|
5737 |
title:'Choose' |
|
5738 |
) |
|
5739 |
" |
|
5740 |
||
5741 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5742 |
! |
|
5743 |
||
2473 | 5744 |
choose:aString label:windowLabel image:imageOrNil labels:buttonLabels values:values default:default onCancel:cancelValue |
2472 | 5745 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
5746 |
Returning a corresponding value from the values-array. |
|
5747 |
The default entries button is marked as a return button and entering |
|
5748 |
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
|
5749 |
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
|
5750 |
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
|
5751 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5752 |
|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
|
5753 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5754 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
803 | 5755 |
windowLabel notNil ifTrue:[ |
2439 | 5756 |
box label:windowLabel |
803 | 5757 |
]. |
2473 | 5758 |
imageOrNil notNil ifTrue:[ |
5759 |
box image:imageOrNil |
|
5760 |
]. |
|
5761 |
||
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
|
5762 |
box buttonTitles:(self classResources array:buttonLabels) |
2439 | 5763 |
actions:(values collect:[:val | [answer := val]]). |
2472 | 5764 |
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
|
5765 |
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
|
5766 |
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
|
5767 |
idx ~~ 0 ifTrue:[box defaultButtonIndex:idx]. |
2439 | 5768 |
|
5769 |
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
|
5770 |
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
|
5771 |
^ 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
|
5772 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5773 |
"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
|
5774 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5775 |
Dialog |
2439 | 5776 |
choose:'choose any' |
2472 | 5777 |
label:'Foo Bar Baz' |
2439 | 5778 |
labels:#('one' 'two' 'three' 'four') |
5779 |
values:#(1 2 3 4) |
|
2472 | 5780 |
default:2 |
5781 |
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
|
5782 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5783 |
Dialog |
2439 | 5784 |
choose:'choose any' |
5785 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5786 |
values:#(nil foo bar baz) |
|
5787 |
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
|
5788 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5789 |
Dialog |
2439 | 5790 |
choose:'choose any' |
5791 |
labels:#('one' 'two' 'three' 'four') |
|
5792 |
values:#(1 2 3 4) |
|
5793 |
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
|
5794 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5795 |
|
2473 | 5796 |
"Modified: / 16.11.2001 / 14:55:33 / cg" |
5797 |
"Created: / 16.11.2001 / 15:04:16 / cg" |
|
5798 |
! |
|
5799 |
||
5800 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default |
|
5801 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5802 |
Returning a corresponding value from the values-array. |
|
5803 |
The default entries button is marked as a return button and entering |
|
5804 |
return will choose that value; hitting escape returns nil. |
|
5805 |
For a good userInterface style, we recommend this being the last |
|
5806 |
entry (to make the right-most button the default button)." |
|
5807 |
||
5808 |
^ self |
|
5809 |
choose:aString |
|
3455 | 5810 |
label:windowLabel image:nil |
5811 |
labels:buttonLabels values:values |
|
2473 | 5812 |
default:default |
5813 |
onCancel:nil |
|
5814 |
||
5815 |
"no good style (default button is not the rightmost one) |
|
5816 |
||
5817 |
Dialog |
|
5818 |
choose:'choose any' |
|
5819 |
labels:#('one' 'two' 'three' 'four') |
|
5820 |
values:#(1 2 3 4) |
|
5821 |
default:2 |
|
5822 |
||
5823 |
Dialog |
|
5824 |
choose:'choose any' |
|
5825 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5826 |
values:#(nil foo bar baz) |
|
5827 |
default:#baz |
|
5828 |
||
5829 |
Dialog |
|
5830 |
choose:'choose any' |
|
5831 |
labels:#('one' 'two' 'three' 'four') |
|
5832 |
values:#(1 2 3 4) |
|
5833 |
default:nil |
|
5834 |
" |
|
5835 |
||
3455 | 5836 |
"Created: / 22-07-1996 / 11:44:27 / cg" |
5837 |
"Modified: / 02-03-2007 / 12:09:01 / cg" |
|
2473 | 5838 |
! |
5839 |
||
5840 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default onCancel:cancelValue |
|
5841 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5842 |
Returning a corresponding value from the values-array. |
|
5843 |
The default entries button is marked as a return button and entering |
|
5844 |
return will choose that value; hitting escape returns cancelValue. |
|
5845 |
For a good userInterface style, we recommend this being the last |
|
5846 |
entry (to make the right-most button the default button)." |
|
5847 |
||
5848 |
^ self |
|
3455 | 5849 |
choose:aString |
5850 |
label:windowLabel image:nil |
|
2473 | 5851 |
labels:buttonLabels values:values |
5852 |
default:default onCancel:cancelValue |
|
5853 |
||
5854 |
"no good style (default button is not the rightmost one) |
|
5855 |
||
5856 |
Dialog |
|
5857 |
choose:'choose any' |
|
5858 |
label:'Foo Bar Baz' |
|
5859 |
labels:#('one' 'two' 'three' 'four') |
|
5860 |
values:#(1 2 3 4) |
|
5861 |
default:2 |
|
5862 |
onCancel:1 |
|
5863 |
||
5864 |
Dialog |
|
5865 |
choose:'choose any' |
|
5866 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5867 |
values:#(nil foo bar baz) |
|
5868 |
default:#baz |
|
5869 |
||
5870 |
Dialog |
|
5871 |
choose:'choose any' |
|
5872 |
labels:#('one' 'two' 'three' 'four') |
|
5873 |
values:#(1 2 3 4) |
|
5874 |
default:nil |
|
5875 |
" |
|
5876 |
||
3455 | 5877 |
"Created: / 16-11-2001 / 14:53:55 / cg" |
5878 |
"Modified: / 02-03-2007 / 12:08:44 / cg" |
|
803 | 5879 |
! |
5880 |
||
5881 |
choose:aString labels:buttonLabels values:values default:default |
|
5882 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5883 |
Returning a corresponding value from the values-array. |
|
5884 |
The default entries button is marked as a return button and entering |
|
5885 |
return will choose that value. |
|
5886 |
For a good userInterface style, we recommend this being the last |
|
5887 |
entry (to make the right-most button the default button)." |
|
5888 |
||
5889 |
^ self |
|
2473 | 5890 |
choose:aString |
3455 | 5891 |
label:nil image:nil |
5892 |
labels:buttonLabels values:values |
|
2473 | 5893 |
default:default |
5894 |
onCancel:nil |
|
803 | 5895 |
|
5896 |
||
5897 |
"no good style (default button is not the rightmost one) |
|
5898 |
||
5899 |
Dialog |
|
2473 | 5900 |
choose:'choose any' |
5901 |
labels:#('one' 'two' 'three' 'four') |
|
5902 |
values:#(1 2 3 4) |
|
5903 |
default:2 |
|
803 | 5904 |
|
5905 |
Dialog |
|
2473 | 5906 |
choose:'choose any' |
5907 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5908 |
values:#(nil foo bar baz) |
|
5909 |
default:#baz |
|
803 | 5910 |
|
5911 |
Dialog |
|
2473 | 5912 |
choose:'choose any' |
5913 |
labels:#('one' 'two' 'three' 'four') |
|
5914 |
values:#(1 2 3 4) |
|
5915 |
default:nil |
|
5916 |
" |
|
5917 |
||
3455 | 5918 |
"Modified: / 02-03-2007 / 12:08:55 / cg" |
2111 | 5919 |
! |
5920 |
||
4642 | 5921 |
chooseMultiple:aString fromList:list lines:maxLines |
5922 |
"launch a Dialog showing the message and list. |
|
5923 |
The user can select any combination of items and click ok; |
|
5924 |
in this case, the values from list is returned (doubleclick works as well). |
|
5925 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5926 |
Pressing ok without a selection returns an empty collection." |
|
5927 |
||
5928 |
^ self |
|
5929 |
choose:aString |
|
5930 |
fromList:(list collect:[:each| each printString]) values:list |
|
5931 |
initialSelection:nil |
|
5932 |
buttons:nil values:nil |
|
5933 |
default:#() |
|
5934 |
lines:maxLines |
|
5935 |
cancel:nil |
|
5936 |
multiple:true |
|
5937 |
title:nil |
|
5938 |
postBuildBlock:nil |
|
5939 |
||
5940 |
" |
|
5941 |
Transcript showCR:( |
|
5942 |
Dialog |
|
5943 |
chooseMultiple:'choose any combination' |
|
5944 |
fromList:#(1 2 3 4 5 6 7) |
|
5945 |
lines:4 |
|
5946 |
) |
|
5947 |
" |
|
5948 |
||
5949 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
|
5950 |
! |
|
5951 |
||
2111 | 5952 |
chooseMultiple:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock |
5953 |
"launch a Dialog showing the message and list. |
|
5954 |
The user can select an item and click ok; in this case, the corresponding value |
|
5955 |
from listValues is returned (doubleclick works as well). |
|
5956 |
The list may be suppressed (if the list arg is nil). |
|
5957 |
Below the list, an optional row of buttons is shown, which can also be |
|
5958 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5959 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4642 | 5960 |
Pressing ok without a selection returns an empty collection." |
2111 | 5961 |
|
5962 |
^ self |
|
5963 |
choose:aString |
|
3455 | 5964 |
fromList:list values:listValues |
5965 |
buttons:buttonLabels values:buttonValues |
|
2111 | 5966 |
lines:maxLines |
5967 |
cancel:cancelBlock |
|
5968 |
multiple:true |
|
5969 |
||
5970 |
" |
|
5971 |
full example: |
|
5972 |
||
5973 |
Transcript showCR:( |
|
5974 |
Dialog |
|
2112 | 5975 |
chooseMultiple:'choose selected' |
2111 | 5976 |
fromList:#('one' 'two' 'three' 'four') |
5977 |
values:#(1 2 3 4) |
|
5978 |
buttons:nil |
|
5979 |
values:nil |
|
5980 |
lines:10 |
|
5981 |
cancel:nil |
|
5982 |
) |
|
2112 | 5983 |
|
5984 |
Transcript showCR:( |
|
5985 |
Dialog |
|
5986 |
chooseMultiple:'choose selected' |
|
5987 |
fromList:#('one' 'two' 'three' 'four') |
|
5988 |
values:#(1 2 3 4) |
|
5989 |
buttons:#() |
|
5990 |
values:#() |
|
5991 |
lines:10 |
|
5992 |
cancel:nil |
|
5993 |
) |
|
2111 | 5994 |
" |
5995 |
||
3455 | 5996 |
"Modified: / 02-03-2007 / 12:09:10 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5997 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5998 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5999 |
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
|
6000 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6001 |
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
|
6002 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6003 |
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
|
6004 |
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
|
6005 |
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
|
6006 |
If cancel is pressed, the value of cancelBlock is returned. |
4642 | 6007 |
Pressing ok without a selection returns an empty collection." |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6008 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6009 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6010 |
choose:aString |
3455 | 6011 |
fromList:list values:listValues |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6012 |
initialSelection:initialListSelectionOrNil |
3455 | 6013 |
buttons:nil values:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6014 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6015 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6016 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6017 |
postBuildBlock:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6018 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6019 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6020 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6021 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6022 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6023 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6024 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6025 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6026 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6027 |
initialSelection:#(2 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6028 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6029 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6030 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6031 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6032 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6033 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6034 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6035 |
values:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6036 |
initialSelection:#( 'two' 'three') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6037 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6038 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6039 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
6040 |
|
3455 | 6041 |
"Created: / 18-08-2000 / 22:38:13 / cg" |
6042 |
"Modified: / 02-03-2007 / 12:09:15 / cg" |
|
100 | 6043 |
! ! |
6044 |
||
2439 | 6045 |
!DialogBox class methodsFor:'private'! |
6046 |
||
6047 |
showAndThenDestroyBox:aBox |
|
4502 | 6048 |
[ |
6049 |
self showBox:aBox. |
|
6050 |
] ensure:[ |
|
6051 |
aBox destroy |
|
6052 |
] |
|
2439 | 6053 |
! |
6054 |
||
6055 |
showBox:aBox |
|
2666
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
6056 |
|wg v| |
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
6057 |
|
2439 | 6058 |
ForceModalBoxesToOpenAtCenter == true ifTrue:[ |
6059 |
aBox showAtCenter. |
|
3888 | 6060 |
^ self. |
6061 |
]. |
|
6062 |
ForceModalBoxesToOpenAtPointer == true ifTrue:[ |
|
6063 |
aBox showAtPointer. |
|
6064 |
^ self. |
|
6065 |
]. |
|
6066 |
||
6067 |
wg := WindowGroup activeGroup. |
|
6068 |
wg isNil ifTrue:[ |
|
6069 |
aBox showAtCenter. |
|
6070 |
^ self. |
|
6071 |
]. |
|
4690 | 6072 |
wg isDebugged ifTrue:[ |
6073 |
aBox showAtPointer. |
|
6074 |
^ self. |
|
6075 |
]. |
|
6076 |
||
3888 | 6077 |
wg isModal ifTrue:[ |
6078 |
v := wg mainView. |
|
6079 |
v notNil ifTrue:[ |
|
6080 |
aBox showCenteredIn:v. |
|
6081 |
^ self. |
|
6082 |
]. |
|
6083 |
]. |
|
6084 |
||
6085 |
v := wg mainGroup mainView. |
|
6086 |
v isNil ifTrue:[ |
|
6087 |
aBox showAtCenter. |
|
6088 |
^ self. |
|
6089 |
]. |
|
6090 |
||
6091 |
aBox showCenteredIn:v. |
|
4690 | 6092 |
|
6093 |
"Modified: / 29-08-2013 / 16:39:29 / cg" |
|
2439 | 6094 |
! ! |
6095 |
||
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6096 |
!DialogBox class methodsFor:'queries'! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6097 |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6098 |
defaultOKButtonAtLeft |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6099 |
"somewhat of a kludge: |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6100 |
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
|
6101 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6102 |
^ (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
|
6103 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6104 |
" |
2694 | 6105 |
DialogBox defaultOKButtonAtLeft |
6106 |
" |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6107 |
! |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
6108 |
|
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6109 |
defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6110 |
"return a default parent (top-) window for the dialog. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6111 |
Here, the currently active view is returned, if there |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6112 |
is one; otherwise, the first encountered topView is |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6113 |
returned." |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6114 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6115 |
|activeGroup| |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6116 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6117 |
activeGroup := WindowGroup activeGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6118 |
activeGroup isNil ifTrue:[ |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6119 |
"/ mhmh - looks like I am a background process ... |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6120 |
activeGroup := Transcript windowGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6121 |
activeGroup isNil ifTrue:[^ nil]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6122 |
]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6123 |
^ activeGroup topViews first. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6124 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6125 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6126 |
self defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6127 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6128 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6129 |
"Modified: / 16.6.1998 / 12:36:15 / cg" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6130 |
! ! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
6131 |
|
2486 | 6132 |
!DialogBox class methodsFor:'smalltalk dialogs'! |
6133 |
||
3276 | 6134 |
requestClass:aString |
6135 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
6136 |
Return the entered class or nil (if cancel was pressed). |
|
6137 |
The entryField does classNameCompletion on TAB." |
|
6138 |
||
6139 |
^ self requestClass:aString okLabel:'OK' initialAnswer:nil. |
|
6140 |
||
6141 |
" |
|
6142 |
Dialog |
|
6143 |
requestClass:'Enter a class:' |
|
6144 |
" |
|
6145 |
! |
|
6146 |
||
3282 | 6147 |
requestClass:aString initialAnswer:initialAnswer |
6148 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
6149 |
Return the entered class or nil (if cancel was pressed). |
|
6150 |
The entryField does classNameCompletion on TAB." |
|
6151 |
||
6152 |
^ self requestClass:aString okLabel:'OK' initialAnswer:initialAnswer. |
|
6153 |
||
6154 |
" |
|
6155 |
Dialog |
|
6156 |
requestClass:'Enter a class:' |
|
6157 |
initialAnswer:'Array' |
|
6158 |
" |
|
6159 |
! |
|
6160 |
||
3532 | 6161 |
requestClass:aString list:list okLabel:okLabel initialAnswer:initial |
3276 | 6162 |
"launch a Dialog, which allows user to enter an existing classes name. |
6163 |
Return the entered class or nil (if cancel was pressed). |
|
3181 | 6164 |
The entryField does classNameCompletion on TAB." |
6165 |
||
6166 |
|className| |
|
6167 |
||
3532 | 6168 |
className := self requestClassName:aString list:list okLabel:okLabel initialAnswer:initial. |
3276 | 6169 |
className isEmptyOrNil ifTrue:[^ nil]. |
3181 | 6170 |
^ Smalltalk classNamed:className |
6171 |
||
6172 |
" |
|
6173 |
Dialog |
|
3276 | 6174 |
requestClass:'Enter a class:' |
5028 | 6175 |
list:(View withAllSubclasses copy sortBySelector:#name) |
3181 | 6176 |
okLabel:'OK' |
6177 |
initialAnswer:'Arr' |
|
6178 |
" |
|
3532 | 6179 |
|
6180 |
"Created: / 12-01-2008 / 23:02:28 / cg" |
|
6181 |
! |
|
6182 |
||
6183 |
requestClass:aString okLabel:okLabel initialAnswer:initial |
|
6184 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
6185 |
Return the entered class or nil (if cancel was pressed). |
|
6186 |
The entryField does classNameCompletion on TAB." |
|
6187 |
||
6188 |
^ self requestClass:aString list:nil okLabel:okLabel initialAnswer:initial |
|
6189 |
||
6190 |
" |
|
6191 |
Dialog |
|
6192 |
requestClass:'Enter a class:' |
|
6193 |
okLabel:'OK' |
|
6194 |
initialAnswer:'Arr' |
|
6195 |
" |
|
6196 |
||
6197 |
"Modified: / 12-01-2008 / 23:02:42 / cg" |
|
6198 |
! |
|
6199 |
||
4541 | 6200 |
requestClassName:aString initialAnswer:initial |
6201 |
"launch a Dialog, which allows user to enter a class name. |
|
6202 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6203 |
The entryField does classNameCompletion on TAB." |
|
6204 |
||
6205 |
^ self requestClassName:aString list:nil okLabel:'OK' initialAnswer:initial |
|
6206 |
||
6207 |
" |
|
6208 |
Dialog |
|
6209 |
requestClassName:'enter a class:' |
|
6210 |
initialAnswer:'Arr' |
|
6211 |
" |
|
6212 |
||
6213 |
"Modified: / 12-01-2008 / 22:58:13 / cg" |
|
6214 |
! |
|
6215 |
||
3532 | 6216 |
requestClassName:aString list:list okLabel:okLabel initialAnswer:initial |
3181 | 6217 |
"launch a Dialog, which allows user to enter a class name. |
6218 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6219 |
The entryField does classNameCompletion on TAB." |
|
6220 |
||
6221 |
^ self |
|
6222 |
request:aString |
|
6223 |
displayAt:nil |
|
6224 |
centered:nil |
|
6225 |
action:nil |
|
6226 |
initialAnswer:initial |
|
6227 |
okLabel:okLabel |
|
6228 |
cancelLabel:nil |
|
6229 |
title:nil |
|
6230 |
onCancel:nil |
|
3532 | 6231 |
list:list |
3181 | 6232 |
initialSelection:nil |
3182 | 6233 |
entryCompletionBlock:DoWhatIMeanSupport classNameEntryCompletionBlock |
3181 | 6234 |
|
6235 |
" |
|
6236 |
Dialog |
|
3532 | 6237 |
requestClassName:'Enter a class:' |
6238 |
list:(Array with:Array with:String with:Point) |
|
6239 |
okLabel:'OK' |
|
6240 |
initialAnswer:'Arr' |
|
6241 |
" |
|
6242 |
||
6243 |
"Created: / 12-01-2008 / 22:58:01 / cg" |
|
6244 |
! |
|
6245 |
||
6246 |
requestClassName:aString okLabel:okLabel initialAnswer:initial |
|
6247 |
"launch a Dialog, which allows user to enter a class name. |
|
6248 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6249 |
The entryField does classNameCompletion on TAB." |
|
6250 |
||
6251 |
^ self requestClassName:aString list:nil okLabel:okLabel initialAnswer:initial |
|
6252 |
||
6253 |
" |
|
6254 |
Dialog |
|
3181 | 6255 |
requestClassName:'enter a class:' |
6256 |
okLabel:'OK' |
|
6257 |
initialAnswer:'Arr' |
|
6258 |
" |
|
3532 | 6259 |
|
6260 |
"Modified: / 12-01-2008 / 22:58:13 / cg" |
|
3181 | 6261 |
! |
6262 |
||
3538 | 6263 |
requestName:title fromList:nameList title:boxTitle initialAnswer:initialTextOrNil |
6264 |
"Ask for a name from a list (used for namespaces and sharedPools)" |
|
6265 |
||
6266 |
|newName box| |
|
6267 |
||
6268 |
box := ListSelectionBox new. |
|
6269 |
box title:title. |
|
6270 |
box list:nameList. |
|
6271 |
box okAction:[:sel | newName := sel]. |
|
6272 |
box initialText:initialTextOrNil. |
|
6273 |
boxTitle notNil ifTrue:[ box label:boxTitle ]. |
|
6274 |
box showAtPointer. |
|
6275 |
||
6276 |
newName notNil ifTrue:[ |
|
6277 |
newName := newName withoutSeparators. |
|
6278 |
]. |
|
6279 |
^ newName |
|
6280 |
||
6281 |
" |
|
6282 |
Dialog |
|
6283 |
requestName:'Select a Name' |
|
6284 |
fromList:#('foo' 'bar' 'baz') |
|
6285 |
title:'blabla' |
|
6286 |
initialAnswer:nil |
|
6287 |
" |
|
6288 |
! |
|
6289 |
||
2486 | 6290 |
requestNameSpace:title initialAnswer:initialTextOrNil |
6291 |
"Ask for a namespaces name" |
|
6292 |
||
2996 | 6293 |
^ self |
6294 |
requestNameSpace:title |
|
3538 | 6295 |
title:title |
2996 | 6296 |
initialAnswer:initialTextOrNil |
6297 |
||
6298 |
" |
|
3538 | 6299 |
Dialog |
6300 |
requestNameSpace:'Select a NameSpace' |
|
6301 |
initialAnswer:nil |
|
2996 | 6302 |
" |
6303 |
! |
|
6304 |
||
6305 |
requestNameSpace:title title:boxTitle initialAnswer:initialTextOrNil |
|
6306 |
"Ask for a namespaces name" |
|
6307 |
||
3538 | 6308 |
|allNameSpaces| |
2486 | 6309 |
|
3282 | 6310 |
allNameSpaces := NameSpace allNameSpaces collect:[:each | each name]. |
2486 | 6311 |
allNameSpaces := allNameSpaces asOrderedCollection sort. |
6312 |
||
3538 | 6313 |
^ self |
6314 |
requestName:title |
|
6315 |
fromList:allNameSpaces |
|
6316 |
title:boxTitle |
|
6317 |
initialAnswer:initialTextOrNil |
|
6318 |
||
6319 |
" |
|
6320 |
Dialog |
|
6321 |
requestNameSpace:'Select a NameSpace' |
|
6322 |
initialAnswer:nil |
|
2486 | 6323 |
" |
6324 |
! |
|
6325 |
||
3736 | 6326 |
requestProject:title from:listOfProjects initialAnswer:initialTextOrNil suggestions:suggestions |
3384 | 6327 |
"Ask for a project (package-id)" |
6328 |
||
3736 | 6329 |
|newProject box| |
3384 | 6330 |
|
6331 |
box := ListSelectionBox new. |
|
6332 |
box useComboBoxWithList:suggestions. |
|
6333 |
box title:title. |
|
3736 | 6334 |
box list:listOfProjects. |
3384 | 6335 |
box okAction:[:sel | newProject := sel]. |
6336 |
box initialText:initialTextOrNil. |
|
6337 |
box entryCompletionBlock:(DoWhatIMeanSupport packageNameEntryCompletionBlock). |
|
4307
f7c4d912269c
changed: #requestProject:from:initialAnswer:suggestions:
Claus Gittinger <cg@exept.de>
parents:
4302
diff
changeset
|
6338 |
box label:'Enter Project/PackageID'. |
3384 | 6339 |
box showAtPointer. |
6340 |
||
6341 |
newProject notNil ifTrue:[ |
|
6342 |
newProject := newProject withoutSeparators asSymbol. |
|
6343 |
]. |
|
6344 |
^ newProject |
|
6345 |
||
6346 |
" |
|
6347 |
Dialog |
|
6348 |
requestProject:'enter a project' |
|
6349 |
initialAnswer:'stx:libbasic' |
|
6350 |
suggestions:#('foo' 'bar' 'baz') |
|
6351 |
" |
|
6352 |
||
6353 |
"Created: / 07-09-2006 / 11:40:17 / cg" |
|
6354 |
! |
|
6355 |
||
3736 | 6356 |
requestProject:title initialAnswer:initialTextOrNil suggestions:suggestions |
6357 |
"Ask for a project (package-id)" |
|
6358 |
||
6359 |
|allProjects| |
|
6360 |
||
6361 |
allProjects := Smalltalk allProjectIDs. |
|
6362 |
^ self |
|
6363 |
requestProject:title |
|
6364 |
from:allProjects |
|
6365 |
initialAnswer:initialTextOrNil |
|
6366 |
suggestions:suggestions |
|
6367 |
! |
|
6368 |
||
2486 | 6369 |
requestSelector:aString initialAnswer:initial |
6370 |
"launch a Dialog, which allows user to enter a method selector. |
|
6371 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6372 |
The entryField does selectorCompletion on TAB." |
|
6373 |
||
6374 |
^ self requestSelector:aString okLabel:nil initialAnswer:initial |
|
6375 |
||
6376 |
" |
|
6377 |
Dialog |
|
6378 |
requestSelector:'enter a selector:' |
|
6379 |
initialAnswer:'at:p' |
|
6380 |
" |
|
6381 |
! |
|
6382 |
||
6383 |
requestSelector:aString okLabel:okLabel initialAnswer:initial |
|
6384 |
"launch a Dialog, which allows user to enter a method selector. |
|
6385 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6386 |
The entryField does selectorCompletion on TAB." |
|
6387 |
||
6388 |
^ self |
|
6389 |
request:aString |
|
6390 |
displayAt:nil |
|
6391 |
centered:nil |
|
6392 |
action:nil |
|
6393 |
initialAnswer:initial |
|
6394 |
okLabel:okLabel |
|
6395 |
cancelLabel:nil |
|
6396 |
title:nil |
|
6397 |
onCancel:nil |
|
6398 |
list:nil |
|
6399 |
initialSelection:nil |
|
2629 | 6400 |
entryCompletionBlock:[:s :field| |
6401 |
|completion| |
|
2486 | 6402 |
|
6403 |
completion := Smalltalk selectorCompletion:s. |
|
3881 | 6404 |
completion second size > 1 ifTrue:[ |
6405 |
UserPreferences current beepInEditor ifTrue:[ |
|
6406 |
Screen current beep |
|
6407 |
]. |
|
6408 |
]. |
|
2629 | 6409 |
field contents:(completion first) |
2486 | 6410 |
] |
6411 |
||
6412 |
" |
|
6413 |
Dialog |
|
6414 |
requestSelector:'enter a selector:' |
|
6415 |
initialAnswer:'at:p' |
|
6416 |
" |
|
3538 | 6417 |
! |
6418 |
||
6419 |
requestSharedPool:title title:boxTitle initialAnswer:initialTextOrNil |
|
6420 |
"Ask for a sharedPools name" |
|
6421 |
||
6422 |
|allPools| |
|
6423 |
||
6424 |
allPools := SharedPool allSubclasses collect:[:each | each name]. |
|
6425 |
allPools := allPools asOrderedCollection sort. |
|
6426 |
||
6427 |
^ self |
|
6428 |
requestName:title |
|
6429 |
fromList:allPools |
|
6430 |
title:boxTitle |
|
6431 |
initialAnswer:initialTextOrNil |
|
6432 |
||
6433 |
" |
|
6434 |
Dialog |
|
6435 |
requestSharedPool:'Select a SharedPool' |
|
6436 |
title:nil |
|
6437 |
initialAnswer:nil |
|
6438 |
" |
|
2486 | 6439 |
! ! |
6440 |
||
197 | 6441 |
!DialogBox methodsFor:'accessing-behavior'! |
6442 |
||
6443 |
abortAction:aBlock |
|
6444 |
"define the action to be performed when abort is pressed" |
|
6445 |
||
6446 |
abortAction := aBlock |
|
125 | 6447 |
! |
6448 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6449 |
acceptCheck:aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6450 |
"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
|
6451 |
accepted (ok-button or Return-key). If it returns true, the box is closed, |
2106 | 6452 |
otherwise not. Of course, you may also use a valueHolder instead of a block |
6453 |
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
|
6454 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6455 |
acceptCheck := aBlock |
2106 | 6456 |
|
6457 |
"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
|
6458 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6459 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6460 |
acceptOnLeave:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6461 |
"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
|
6462 |
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
|
6463 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6464 |
acceptOnLeave := aBoolean. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6465 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6466 |
"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
|
6467 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6468 |
|
197 | 6469 |
acceptReturnAsOK:aBoolean |
6470 |
"turn on/off interpretation of return-key as ok. |
|
6471 |
Default is on" |
|
6472 |
||
6473 |
acceptReturnAsOK := aBoolean. |
|
6474 |
okButton notNil ifTrue:[ |
|
6475 |
okButton isReturnButton:aBoolean. |
|
6476 |
] |
|
6477 |
! |
|
6478 |
||
6479 |
action:aBlock |
|
6480 |
"set the action to be performed when user presses ok-button; |
|
6481 |
aBlock must be nil or a block. This method simply |
|
6482 |
reuses okAction: and has been added for a consistent action-setting |
|
6483 |
protocol." |
|
76 | 6484 |
|
197 | 6485 |
self okAction:aBlock |
6486 |
! |
|
6487 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6488 |
focusOnField:anInputField |
1646 | 6489 |
"arrange for the argument to get the focus (initially)" |
6490 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6491 |
inputFieldGroup makeActive:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6492 |
|
1646 | 6493 |
"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
|
6494 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6495 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6496 |
focusToOKOnLeave:aBoolean |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6497 |
"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
|
6498 |
or cursor key. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6499 |
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
|
6500 |
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
|
6501 |
the dialog is accepted & closed." |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6502 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6503 |
focusToOKOnLeave := aBoolean. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6504 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6505 |
"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
|
6506 |
"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
|
6507 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6508 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6509 |
hideOnAccept:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6510 |
"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
|
6511 |
The default is true" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6512 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6513 |
hideOnAccept := aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6514 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6515 |
|
593 | 6516 |
makeTabable:aComponentOrSubcomponent |
6517 |
"add a component (usually a subcomponent, of which the dialog |
|
6518 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6519 |
stepped through via FocusNext/FocusPrevious). |
|
6520 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6521 |
||
3467 | 6522 |
aComponentOrSubcomponent canTab:true. |
6523 |
||
6524 |
"/ tabableElements isNil ifTrue:[ |
|
6525 |
"/ tabableElements := OrderedCollection new |
|
6526 |
"/ ]. |
|
6527 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6528 |
"/ tabableElements add:aComponentOrSubcomponent. |
|
6529 |
"/ ]. |
|
6530 |
||
6531 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6532 |
self addToInputFieldGroup:aComponentOrSubcomponent |
|
593 | 6533 |
]. |
6534 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
6535 |
"Modified: 31.5.1996 / 21:22:13 / cg" |
593 | 6536 |
! |
6537 |
||
1843 | 6538 |
makeTabable:aComponentOrSubcomponent after:anotherComponent |
6539 |
"add a component (usually a subcomponent, of which the dialog |
|
6540 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6541 |
stepped through via FocusNext/FocusPrevious). |
|
6542 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6543 |
||
3467 | 6544 |
<resource: #obsolete> |
6545 |
self obsoleteMethodWarning. "/ focusSequence has been eliminated |
|
6546 |
||
6547 |
aComponentOrSubcomponent canTab:true. |
|
6548 |
||
6549 |
"/ tabableElements isNil ifTrue:[ |
|
6550 |
"/ tabableElements := OrderedCollection new |
|
6551 |
"/ ]. |
|
6552 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent ifAbsent:nil. |
|
6553 |
"/ |
|
6554 |
"/ anotherComponent isNil ifTrue:[ |
|
6555 |
"/ tabableElements addLast:aComponentOrSubcomponent |
|
6556 |
"/ ] ifFalse:[ |
|
6557 |
"/ tabableElements add:aComponentOrSubcomponent after:anotherComponent. |
|
6558 |
"/ ]. |
|
6559 |
"/ |
|
1843 | 6560 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
6561 |
self addToInputFieldGroup:aComponentOrSubcomponent after:anotherComponent |
|
6562 |
]. |
|
6563 |
||
6564 |
"Modified: 18.10.1997 / 03:08:20 / cg" |
|
6565 |
! |
|
6566 |
||
1355 | 6567 |
makeUntabable:aComponentOrSubcomponent |
3467 | 6568 |
aComponentOrSubcomponent canTab:false. |
6569 |
||
6570 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6571 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent. |
|
6572 |
"/ ]. |
|
6573 |
||
6574 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6575 |
self removeFromInputFieldGroup:aComponentOrSubcomponent |
|
1355 | 6576 |
]. |
6577 |
||
6578 |
"Modified: 18.10.1997 / 02:50:05 / cg" |
|
593 | 6579 |
! |
6580 |
||
2361 | 6581 |
noAction:aBlock |
6582 |
"define the action to be performed when 'no' is pressed" |
|
6583 |
||
6584 |
abortAction := aBlock |
|
6585 |
||
6586 |
"Modified: 16.1.1997 / 11:29:18 / cg" |
|
6587 |
! |
|
6588 |
||
197 | 6589 |
okAction:aBlock |
6590 |
"define the action to be performed when ok is pressed" |
|
133 | 6591 |
|
197 | 6592 |
okAction := aBlock |
2361 | 6593 |
! |
6594 |
||
6595 |
title:aString yesAction:yesBlock noAction:noBlock |
|
6596 |
"define title and actions" |
|
6597 |
||
6598 |
self title:aString. |
|
6599 |
okAction := yesBlock. |
|
6600 |
abortAction := noBlock |
|
6601 |
! |
|
6602 |
||
6603 |
yesAction:aBlock |
|
6604 |
"define the action to be performed when 'yes' is pressed" |
|
6605 |
||
6606 |
okAction := aBlock |
|
6607 |
||
6608 |
"Modified: 16.1.1997 / 11:31:21 / cg" |
|
6609 |
! |
|
6610 |
||
6611 |
yesAction:yesBlock noAction:noBlock |
|
6612 |
"define both actions" |
|
6613 |
||
6614 |
okAction := yesBlock. |
|
6615 |
abortAction := noBlock |
|
197 | 6616 |
! ! |
6617 |
||
6618 |
!DialogBox methodsFor:'accessing-components'! |
|
6619 |
||
6620 |
abortButton |
|
6621 |
"return the abortButton - this access is provided to allow |
|
6622 |
setting the buttons look (for example: colors or font)" |
|
6623 |
||
6624 |
^ abortButton |
|
76 | 6625 |
! |
6626 |
||
2327 | 6627 |
buttonPanel |
6628 |
"return the buttonPanel - this access is provided to allow |
|
6629 |
setting the buttons look (for example: colors or font)" |
|
6630 |
||
6631 |
^ buttonPanel |
|
6632 |
! |
|
6633 |
||
2147
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6634 |
cancelButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6635 |
"same as #abortButton; |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6636 |
return the abortButton - this access is provided to allow |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6637 |
setting the buttons look (for example: colors or font)" |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6638 |
|
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6639 |
^ self abortButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6640 |
! |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6641 |
|
2361 | 6642 |
noButton |
6643 |
"return the no-button" |
|
6644 |
||
6645 |
^ abortButton |
|
6646 |
! |
|
6647 |
||
197 | 6648 |
okButton |
6649 |
"return the okButton - this access is provided to allow |
|
6650 |
setting the buttons look (for example: colors or font)" |
|
76 | 6651 |
|
197 | 6652 |
^ okButton |
2361 | 6653 |
! |
6654 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6655 |
verticalPanel |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6656 |
"if there is none yet, create and add a vertical panel. |
4384
cd3a12b6fbf1
comment/format in: #verticalPanel
Claus Gittinger <cg@exept.de>
parents:
4380
diff
changeset
|
6657 |
This can be used to add 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
|
6658 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6659 |
|savedY| |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6660 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6661 |
verticalPanel isNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6662 |
savedY := yPosition. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6663 |
self addComponent:(verticalPanel := VerticalPanelView new). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6664 |
verticalPanel horizontalLayout:#fit. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6665 |
verticalPanel verticalLayout:#top. |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6666 |
verticalPanel height:25. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6667 |
yPosition := savedY. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6668 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6669 |
^ verticalPanel |
4384
cd3a12b6fbf1
comment/format in: #verticalPanel
Claus Gittinger <cg@exept.de>
parents:
4380
diff
changeset
|
6670 |
|
cd3a12b6fbf1
comment/format in: #verticalPanel
Claus Gittinger <cg@exept.de>
parents:
4380
diff
changeset
|
6671 |
"Modified (comment): / 28-02-2012 / 15:46:23 / cg" |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6672 |
! |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6673 |
|
2361 | 6674 |
yesButton |
6675 |
"return the 'yes'-button" |
|
6676 |
||
6677 |
^ okButton |
|
6678 |
||
6679 |
"Modified: 16.1.1997 / 11:31:27 / cg" |
|
197 | 6680 |
! ! |
155 | 6681 |
|
197 | 6682 |
!DialogBox methodsFor:'accessing-elements'! |
6683 |
||
6684 |
componentAt:name |
|
680 | 6685 |
"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
|
6686 |
named previously with #name:as:" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6687 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6688 |
namedComponents isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6689 |
^ namedComponents at:name ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6690 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6691 |
"Modified: 16.1.1997 / 11:40:50 / cg" |
76 | 6692 |
! |
6693 |
||
197 | 6694 |
name:element as:name |
680 | 6695 |
"assign a name to a component. This can be done during construction, |
6696 |
to allow later access to the components (i.e. without a need to |
|
6697 |
remember them in some instVars)" |
|
6698 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6699 |
namedComponents isNil ifTrue:[ |
1401 | 6700 |
namedComponents := Dictionary new. |
197 | 6701 |
]. |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6702 |
namedComponents at:name put:element |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6703 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6704 |
"Modified: 16.1.1997 / 11:41:03 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6705 |
! ! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6706 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6707 |
!DialogBox methodsFor:'accessing-look'! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6708 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6709 |
abortText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6710 |
"define the label in the abort-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6711 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6712 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6713 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6714 |
aString ~= abortButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6715 |
oldSize := abortButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6716 |
abortButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6717 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6718 |
abortButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6719 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6720 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6721 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6722 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6723 |
|
1702 | 6724 |
hideButtons |
6725 |
"hides the buttonPanel (i.e. the ok and cancel buttons if any)" |
|
6726 |
||
6727 |
buttonPanel notNil ifTrue:[buttonPanel beInvisible] |
|
6728 |
! |
|
6729 |
||
2361 | 6730 |
noLabel:aString |
6731 |
"define the label of the 'no'-button. |
|
6732 |
And alias for #noText: - for backward compatibility" |
|
6733 |
||
6734 |
self noText:aString. |
|
6735 |
||
6736 |
"Created: 13.12.1995 / 16:21:57 / cg" |
|
6737 |
"Modified: 16.1.1997 / 11:30:25 / cg" |
|
6738 |
! |
|
6739 |
||
6740 |
noText:aString |
|
6741 |
"define the label of the no-button. |
|
6742 |
If not set, it defaults to the resource-string for 'no'." |
|
6743 |
||
6744 |
aString ~= abortButton label ifTrue:[ |
|
6745 |
abortButton label:aString. |
|
6746 |
abortButton resize. |
|
6747 |
shown ifTrue:[self resize] |
|
6748 |
] |
|
6749 |
! |
|
6750 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6751 |
okText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6752 |
"define the text in the ok-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6753 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6754 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6755 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6756 |
aString ~= okButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6757 |
oldSize := okButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6758 |
okButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6759 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6760 |
okButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6761 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6762 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6763 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6764 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6765 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6766 |
okText:okString abortText:abortString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6767 |
"set both texts displayed in the buttons" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6768 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6769 |
(abortString ~= abortButton label |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6770 |
or:[okString ~= okButton label]) ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6771 |
okButton label:okString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6772 |
abortButton label:abortString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6773 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6774 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6775 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6776 |
] |
2361 | 6777 |
! |
6778 |
||
6779 |
okText:yesString noText:noString |
|
6780 |
"define the labels of both buttons. |
|
6781 |
Alias for yesText:noText: for backward compatibility." |
|
6782 |
||
6783 |
^ self yesText:yesString noText:noString |
|
6784 |
||
6785 |
"Modified: 16.1.1997 / 11:30:58 / cg" |
|
6786 |
! |
|
6787 |
||
4627 | 6788 |
title:aString |
6789 |
"define title" |
|
6790 |
||
6791 |
self label:aString. |
|
6792 |
||
6793 |
" |
|
6794 |
DialogBox new open |
|
6795 |
(DialogBox new title:'Foo') open |
|
6796 |
" |
|
6797 |
! |
|
6798 |
||
2361 | 6799 |
title:aString yesText:yesString noText:noString |
6800 |
"define title and button labels" |
|
6801 |
||
6802 |
self title:aString. |
|
6803 |
self yesText:yesString noText:noString |
|
6804 |
! |
|
6805 |
||
6806 |
yesLabel:aString |
|
6807 |
"define the label of the 'yes'-button. |
|
6808 |
An alias for #yesText: for backward compatibility." |
|
6809 |
||
6810 |
self yesText:aString. |
|
6811 |
||
6812 |
"Created: 13.12.1995 / 16:22:05 / cg" |
|
6813 |
"Modified: 16.1.1997 / 11:31:58 / cg" |
|
6814 |
! |
|
6815 |
||
6816 |
yesText:aString |
|
6817 |
"define the label of the 'yes'-button" |
|
6818 |
||
6819 |
self okText:aString |
|
6820 |
||
6821 |
"Modified: 16.1.1997 / 11:31:39 / cg" |
|
6822 |
! |
|
6823 |
||
6824 |
yesText:yesString noText:noString |
|
6825 |
"define the labels of both buttons" |
|
6826 |
||
6827 |
((yesString ~= okButton label) or:[noString ~= abortButton label]) ifTrue:[ |
|
6828 |
okButton label:yesString. |
|
6829 |
abortButton label:noString. |
|
6830 |
okButton resize. |
|
6831 |
abortButton resize. |
|
6832 |
shown ifTrue:[self resize] |
|
6833 |
] |
|
6834 |
||
6835 |
"Modified: 21.2.1996 / 00:58:38 / cg" |
|
197 | 6836 |
! ! |
6837 |
||
6838 |
!DialogBox methodsFor:'accessing-models'! |
|
76 | 6839 |
|
197 | 6840 |
accept |
6841 |
"return the valueHolder holding true when the box |
|
6842 |
is accepted, false if closed via the windowManager or |
|
6843 |
the cancel button. |
|
6844 |
This is confusing: this method was originally called #acceptValue, |
|
6845 |
but renamed for compatibility with ST-80. |
|
6846 |
This looks like a bad name to me, since in most other situations, #accept |
|
6847 |
is used to force an accept, not to return some valueHolder ...)." |
|
6848 |
||
6849 |
^ acceptValue |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6850 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6851 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6852 |
acceptChannel |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6853 |
"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
|
6854 |
is accepted" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6855 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6856 |
^ acceptValue |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6857 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6858 |
"Created: / 18.8.2000 / 21:44:24 / cg" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6859 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6860 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6861 |
acceptChannel:aValueHolder |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6862 |
"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
|
6863 |
is accepted" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6864 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6865 |
acceptValue := aValueHolder |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6866 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6867 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6868 |
aspectAt:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6869 |
"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
|
6870 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6871 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6872 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6873 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6874 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6875 |
bindings isNil ifTrue:[bindings := IdentityDictionary new]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6876 |
bindings at:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6877 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6878 |
"Created: 16.1.1997 / 11:38:46 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6879 |
"Modified: 16.1.1997 / 11:41:28 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6880 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6881 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6882 |
aspectFor:anAspectSymbol |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6883 |
"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
|
6884 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6885 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6886 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6887 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6888 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6889 |
"/ subclasses may redefine some aspects... |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6890 |
(self respondsTo:anAspectSymbol) ifTrue:[ |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6891 |
^ self perform:anAspectSymbol |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6892 |
]. |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6893 |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6894 |
bindings isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6895 |
^ bindings at:anAspectSymbol ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6896 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6897 |
"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
|
6898 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6899 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6900 |
cancel |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6901 |
^ BlockValue forLogicalNot:(acceptValue) |
76 | 6902 |
! ! |
6903 |
||
120 | 6904 |
!DialogBox methodsFor:'construction-adding'! |
6905 |
||
593 | 6906 |
addComponent:aComponent |
6907 |
"add any component with its preferred height and full width. |
|
6908 |
Returns the component." |
|
6909 |
||
6910 |
^ self addComponent:aComponent indent:nil tabable:false |
|
6911 |
||
6912 |
"Modified: 9.2.1996 / 22:22:41 / cg" |
|
6913 |
! |
|
6914 |
||
6915 |
addComponent:aComponent indent:indent |
|
6916 |
"add any component with its preferred height and full width. |
|
6917 |
The indent is temporarily changed to indent. |
|
6918 |
Returns the component." |
|
6919 |
||
6920 |
^ self addComponent:aComponent indent:indent tabable:false |
|
6921 |
||
6922 |
"Modified: 9.2.1996 / 22:22:44 / cg" |
|
6923 |
! |
|
6924 |
||
6925 |
addComponent:aComponent indent:indent tabable:tabable |
|
6926 |
"add any component with its preferred height and full width. |
|
6927 |
The indent is temporarily changed to indent. |
|
6928 |
Returns the component." |
|
6929 |
||
6930 |
|oldLeft oldRight result| |
|
6931 |
||
6932 |
oldLeft := leftIndent. |
|
6933 |
oldRight := rightIndent. |
|
6934 |
indent notNil ifTrue:[ |
|
1401 | 6935 |
leftIndent := rightIndent := indent. |
593 | 6936 |
]. |
6937 |
result := self addComponent:aComponent tabable:tabable tabbedComponent:aComponent. |
|
6938 |
leftIndent := oldLeft. |
|
6939 |
rightIndent := oldRight. |
|
6940 |
^ result |
|
6941 |
||
6942 |
"Modified: 9.2.1996 / 22:22:50 / cg" |
|
6943 |
! |
|
6944 |
||
6945 |
addComponent:aComponent indent:indent withExtent:ext |
|
6946 |
"add any component with some given extent. |
|
6947 |
Returns the component." |
|
6948 |
||
6949 |
|fullSize lI rI| |
|
6950 |
||
6951 |
indent isNil ifTrue:[ |
|
2801 | 6952 |
lI := leftIndent. |
6953 |
rI := rightIndent. |
|
593 | 6954 |
] ifFalse:[ |
2801 | 6955 |
lI := rI := indent |
593 | 6956 |
]. |
6957 |
||
6958 |
self basicAddComponent:aComponent. |
|
4155
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6959 |
(ext x isInteger) ifTrue:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6960 |
fullSize := ext + (lI + rI @ 0). |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6961 |
width := fullSize x max:width. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6962 |
] ifFalse:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6963 |
fullSize := ext. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6964 |
]. |
593 | 6965 |
aComponent extent:fullSize. |
2801 | 6966 |
aComponent origin:(0.0 @ yPosition); |
6967 |
leftInset:lI; |
|
6968 |
rightInset:rI. |
|
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6969 |
|
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6970 |
yPosition := aComponent corner y + ViewSpacing. |
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6971 |
"/ yPosition := yPosition + aComponent height + ViewSpacing. |
593 | 6972 |
needResize := true. |
6973 |
^ aComponent |
|
6974 |
||
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6975 |
"Modified: / 29-07-2011 / 12:28:47 / cg" |
593 | 6976 |
! |
6977 |
||
6978 |
addComponent:aComponent indent:indent withHeight:height |
|
6979 |
"add any component with some given height and full width. |
|
6980 |
Returns the component." |
|
6981 |
||
6982 |
|lI rI| |
|
6983 |
||
6984 |
indent isNil ifTrue:[ |
|
2801 | 6985 |
lI := leftIndent. |
6986 |
rI := rightIndent. |
|
593 | 6987 |
] ifFalse:[ |
2801 | 6988 |
lI := rI := indent |
593 | 6989 |
]. |
6990 |
self basicAddComponent:aComponent. |
|
3283 | 6991 |
aComponent |
4387
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
6992 |
height:height; |
3283 | 6993 |
origin:0.0@yPosition; |
4387
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
6994 |
width:1.0; |
3283 | 6995 |
leftInset:lI; |
6996 |
rightInset:rI. |
|
2801 | 6997 |
yPosition := yPosition + height + ViewSpacing. |
593 | 6998 |
^ aComponent |
6999 |
||
4387
91f02f4d71dd
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4384
diff
changeset
|
7000 |
"Modified: 9.2.1996 / 22:22:58 / cg" |
593 | 7001 |
! |
7002 |
||
7003 |
addComponent:aComponent tabable:tabable |
|
7004 |
"add any component with its preferred height and full width. |
|
7005 |
Returns the component." |
|
7006 |
||
7007 |
^ self addComponent:aComponent tabable:tabable tabbedComponent:aComponent |
|
7008 |
||
7009 |
"Modified: 9.2.1996 / 22:23:04 / cg" |
|
7010 |
! |
|
7011 |
||
7012 |
addComponent:aComponent tabable:tabable tabbedComponent:subComponent |
|
7013 |
"add any component with its preferred height and full width. |
|
7014 |
Returns the component." |
|
7015 |
||
7016 |
tabable ifTrue:[ |
|
3467 | 7017 |
aComponent canTab:true. |
7018 |
||
7019 |
"/ tabableElements isNil ifTrue:[ |
|
7020 |
"/ tabableElements := OrderedCollection new |
|
7021 |
"/ ]. |
|
7022 |
"/ tabableElements add:subComponent |
|
593 | 7023 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7024 |
^ self addComponent:aComponent withHeight:(aComponent preferredHeight). |
593 | 7025 |
|
7026 |
"Modified: 9.2.1996 / 22:23:07 / cg" |
|
7027 |
! |
|
7028 |
||
7029 |
addComponent:aComponent withExtent:ext |
|
7030 |
"add any component with some given extent. |
|
7031 |
Returns the component." |
|
7032 |
||
7033 |
^ self addComponent:aComponent indent:nil withExtent:ext |
|
7034 |
||
7035 |
"Modified: 9.2.1996 / 22:23:11 / cg" |
|
7036 |
! |
|
7037 |
||
7038 |
addComponent:aComponent withHeight:height |
|
7039 |
"add any component with some given height and full width. |
|
7040 |
Returns the component." |
|
7041 |
||
7042 |
^ self addComponent:aComponent indent:nil withHeight:height |
|
7043 |
||
7044 |
"Modified: 9.2.1996 / 22:23:15 / cg" |
|
7045 |
! |
|
7046 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7047 |
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
|
7048 |
"add a label and some view side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7049 |
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
|
7050 |
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
|
7051 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7052 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7053 |
|
795 | 7054 |
^ self |
1401 | 7055 |
addLabelledField:aView |
7056 |
label:labelString |
|
7057 |
adjust:labelAdjust |
|
7058 |
tabable:tabable |
|
7059 |
from:leftX to:rightX separateAtX:relativeX |
|
7060 |
nameAs:nil |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7061 |
|
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 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7064 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7065 |
model := '' asValue. |
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 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7068 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7069 |
field := dialog |
1401 | 7070 |
addLabelledField:(EditField on:model) label:'input here:' |
7071 |
adjust:#left |
|
7072 |
tabable:true |
|
7073 |
separateAtX:0.3. |
|
745
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 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7076 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7077 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7078 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7079 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7080 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7081 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7082 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7083 |
model := SelectionInList new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7084 |
model list:#('foo' 'bar' 'baz'). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7085 |
model selectionIndex:2. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7086 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7087 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7088 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7089 |
field := dialog |
1401 | 7090 |
addLabelledField:(PopUpList on:model) label:'select here:' |
7091 |
adjust:#left |
|
7092 |
tabable:true |
|
7093 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7094 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7095 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7096 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7097 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7098 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7099 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7100 |
"Created: 3.6.1996 / 11:03:24 / cg" |
795 | 7101 |
"Modified: 17.7.1996 / 15:04:07 / cg" |
7102 |
! |
|
7103 |
||
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7104 |
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
|
7105 |
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
|
7106 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7107 |
"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
|
7108 |
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
|
7109 |
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
|
7110 |
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
|
7111 |
Return the inputField." |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7112 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7113 |
^ self |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7114 |
addLabelledField:aView |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7115 |
label:labelString |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7116 |
adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7117 |
tabable:tabable |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7118 |
from:leftX to:rightX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7119 |
separateAtX:relativeX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7120 |
nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7121 |
foregroundColor:nil |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7122 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7123 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7124 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7125 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7126 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7127 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7128 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7129 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7130 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7131 |
addLabelledField:(EditField on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7132 |
label:'input here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7133 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7134 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7135 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7136 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7137 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7138 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7139 |
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
|
7140 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7141 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7142 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7143 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7144 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7145 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7146 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7147 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7148 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7149 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7150 |
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
|
7151 |
label:'select foo:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7152 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7153 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7154 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7155 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7156 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7157 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7158 |
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
|
7159 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7160 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7161 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7162 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7163 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7164 |
model := SelectionInList new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7165 |
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
|
7166 |
model selectionIndex:2. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7167 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7168 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7169 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7170 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7171 |
addLabelledField:(PopUpList on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7172 |
label:'select here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7173 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7174 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7175 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7176 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7177 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7178 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7179 |
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
|
7180 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7181 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7182 |
"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
|
7183 |
"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
|
7184 |
! |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7185 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7186 |
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
|
7187 |
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
|
7188 |
foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7189 |
|
795 | 7190 |
"add a label and some view side-by-side. |
7191 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
7192 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
7193 |
The inputField gets model as its model. |
|
7194 |
Return the inputField." |
|
7195 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7196 |
|y lbl max relW wLabel| |
795 | 7197 |
|
7198 |
y := self yPosition. |
|
7199 |
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
|
7200 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
7201 |
max := lbl preferredHeight max:(aView preferredHeight max:aView height). |
795 | 7202 |
|
7203 |
relW := rightX - leftX. |
|
7204 |
||
7205 |
self addComponent:lbl indent:leftIndent withHeight:max. |
|
7206 |
lbl rightInset:0. |
|
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7207 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7208 |
wLabel := relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7209 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7210 |
wLabel := relW*relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7211 |
]. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7212 |
|
795 | 7213 |
lbl |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7214 |
width:wLabel; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7215 |
left:leftX; |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7216 |
adjust:labelAdjust; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7217 |
borderWidth:0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7218 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7219 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7220 |
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
|
7221 |
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
|
7222 |
lbl sizeFixed:true. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7223 |
]. |
795 | 7224 |
|
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7225 |
fgColor notNil ifTrue:[ |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7226 |
lbl foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7227 |
]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
7228 |
|
795 | 7229 |
self yPosition:y. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
7230 |
|
4217
9453a5aa3fcf
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4216
diff
changeset
|
7231 |
"/ 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
|
7232 |
"/ aView height:max. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
7233 |
|
795 | 7234 |
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
|
7235 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7236 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7237 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7238 |
leftInset:(ViewSpacing + relativeX); |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7239 |
left:0.0; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7240 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7241 |
right:1.0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7242 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7243 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7244 |
leftInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7245 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7246 |
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
|
7247 |
left:leftX+(relW*relativeX). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7248 |
]. |
4218
7b0e5dd511e9
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4217
diff
changeset
|
7249 |
|
4219
c83b708345f7
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4218
diff
changeset
|
7250 |
"/ 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
|
7251 |
aView setHeight:max. |
795 | 7252 |
|
7253 |
aView isInputField ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7254 |
self addToInputFieldGroup:aView |
795 | 7255 |
]. |
7256 |
||
7257 |
aName notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7258 |
self name:lbl as:(aName , '.label'). |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7259 |
self name:aView as:aName |
795 | 7260 |
]. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
7261 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
7262 |
^ aView |
795 | 7263 |
|
7264 |
" |
|
7265 |
|dialog model field| |
|
7266 |
||
7267 |
model := '' asValue. |
|
7268 |
||
7269 |
dialog := DialogBox new. |
|
7270 |
||
7271 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7272 |
addLabelledField:(EditField on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7273 |
label:'input here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7274 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7275 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7276 |
separateAtX:0.3. |
807 | 7277 |
|
7278 |
dialog addAbortButton; addOkButton. |
|
7279 |
dialog open. |
|
7280 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
7281 |
" |
|
7282 |
||
7283 |
" |
|
7284 |
|dialog model field| |
|
7285 |
||
7286 |
model := '' asValue. |
|
7287 |
||
7288 |
dialog := DialogBox new. |
|
7289 |
||
7290 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7291 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7292 |
label:'select foo:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7293 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7294 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7295 |
separateAtX:0.3. |
795 | 7296 |
|
7297 |
dialog addAbortButton; addOkButton. |
|
7298 |
dialog open. |
|
7299 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
7300 |
" |
|
7301 |
||
7302 |
" |
|
7303 |
|dialog model field| |
|
7304 |
||
7305 |
model := SelectionInList new. |
|
7306 |
model list:#('foo' 'bar' 'baz'). |
|
7307 |
model selectionIndex:2. |
|
7308 |
||
7309 |
dialog := DialogBox new. |
|
7310 |
||
7311 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7312 |
addLabelledField:(PopUpList on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7313 |
label:'select here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7314 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7315 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
7316 |
separateAtX:0.3. |
795 | 7317 |
|
7318 |
dialog addAbortButton; addOkButton. |
|
7319 |
dialog open. |
|
7320 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
7321 |
" |
|
7322 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
7323 |
"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
|
7324 |
"Modified: / 02-02-2011 / 12:17:55 / cg" |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7325 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7326 |
|
593 | 7327 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX |
7328 |
"add a label and some view side-by-side. |
|
7329 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
7330 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
7331 |
The inputField gets model as its model. |
|
7332 |
Return the inputField." |
|
7333 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7334 |
^ self |
1401 | 7335 |
addLabelledField:aView |
7336 |
label:labelString |
|
7337 |
adjust:labelAdjust |
|
7338 |
tabable:tabable |
|
7339 |
from:0.0 to:1.0 |
|
7340 |
separateAtX:relativeX |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7341 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7342 |
"/ |y lbl max| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7343 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7344 |
"/ y := self yPosition. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7345 |
"/ lbl := Label label:labelString. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7346 |
"/ max := lbl preferredExtent y max:(aView preferredExtent y). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7347 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7348 |
"/ self addComponent:lbl indent:leftIndent withHeight:max. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7349 |
"/ lbl rightInset:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7350 |
"/ lbl width:relativeX; adjust:labelAdjust; borderWidth:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7351 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7352 |
"/ self yPosition:y. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7353 |
"/ self addComponent:aView tabable:tabable. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7354 |
"/ aView leftInset:ViewSpacing; rightInset:ViewSpacing. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7355 |
"/ aView width:(1.0 - relativeX); left:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7356 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7357 |
"/ aView isInputField ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7358 |
"/ self addToInputFieldGroup:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7359 |
"/ ]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7360 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7361 |
"/ ^ aView |
593 | 7362 |
|
7363 |
" |
|
7364 |
|dialog model field| |
|
7365 |
||
7366 |
model := '' asValue. |
|
7367 |
||
7368 |
dialog := DialogBox new. |
|
7369 |
||
7370 |
field := dialog |
|
1401 | 7371 |
addLabelledField:(EditField on:model) label:'input here:' |
7372 |
adjust:#left |
|
7373 |
tabable:true |
|
7374 |
separateAtX:0.3. |
|
593 | 7375 |
|
7376 |
dialog addAbortButton; addOkButton. |
|
7377 |
dialog open. |
|
655 | 7378 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7379 |
" |
7380 |
||
7381 |
" |
|
7382 |
|dialog model field| |
|
7383 |
||
7384 |
model := SelectionInList new. |
|
7385 |
model list:#('foo' 'bar' 'baz'). |
|
7386 |
model selectionIndex:2. |
|
7387 |
||
7388 |
dialog := DialogBox new. |
|
7389 |
||
7390 |
field := dialog |
|
1401 | 7391 |
addLabelledField:(PopUpList on:model) label:'select here:' |
7392 |
adjust:#left |
|
7393 |
tabable:true |
|
7394 |
separateAtX:0.3. |
|
593 | 7395 |
|
7396 |
dialog addAbortButton; addOkButton. |
|
7397 |
dialog open. |
|
655 | 7398 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7399 |
" |
7400 |
||
7401 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7402 |
"Modified: 3.6.1996 / 18:48:49 / cg" |
593 | 7403 |
! |
7404 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7405 |
addMessage:labelString centered:centered |
4653 | 7406 |
|l| |
7407 |
||
7408 |
l := self addTextLabel:labelString. |
|
7409 |
l adjust:(centered ifTrue:[#center] ifFalse:[#left]). |
|
7410 |
^ l |
|
2116 | 7411 |
|
7412 |
"Created: / 4.2.2000 / 00:03:24 / cg" |
|
7413 |
! |
|
7414 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7415 |
addMessage:labelString textLine:valueHolder boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7416 |
^ self |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7417 |
addMessage:labelString |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7418 |
textLine:valueHolder |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7419 |
type:nil |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7420 |
boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7421 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7422 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7423 |
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
|
7424 |
|pos lbl field| |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7425 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7426 |
pos := self yPosition. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7427 |
lbl := self addTextLabel:labelString. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7428 |
lbl width:fraction. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7429 |
self yPosition:pos. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7430 |
field := self addInputFieldOn:valueHolder tabable:true. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7431 |
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
|
7432 |
typeSymbolOrNil == #password ifTrue:[ |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7433 |
field bePassword |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7434 |
]. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7435 |
^ field |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7436 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7437 |
|
593 | 7438 |
addTextLabel:aString |
7439 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
7440 |
however, ST/X labels allow image labels too. |
|
7441 |
Returns the label." |
|
7442 |
||
7443 |
|l| |
|
7444 |
||
7445 |
l := Label new label:aString. |
|
7446 |
l borderWidth:0. |
|
7447 |
self addComponent:l. |
|
7448 |
^ l |
|
7449 |
||
7450 |
" |
|
7451 |
|b| |
|
7452 |
||
7453 |
b := DialogBox new. |
|
7454 |
b addTextLabel:'hello'. |
|
7455 |
b showAtPointer |
|
7456 |
" |
|
7457 |
" |
|
7458 |
|b| |
|
7459 |
||
7460 |
b := DialogBox new. |
|
7461 |
b leftIndent:100. |
|
7462 |
b addTextLabel:'hello'. |
|
7463 |
b leftIndent:0. |
|
7464 |
b addTextLabel:'world'. |
|
7465 |
b showAtPointer |
|
7466 |
" |
|
7467 |
" |
|
7468 |
|b| |
|
7469 |
||
7470 |
b := DialogBox new. |
|
7471 |
b addTextLabel:'hello'. |
|
7472 |
b addTextLabel:'world'. |
|
7473 |
b addOkButton. |
|
7474 |
b showAtPointer |
|
7475 |
" |
|
7476 |
" |
|
7477 |
|b| |
|
7478 |
||
7479 |
b := DialogBox new. |
|
7480 |
b addTextLabel:'hello'. |
|
7481 |
(b addTextLabel:'world') foregroundColor:Color red. |
|
7482 |
b addOkButton. |
|
7483 |
b showAtPointer |
|
7484 |
" |
|
7485 |
" |
|
7486 |
|b| |
|
7487 |
||
7488 |
b := DialogBox new. |
|
7489 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7490 |
b addOkButton. |
|
7491 |
b showAtPointer |
|
7492 |
" |
|
7493 |
" |
|
7494 |
|b| |
|
7495 |
||
7496 |
b := DialogBox new. |
|
7497 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7498 |
b addTextLabel:'not bad'. |
|
7499 |
b addAbortButton. |
|
7500 |
b addOkButton. |
|
7501 |
b showAtPointer |
|
7502 |
" |
|
7503 |
! |
|
7504 |
||
4839 | 7505 |
addTextLabel:aString adjust:how |
7506 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
7507 |
however, ST/X labels allow image labels too. |
|
7508 |
Returns the label." |
|
7509 |
||
7510 |
|l| |
|
7511 |
||
7512 |
l := self addTextLabel:aString. |
|
7513 |
l adjust:how. |
|
7514 |
^ l |
|
7515 |
||
7516 |
" |
|
7517 |
|b| |
|
7518 |
||
7519 |
b := DialogBox new. |
|
7520 |
b addTextLabel:'hello' adjust:#left. |
|
7521 |
b showAtPointer |
|
7522 |
" |
|
7523 |
" |
|
7524 |
|b| |
|
7525 |
||
7526 |
b := DialogBox new. |
|
7527 |
b addTextLabel:'hello' adjust:#right. |
|
7528 |
b showAtPointer |
|
7529 |
" |
|
7530 |
! |
|
7531 |
||
3908 | 7532 |
addTextLabelOn:aValueHolder |
7533 |
"create a text label showing the contents of a valueHolder. |
|
7534 |
Returns the label." |
|
7535 |
||
7536 |
|l| |
|
7537 |
||
7538 |
l := Label new labelChannel:aValueHolder. |
|
7539 |
l borderWidth:0. |
|
7540 |
self addComponent:l. |
|
7541 |
^ l |
|
7542 |
||
7543 |
" |
|
7544 |
|b| |
|
7545 |
||
7546 |
b := DialogBox new. |
|
7547 |
b addTextLabelOn:'hello' asValue. |
|
7548 |
b showAtPointer |
|
7549 |
" |
|
7550 |
" |
|
7551 |
|b| |
|
7552 |
||
7553 |
b := DialogBox new. |
|
7554 |
b leftIndent:100. |
|
7555 |
b addTextLabelOn:'hello' asValue. |
|
7556 |
b leftIndent:0. |
|
7557 |
b addTextLabelOn:'world' asValue. |
|
7558 |
b showAtPointer |
|
7559 |
" |
|
7560 |
! |
|
7561 |
||
593 | 7562 |
addToInputFieldGroup:aComponentOrSubcomponent |
7563 |
"add a component to the input group. |
|
7564 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7565 |
a topLevel component." |
|
7566 |
||
1355 | 7567 |
self |
1401 | 7568 |
addToInputFieldGroup:aComponentOrSubcomponent before:nil |
1355 | 7569 |
|
7570 |
"Modified: 18.10.1997 / 03:09:17 / cg" |
|
7571 |
! |
|
7572 |
||
7573 |
addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
|
7574 |
"add a component to the input group. |
|
7575 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7576 |
a topLevel component." |
|
7577 |
||
593 | 7578 |
inputFieldGroup isNil ifTrue:[ |
1759 | 7579 |
inputFieldGroup := EnterFieldGroup new. |
7580 |
inputFieldGroup leaveAction:[self lastFieldLeft]. |
|
7581 |
"/ |
|
7582 |
"/ the first inputField gets the focus initially |
|
7583 |
"/ |
|
7584 |
aComponentOrSubcomponent hasKeyboardFocus:true. |
|
593 | 7585 |
]. |
1355 | 7586 |
inputFieldGroup add:aComponentOrSubcomponent before:anotherComponent. |
593 | 7587 |
self delegate:(KeyboardForwarder to:inputFieldGroup condition:#noFocus). |
7588 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7589 |
"/ inputFields isNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7590 |
"/ inputFields := OrderedCollection new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7591 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7592 |
"/ "/ 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
|
7593 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7594 |
"/ aComponentOrSubcomponent showCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7595 |
"/ aComponentOrSubcomponent hasKeyboardFocus:true. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7596 |
"/ ] ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7597 |
"/ aComponentOrSubcomponent hideCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7598 |
"/ aComponentOrSubcomponent hasKeyboardFocus:false. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7599 |
"/ ]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7600 |
"/ inputFields add:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7601 |
|
1355 | 7602 |
"Modified: 18.10.1997 / 02:47:20 / cg" |
7603 |
"Created: 18.10.1997 / 03:08:51 / cg" |
|
7604 |
! |
|
7605 |
||
7606 |
removeFromInputFieldGroup:aComponentOrSubcomponent |
|
7607 |
"remove a component from the input group. |
|
7608 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7609 |
a topLevel component." |
|
7610 |
||
7611 |
inputFieldGroup isNil ifTrue:[^ self]. |
|
7612 |
inputFieldGroup remove:aComponentOrSubcomponent. |
|
7613 |
||
7614 |
"Created: 18.10.1997 / 02:51:30 / cg" |
|
593 | 7615 |
! ! |
7616 |
||
7617 |
!DialogBox methodsFor:'construction-buttons'! |
|
7618 |
||
1763 | 7619 |
addAbortAndOkButtons |
7620 |
"create both abort- and Ok Buttons" |
|
7621 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7622 |
self |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7623 |
addAbortButtonLabelled:nil; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7624 |
addOkButtonLabelled:nil |
1763 | 7625 |
! |
7626 |
||
197 | 7627 |
addAbortButton |
7628 |
"create an abortButton - to be sent from redefined initialize |
|
162 | 7629 |
methods in subclasses or when creating a box programmatically. |
7630 |
Returns the button." |
|
7631 |
||
197 | 7632 |
^ self addAbortButtonLabelled:nil |
122 | 7633 |
! |
120 | 7634 |
|
162 | 7635 |
addAbortButton:aButton |
7636 |
"add an already created abortButton - to be sent from redefined initialize |
|
7637 |
methods in subclasses or when creating a box programmatically. |
|
7638 |
Returns the button." |
|
7639 |
||
7640 |
abortButton := aButton. |
|
7641 |
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
|
7642 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7643 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7644 |
"/ 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
|
7645 |
|
2698 | 7646 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7647 |
"/ 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
|
7648 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7649 |
"/ 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
|
7650 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7651 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7652 |
self addButton:aButton before:nil. |
1763 | 7653 |
^ aButton. |
162 | 7654 |
|
7655 |
"Created: 17.9.1995 / 20:17:26 / claus" |
|
7656 |
! |
|
7657 |
||
122 | 7658 |
addAbortButtonLabelled:buttonLabel |
7659 |
"create an abortButton with a label - to be sent from redefined initialize |
|
7660 |
methods in subclasses or when creating a box programmatically. |
|
7661 |
A nil argument creates one with the default label. |
|
7662 |
Returns the button." |
|
7663 |
||
162 | 7664 |
|aButton| |
7665 |
||
7666 |
aButton := Button abortButton. |
|
7667 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7668 |
^ self addAbortButton:aButton |
|
7669 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7670 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7671 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7672 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7673 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7674 |
dialog addAbortButtonLabelled:'get out of here'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7675 |
dialog addOkButtonLabelled:'yes thats ok'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7676 |
dialog open. |
655 | 7677 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7678 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7679 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7680 |
"Modified: 9.2.1996 / 22:09:40 / cg" |
120 | 7681 |
! |
76 | 7682 |
|
197 | 7683 |
addButton:aButton |
7684 |
"add a button into the buttonPanel. |
|
122 | 7685 |
Returns the button." |
120 | 7686 |
|
3050 | 7687 |
"/ ^ self addButton:aButton after:nil |
7688 |
(self class defaultOKButtonAtLeft) ifFalse:[ |
|
7689 |
^ self addButton:aButton before:nil |
|
7690 |
] ifTrue:[ |
|
7691 |
^ self addButton:aButton after:nil |
|
7692 |
]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7693 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7694 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7695 |
|dialog| |
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 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7698 |
dialog addAbortButton. |
655 | 7699 |
dialog addButton:(Button label:'foo' action:[Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7700 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7701 |
dialog open. |
655 | 7702 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7703 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7704 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7705 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7706 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7707 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7708 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7709 |
dialog addAbortButton. |
655 | 7710 |
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
|
7711 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7712 |
dialog open. |
655 | 7713 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7714 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7715 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7716 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7717 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7718 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7719 |
dialog := DialogBox new. |
655 | 7720 |
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
|
7721 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7722 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7723 |
dialog open. |
655 | 7724 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7725 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7726 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7727 |
"Modified: 9.2.1996 / 22:14:17 / cg" |
197 | 7728 |
! |
7729 |
||
7730 |
addButton:aButton after:someOtherButtonOrNil |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7731 |
"add a button into the buttonPanel. |
197 | 7732 |
If the argument someOtherButtonOrNil is nil, the button is |
7733 |
added at the end." |
|
7734 |
||
7735 |
|h| |
|
7736 |
||
7737 |
buttonPanel addSubView:aButton after:someOtherButtonOrNil. |
|
7738 |
buttonPanel subViews size > 1 ifTrue:[ |
|
1843 | 7739 |
buttonPanel horizontalLayout:#fitSpace. |
197 | 7740 |
]. |
7741 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
|
1843 | 7742 |
buttonPanel topInset:h negated |
197 | 7743 |
]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7744 |
needResize := true. |
197 | 7745 |
^ aButton |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7746 |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7747 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7748 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7749 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7750 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7751 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7752 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7753 |
dialog addButton:(Button |
1843 | 7754 |
label:'foo' |
7755 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7756 |
after:(dialog okButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7757 |
dialog open. |
655 | 7758 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7759 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7760 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7761 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7762 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7763 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7764 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7765 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7766 |
dialog addButton:(Button |
1843 | 7767 |
label:'foo' |
7768 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7769 |
after:(dialog abortButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7770 |
dialog open. |
655 | 7771 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7772 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7773 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7774 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7775 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7776 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7777 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7778 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7779 |
dialog addButton:(Button |
1843 | 7780 |
label:'foo' |
7781 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7782 |
after:nil. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7783 |
dialog open. |
655 | 7784 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7785 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7786 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7787 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
197 | 7788 |
! |
7789 |
||
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7790 |
addButton:aButton before:someOtherButtonOrNil |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7791 |
"add a button into the buttonPanel. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7792 |
If the argument someOtherButtonOrNil is nil, the button is |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7793 |
added upFront." |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7794 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7795 |
|h| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7796 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7797 |
buttonPanel addSubView:aButton before:someOtherButtonOrNil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7798 |
buttonPanel subViews size > 1 ifTrue:[ |
1843 | 7799 |
buttonPanel horizontalLayout:#fitSpace. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7800 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7801 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
1843 | 7802 |
buttonPanel topInset:h negated |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7803 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7804 |
preferredExtent := nil. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7805 |
needResize := true. |
4640 | 7806 |
shown ifTrue:[ aButton realize ]. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7807 |
^ aButton |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7808 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7809 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7810 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7811 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7812 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7813 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7814 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7815 |
dialog addButton:(Button |
1843 | 7816 |
label:'foo' |
7817 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7818 |
before:(dialog okButton). |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7819 |
dialog open. |
655 | 7820 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7821 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7822 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7823 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7824 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7825 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7826 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7827 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7828 |
dialog addButton:(Button |
1843 | 7829 |
label:'foo' |
7830 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7831 |
before:nil. |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7832 |
dialog open. |
655 | 7833 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7834 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7835 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7836 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7837 |
"Created: 10.2.1996 / 16:04:35 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7838 |
! |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7839 |
|
593 | 7840 |
addHelpButtonFor:pathToHelpText |
7841 |
"add a help button to the buttonPanel. |
|
7842 |
The argument, pathToHelpText should specify the path to the help |
|
7843 |
text under either the doc/online/<language> or the help/<language> |
|
7844 |
directory." |
|
7845 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7846 |
^ self addHelpButtonWithAction:[HTMLDocumentView openFullOnHelpFile:pathToHelpText]. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7847 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7848 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7849 |
|box| |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7850 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7851 |
box := DialogBox new. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7852 |
box |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7853 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7854 |
addAbortButton; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7855 |
addOkButton. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7856 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7857 |
box open |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7858 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7859 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7860 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7861 |
"Modified: / 26-01-2011 / 18:04:53 / cg" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7862 |
! |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7863 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7864 |
addHelpButtonWithAction:helpAction |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7865 |
"add a help button to the buttonPanel. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7866 |
The argument, helpAction is avaluated when clicked" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7867 |
|
593 | 7868 |
|helpButton| |
7869 |
||
2478 | 7870 |
helpButton := Button label:(resources string:'Help'). |
593 | 7871 |
helpButton action:[ |
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7872 |
self withWaitCursorDo:helpAction |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7873 |
]. |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7874 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7875 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7876 |
"/ 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
|
7877 |
|
2698 | 7878 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7879 |
"/ 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
|
7880 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7881 |
"/ 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
|
7882 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7883 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7884 |
self addButton:helpButton before:nil. |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7885 |
^ helpButton |
593 | 7886 |
|
7887 |
" |
|
7888 |
|box| |
|
7889 |
||
7890 |
box := DialogBox new. |
|
7891 |
box |
|
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7892 |
addHelpButtonWithAction:[ Transcript flash ]; |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7893 |
addAbortButton; |
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7894 |
addOkButton. |
593 | 7895 |
|
7896 |
box open |
|
7897 |
" |
|
7898 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7899 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7900 |
"Created: / 26-01-2011 / 18:04:16 / cg" |
593 | 7901 |
! |
7902 |
||
2116 | 7903 |
addOK:checkBlock |
7904 |
|butt| |
|
7905 |
||
7906 |
butt := self addOkButton. |
|
7907 |
"/ what is checkBlock ? |
|
7908 |
^ butt |
|
7909 |
||
7910 |
"Modified: / 4.2.2000 / 00:09:15 / cg" |
|
7911 |
! |
|
7912 |
||
593 | 7913 |
addOkButton |
7914 |
"create an okButton - to be sent from redefined initialize |
|
7915 |
methods in subclasses or when creating a box programmatically. |
|
7916 |
Returns the button." |
|
7917 |
||
7918 |
^ self addOkButtonLabelled:nil |
|
7919 |
||
7920 |
" |
|
7921 |
|dialog| |
|
7922 |
||
7923 |
dialog := DialogBox new. |
|
7924 |
dialog addOkButton. |
|
7925 |
dialog open. |
|
655 | 7926 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7927 |
" |
7928 |
||
7929 |
"Modified: 9.2.1996 / 21:37:02 / cg" |
|
7930 |
! |
|
7931 |
||
7932 |
addOkButton:aButton |
|
7933 |
"add an already created okButton - to be sent from redefined initialize |
|
7934 |
methods in subclasses or when creating a box programmatically. |
|
7935 |
Returns the button." |
|
7936 |
||
1764 | 7937 |
"/ okButton isNil ifTrue:[ |
7938 |
okButton := aButton. |
|
7939 |
"/ ]. |
|
593 | 7940 |
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
|
7941 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7942 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7943 |
"/ 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
|
7944 |
|
2698 | 7945 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7946 |
"/ 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
|
7947 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7948 |
"/ 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
|
7949 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7950 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7951 |
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
|
7952 |
|
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7953 |
^ aButton. |
593 | 7954 |
|
7955 |
" |
|
7956 |
|dialog b| |
|
7957 |
||
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
7958 |
b := Button label:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedBy:0.5). |
593 | 7959 |
|
7960 |
dialog := DialogBox new. |
|
7961 |
dialog addOkButton:b. |
|
7962 |
dialog open. |
|
655 | 7963 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7964 |
" |
7965 |
||
7966 |
"Modified: 17.9.1995 / 20:20:41 / claus" |
|
7967 |
"Modified: 9.2.1996 / 21:38:48 / cg" |
|
7968 |
! |
|
7969 |
||
7970 |
addOkButtonLabelled:buttonLabel |
|
7971 |
"create an okButton with a label - to be sent from redefined initialize |
|
7972 |
methods in subclasses or when creating a box programmatically. |
|
7973 |
A nil argument creates one with the default text. |
|
7974 |
Returns the button." |
|
7975 |
||
7976 |
|aButton| |
|
7977 |
||
7978 |
aButton := Button okButton. |
|
7979 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7980 |
aButton isReturnButton:acceptReturnAsOK. |
|
7981 |
^ self addOkButton:aButton. |
|
7982 |
||
7983 |
" |
|
7984 |
|dialog| |
|
7985 |
||
7986 |
dialog := DialogBox new. |
|
7987 |
dialog addOkButtonLabelled:'get out of here'. |
|
7988 |
dialog open. |
|
655 | 7989 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7990 |
" |
7991 |
||
7992 |
"Modified: 9.2.1996 / 21:39:34 / cg" |
|
5011 | 7993 |
! |
7994 |
||
7995 |
removeAbortButton |
|
7996 |
"remove an already added okButton - only useful to change some already created |
|
7997 |
dialog afterwards" |
|
7998 |
||
7999 |
abortButton destroy |
|
8000 |
! |
|
8001 |
||
8002 |
removeOkButton |
|
8003 |
"remove an already added okButton - only useful to change some already created |
|
8004 |
dialog afterwards" |
|
8005 |
||
8006 |
okButton destroy |
|
593 | 8007 |
! ! |
8008 |
||
8009 |
!DialogBox methodsFor:'construction-check & comboboxes'! |
|
8010 |
||
197 | 8011 |
addCheckBox:label on:aModel |
8012 |
"create a checkBox with label on aModel and add it. |
|
8013 |
Returns the box." |
|
8014 |
||
8015 |
^ self addCheckBox:label on:aModel tabable:true |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8016 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8017 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8018 |
|dialog check| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8019 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8020 |
check := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8021 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8022 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8023 |
dialog addCheckBox:'on or off' on:check. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8024 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8025 |
dialog open. |
655 | 8026 |
dialog accepted ifTrue:[Transcript showCR:check value]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8027 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8028 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8029 |
"Modified: 9.2.1996 / 22:15:38 / cg" |
197 | 8030 |
! |
8031 |
||
600 | 8032 |
addCheckBox:label on:aModel tabable:tabable |
8033 |
"create a checkBox with label on aModel and add it. |
|
8034 |
Returns the box." |
|
8035 |
||
8036 |
|b| |
|
8037 |
||
8038 |
b := CheckBox on:aModel. |
|
8039 |
b label:label. |
|
8040 |
self addComponent:b tabable:tabable. |
|
8041 |
^ b |
|
8042 |
||
8043 |
" |
|
8044 |
|dialog check1 check2 check3| |
|
8045 |
||
8046 |
check1 := true asValue. |
|
8047 |
check2 := false asValue. |
|
8048 |
check3 := true asValue. |
|
8049 |
||
8050 |
dialog := DialogBox new. |
|
8051 |
dialog addCheckBox:'on or off' on:check1 tabable:false. |
|
8052 |
dialog addHorizontalLine. |
|
8053 |
||
8054 |
dialog addCheckBox:'on or off' on:check2 tabable:true. |
|
8055 |
dialog addCheckBox:'on or off' on:check3 tabable:true. |
|
8056 |
dialog addOkButton. |
|
8057 |
dialog open. |
|
8058 |
" |
|
8059 |
||
8060 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
8061 |
! |
|
8062 |
||
4380
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8063 |
addCheckBoxAtBottom:checkLabel on:aValueHolder |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8064 |
"add a checkbox and make it stick at the bottom" |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8065 |
|
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8066 |
|box| |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8067 |
|
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8068 |
box := here addCheckBox:checkLabel on:aValueHolder. |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8069 |
|
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8070 |
box layout:((0.0 @ 1.0 corner:1.0 @ 1.0) asLayout |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8071 |
topOffset:(buttonPanel preferredHeight |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8072 |
+ box preferredHeight |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8073 |
+ ViewSpacing ) negated; |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8074 |
bottomOffset:(buttonPanel preferredHeight |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8075 |
+ ViewSpacing ) negated). |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8076 |
^ box. |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8077 |
|
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8078 |
"Created: / 28-02-2012 / 09:03:22 / cg" |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8079 |
! |
d06865ef4fc9
added: #addCheckBoxAtBottom:on:
Claus Gittinger <cg@exept.de>
parents:
4357
diff
changeset
|
8080 |
|
593 | 8081 |
addComboBoxOn:aModel |
8082 |
"create a comboBoxView on aModel and add it. |
|
8083 |
Returns the comboBoxView." |
|
8084 |
||
8085 |
^ self addComboBoxOn:aModel tabable:true |
|
8086 |
||
8087 |
" |
|
8088 |
without a list, the comboBox is disabled: |
|
8089 |
||
8090 |
|box val| |
|
8091 |
||
8092 |
val := 'some input' asValue. |
|
8093 |
||
8094 |
box := Dialog new. |
|
8095 |
||
8096 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8097 |
box addVerticalSpace. |
|
8098 |
(box addComboBoxOn:val). |
|
8099 |
box addOkButton. |
|
8100 |
box open. |
|
8101 |
box accepted ifTrue:[ |
|
1401 | 8102 |
Transcript showCR:val value |
593 | 8103 |
]. |
8104 |
" |
|
8105 |
||
8106 |
"with a list, it can be pulled: |
|
8107 |
||
8108 |
|box val| |
|
8109 |
||
8110 |
val := '' asValue. |
|
8111 |
||
8112 |
box := Dialog new. |
|
8113 |
||
8114 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8115 |
box addVerticalSpace. |
|
8116 |
(box addComboBoxOn:val) list:#('one' 'two' 'three' 'four'). |
|
8117 |
box addOkButton. |
|
8118 |
box open. |
|
8119 |
box accepted ifTrue:[ |
|
1401 | 8120 |
Transcript showCR:val value |
593 | 8121 |
]. |
8122 |
" |
|
8123 |
||
8124 |
"Modified: 28.2.1996 / 15:17:39 / cg" |
|
8125 |
"Created: 4.3.1996 / 17:21:45 / cg" |
|
8126 |
! |
|
8127 |
||
8128 |
addComboBoxOn:aModel tabable:tabable |
|
8129 |
"create a comboBoxView on aModel and add it. |
|
8130 |
Returns the comboBoxView." |
|
8131 |
||
8132 |
|f| |
|
8133 |
||
8134 |
f := ComboBoxView new. |
|
8135 |
f model:aModel. |
|
8136 |
self addComponent:f tabable:tabable. |
|
8137 |
tabable ifTrue:[ |
|
1401 | 8138 |
self addToInputFieldGroup:f editor. |
593 | 8139 |
]. |
8140 |
^ f |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8141 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8142 |
" |
593 | 8143 |
without a list, the comboBox is disabled: |
8144 |
||
8145 |
|box val| |
|
8146 |
||
8147 |
val := 'some input' asValue. |
|
8148 |
||
8149 |
box := Dialog new. |
|
8150 |
||
8151 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8152 |
box addVerticalSpace. |
|
8153 |
(box addComboBoxOn:val tabable:true). |
|
8154 |
box addOkButton. |
|
8155 |
box open. |
|
8156 |
box accepted ifTrue:[ |
|
1401 | 8157 |
Transcript showCR:val value |
593 | 8158 |
]. |
8159 |
" |
|
8160 |
||
8161 |
"with a list, it can be pulled: |
|
8162 |
||
8163 |
|box val| |
|
8164 |
||
8165 |
val := '' asValue. |
|
8166 |
||
8167 |
box := Dialog new. |
|
8168 |
||
8169 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8170 |
box addVerticalSpace. |
|
8171 |
(box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
8172 |
box addOkButton. |
|
8173 |
box open. |
|
8174 |
box accepted ifTrue:[ |
|
1401 | 8175 |
Transcript showCR:val value |
593 | 8176 |
]. |
8177 |
" |
|
8178 |
||
8179 |
"Modified: 4.3.1996 / 17:21:57 / cg" |
|
8180 |
! |
|
8181 |
||
8182 |
addComboListOn:aModel |
|
8183 |
"create a comboListView on aModel and add it. |
|
8184 |
Returns the comboListView." |
|
8185 |
||
8186 |
^ self addComboListOn:aModel tabable:true |
|
8187 |
||
8188 |
"without a list, the comboList is disabled: |
|
8189 |
||
8190 |
|box val| |
|
8191 |
||
8192 |
val := 'some input' asValue. |
|
8193 |
||
8194 |
box := Dialog new. |
|
8195 |
||
8196 |
(box addTextLabel:'combo list example') adjust:#left. |
|
8197 |
box addVerticalSpace. |
|
8198 |
(box addComboListOn:val). |
|
8199 |
box addOkButton. |
|
8200 |
box open. |
|
8201 |
box accepted ifTrue:[ |
|
1401 | 8202 |
Transcript showCR:val value |
593 | 8203 |
]. |
8204 |
" |
|
8205 |
||
8206 |
"with a list, it can be pulled: |
|
8207 |
||
8208 |
|box val| |
|
8209 |
||
8210 |
val := '' asValue. |
|
8211 |
||
8212 |
box := Dialog new. |
|
8213 |
||
8214 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8215 |
box addVerticalSpace. |
|
8216 |
(box addComboListOn:val) list:#('one' 'two' 'three' 'four'). |
|
8217 |
box addOkButton. |
|
8218 |
box open. |
|
8219 |
box accepted ifTrue:[ |
|
1401 | 8220 |
Transcript showCR:val value |
593 | 8221 |
]. |
8222 |
" |
|
8223 |
||
8224 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
8225 |
"Modified: 4.3.1996 / 17:22:59 / cg" |
|
8226 |
! |
|
8227 |
||
4653 | 8228 |
addComboListOn:aModel list:list tabable:tabable |
8229 |
"create a comboListView on aModel and add it. |
|
8230 |
Returns the comboListView." |
|
8231 |
||
8232 |
^ (self addComboListOn:aModel tabable:tabable) list:list |
|
8233 |
||
8234 |
" |
|
8235 |
|box val| |
|
8236 |
||
8237 |
val := '' asValue. |
|
8238 |
||
8239 |
box := Dialog new. |
|
8240 |
||
8241 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8242 |
box addVerticalSpace. |
|
8243 |
(box addComboListOn:val list:#('one' 'two' 'three' 'four') tabable:true). |
|
8244 |
box addOkButton. |
|
8245 |
box open. |
|
8246 |
box accepted ifTrue:[ |
|
8247 |
Transcript showCR:val value |
|
8248 |
]. |
|
8249 |
" |
|
8250 |
! |
|
8251 |
||
593 | 8252 |
addComboListOn:aModel tabable:tabable |
8253 |
"create a comboListView on aModel and add it. |
|
8254 |
Returns the comboListView." |
|
8255 |
||
8256 |
|f| |
|
8257 |
||
8258 |
f := ComboListView new. |
|
8259 |
f model:aModel. |
|
8260 |
self addComponent:f tabable:tabable. |
|
8261 |
^ f |
|
8262 |
||
8263 |
"without a list, the comboList is disabled: |
|
8264 |
||
8265 |
|box val| |
|
8266 |
||
8267 |
val := 'some input' asValue. |
|
8268 |
||
8269 |
box := Dialog new. |
|
8270 |
||
8271 |
(box addTextLabel:'combo list example') adjust:#left. |
|
8272 |
box addVerticalSpace. |
|
8273 |
(box addComboListOn:val tabable:true). |
|
8274 |
box addOkButton. |
|
8275 |
box open. |
|
8276 |
box accepted ifTrue:[ |
|
1401 | 8277 |
Transcript showCR:val value |
593 | 8278 |
]. |
8279 |
" |
|
8280 |
||
8281 |
"with a list, it can be pulled: |
|
8282 |
||
8283 |
|box val| |
|
8284 |
||
8285 |
val := '' asValue. |
|
8286 |
||
8287 |
box := Dialog new. |
|
8288 |
||
8289 |
(box addTextLabel:'combo box example') adjust:#left. |
|
8290 |
box addVerticalSpace. |
|
8291 |
(box addComboListOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
8292 |
box addOkButton. |
|
8293 |
box open. |
|
8294 |
box accepted ifTrue:[ |
|
1401 | 8295 |
Transcript showCR:val value |
593 | 8296 |
]. |
8297 |
" |
|
8298 |
||
8299 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
8300 |
"Modified: 4.3.1996 / 17:23:38 / cg" |
|
4777 | 8301 |
! |
8302 |
||
8303 |
addTriggerBox:label action:aBlock |
|
8304 |
"create a triggerBox with label and action and add it. |
|
8305 |
Returns the box." |
|
8306 |
||
8307 |
|b| |
|
8308 |
||
8309 |
b := TriggerBox new action:aBlock. |
|
8310 |
b label:label. |
|
8311 |
self addComponent:b tabable:false. |
|
8312 |
^ b |
|
8313 |
||
8314 |
" |
|
8315 |
|dialog trigger1 trigger2 trigger3| |
|
8316 |
||
8317 |
trigger1 := true asValue. |
|
8318 |
trigger2 := false asValue. |
|
8319 |
trigger3 := true asValue. |
|
8320 |
||
8321 |
dialog := DialogBox new. |
|
8322 |
dialog addTriggerBox:'go' action:[Transcript showCR:'1']. |
|
8323 |
dialog addHorizontalLine. |
|
8324 |
||
8325 |
dialog addTriggerBox:'go go' action:[Transcript showCR:'2']. |
|
8326 |
dialog addTriggerBox:'trigger' action:[Transcript showCR:'3']. |
|
8327 |
dialog addOkButton. |
|
8328 |
dialog open. |
|
8329 |
" |
|
8330 |
||
8331 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
593 | 8332 |
! ! |
8333 |
||
8334 |
!DialogBox methodsFor:'construction-inputfields'! |
|
8335 |
||
8336 |
addFilenameInputFieldOn:aModel in:aDirectory tabable:tabable |
|
8337 |
"create a fileName input field on aModel and add it. |
|
8338 |
Returns the field. This is much like a normal input field, |
|
8339 |
but supports filename completion." |
|
8340 |
||
8341 |
|f| |
|
8342 |
||
8343 |
f := FilenameEditField new. |
|
8344 |
aDirectory notNil ifTrue:[f directory:aDirectory]. |
|
8345 |
f model:aModel. |
|
8346 |
self addInputField:f tabable:tabable. |
|
8347 |
^ f |
|
8348 |
! |
|
8349 |
||
8350 |
addInputField:aField |
|
8351 |
"add an already created input field. |
|
8352 |
Returns the field." |
|
8353 |
||
8354 |
^ self addInputField:aField tabable:true |
|
8355 |
||
8356 |
"Modified: 9.2.1996 / 20:46:16 / cg" |
|
8357 |
! |
|
8358 |
||
8359 |
addInputField:aField tabable:tabable |
|
8360 |
"add an already created input field. |
|
8361 |
If tabable is true, the field is put into a group, to allow |
|
8362 |
stepping through the fields with #Cursor/#Return keys. |
|
8363 |
Returns the field." |
|
8364 |
||
8365 |
self addComponent:aField tabable:tabable. |
|
8366 |
tabable ifTrue:[ |
|
1401 | 8367 |
self addToInputFieldGroup:aField. |
593 | 8368 |
]. |
8369 |
^ aField |
|
8370 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8371 |
"Modified: 31.5.1996 / 21:22:29 / cg" |
593 | 8372 |
! |
8373 |
||
8374 |
addInputFieldOn:aModel |
|
8375 |
"create an input field on aModel and add it. |
|
8376 |
Returns the field." |
|
8377 |
||
8378 |
^ self addInputFieldOn:aModel tabable:true |
|
8379 |
||
8380 |
" |
|
8381 |
|dialog model field| |
|
8382 |
||
8383 |
model := '' asValue. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8384 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8385 |
dialog := DialogBox new. |
593 | 8386 |
(dialog addTextLabel:'enter a string') adjust:#left. |
8387 |
||
8388 |
field := dialog addInputFieldOn:model. |
|
8389 |
||
8390 |
dialog addAbortButton; addOkButton. |
|
8391 |
dialog open. |
|
655 | 8392 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8393 |
" |
8394 |
||
8395 |
"Modified: 9.2.1996 / 21:34:14 / cg" |
|
8396 |
! |
|
8397 |
||
8398 |
addInputFieldOn:aModel tabable:tabable |
|
8399 |
"create an input field on aModel and add it. |
|
8400 |
If tabable is false, the field cannot be tabbed into |
|
8401 |
and return does not close the box. |
|
8402 |
(pointer must be moved into it). |
|
8403 |
Returns the field." |
|
8404 |
||
8405 |
|f| |
|
8406 |
||
913 | 8407 |
f := EditField model:aModel. |
593 | 8408 |
self addInputField:f tabable:tabable. |
8409 |
^ f |
|
8410 |
||
8411 |
" a non-tabable field: |
|
8412 |
||
8413 |
|dialog model field| |
|
8414 |
||
8415 |
model := '' asValue. |
|
8416 |
||
8417 |
dialog := DialogBox new. |
|
8418 |
(dialog addTextLabel:'enter a string') adjust:#left. |
|
8419 |
||
8420 |
field := dialog addInputFieldOn:model tabable:false. |
|
8421 |
||
8422 |
dialog addAbortButton; addOkButton. |
|
8423 |
dialog open. |
|
655 | 8424 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8425 |
" |
8426 |
||
8427 |
"Modified: 9.2.1996 / 21:36:16 / cg" |
|
913 | 8428 |
"Modified: 3.1.1997 / 10:24:04 / stefan" |
593 | 8429 |
! |
8430 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8431 |
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
|
8432 |
"add a label and an inputField side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8433 |
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
|
8434 |
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
|
8435 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8436 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8437 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8438 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8439 |
^ self |
1401 | 8440 |
addLabelledField:(EditField on:model) label:labelString |
8441 |
adjust:labelAdjust |
|
8442 |
tabable:tabable |
|
8443 |
from:leftX to:rightX |
|
8444 |
separateAtX:relativeX. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8445 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8446 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8447 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8448 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8449 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8450 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8451 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8452 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8453 |
field := dialog |
1401 | 8454 |
addLabelledInputField:'enter a string' |
8455 |
adjust:#left |
|
8456 |
on:model |
|
8457 |
tabable:true |
|
8458 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8459 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8460 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8461 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8462 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8463 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8464 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8465 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8466 |
|dialog model1 model2 field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8467 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8468 |
model1 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8469 |
model2 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8470 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8471 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8472 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8473 |
dialog addTextLabel:'a two-input box'. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8474 |
dialog addHorizontalLine. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8475 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8476 |
field := dialog |
1401 | 8477 |
addLabelledInputField:'string1:' |
8478 |
adjust:#right |
|
8479 |
on:model1 |
|
8480 |
tabable:true |
|
8481 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8482 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8483 |
field := dialog |
1401 | 8484 |
addLabelledInputField:'string2:' |
8485 |
adjust:#right |
|
8486 |
on:model2 |
|
8487 |
tabable:true |
|
8488 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8489 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8490 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8491 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8492 |
dialog accepted ifTrue:[ |
1401 | 8493 |
Transcript showCR:model1 value. |
8494 |
Transcript showCR:model2 value. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8495 |
]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8496 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8497 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8498 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8499 |
"Created: 3.6.1996 / 11:04:23 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8500 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8501 |
|
593 | 8502 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable separateAtX:relativeX |
8503 |
"add a label and an inputField side-by-side. |
|
8504 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
8505 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
8506 |
The inputField gets model as its model. |
|
8507 |
Return the inputField." |
|
8508 |
||
8509 |
||
8510 |
^ self |
|
1401 | 8511 |
addLabelledField:(EditField on:model) label:labelString |
8512 |
adjust:labelAdjust |
|
8513 |
tabable:tabable |
|
8514 |
separateAtX:relativeX. |
|
593 | 8515 |
|
8516 |
" |
|
8517 |
|dialog model field| |
|
8518 |
||
8519 |
model := '' asValue. |
|
8520 |
||
8521 |
dialog := DialogBox new. |
|
8522 |
||
8523 |
field := dialog |
|
1401 | 8524 |
addLabelledInputField:'enter a string' |
8525 |
adjust:#left |
|
8526 |
on:model |
|
8527 |
tabable:true |
|
8528 |
separateAtX:0.3. |
|
593 | 8529 |
|
8530 |
dialog addAbortButton; addOkButton. |
|
8531 |
dialog open. |
|
655 | 8532 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8533 |
" |
8534 |
||
8535 |
" |
|
8536 |
|dialog model1 model2 field| |
|
8537 |
||
8538 |
model1 := '' asValue. |
|
8539 |
model2 := '' asValue. |
|
8540 |
||
8541 |
dialog := DialogBox new. |
|
8542 |
||
8543 |
dialog addTextLabel:'a two-input box'. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8544 |
dialog addHorizontalLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8545 |
|
593 | 8546 |
field := dialog |
1401 | 8547 |
addLabelledInputField:'string1:' |
8548 |
adjust:#right |
|
8549 |
on:model1 |
|
8550 |
tabable:true |
|
8551 |
separateAtX:0.4. |
|
593 | 8552 |
|
8553 |
field := dialog |
|
1401 | 8554 |
addLabelledInputField:'string2:' |
8555 |
adjust:#right |
|
8556 |
on:model2 |
|
8557 |
tabable:true |
|
8558 |
separateAtX:0.4. |
|
593 | 8559 |
|
8560 |
dialog addAbortButton; addOkButton. |
|
8561 |
dialog open. |
|
8562 |
dialog accepted ifTrue:[ |
|
1401 | 8563 |
Transcript showCR:model1 value. |
8564 |
Transcript showCR:model2 value. |
|
593 | 8565 |
]. |
8566 |
" |
|
8567 |
||
8568 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
8569 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
|
8570 |
! ! |
|
8571 |
||
8572 |
!DialogBox methodsFor:'construction-layout'! |
|
8573 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8574 |
addGap |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8575 |
"VW compatibility" |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8576 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8577 |
self addGap:4 |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8578 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8579 |
|
2116 | 8580 |
addGap:pixels |
8581 |
"VW compatibility" |
|
8582 |
||
8583 |
self addVerticalSpace:pixels |
|
8584 |
||
8585 |
"Created: / 4.2.2000 / 00:03:58 / cg" |
|
8586 |
"Modified: / 5.2.2000 / 15:30:26 / cg" |
|
8587 |
! |
|
8588 |
||
593 | 8589 |
addHorizontalLine |
8590 |
"add a horizontal line as separator" |
|
8591 |
||
8592 |
^ self addComponent:(Separator new extent:1.0 @ 5). |
|
8593 |
||
8594 |
" |
|
8595 |
|dialog| |
|
8596 |
||
8597 |
dialog := DialogBox new. |
|
8598 |
dialog |
|
1401 | 8599 |
addTextLabel:'some title string'; |
8600 |
addHorizontalLine; |
|
8601 |
addTextLabel:'more text'; |
|
8602 |
addOkButton; |
|
8603 |
open. |
|
593 | 8604 |
" |
8605 |
||
8606 |
" |
|
8607 |
|dialog| |
|
8608 |
||
8609 |
dialog := DialogBox new. |
|
8610 |
dialog |
|
1401 | 8611 |
addTextLabel:'some title string'; |
8612 |
addHorizontalLine; |
|
8613 |
addTextLabel:'more text'. |
|
593 | 8614 |
(dialog addHorizontalLine) width:20. |
8615 |
dialog addTextLabel:'more text'. |
|
8616 |
(dialog addHorizontalLine) width:20. |
|
8617 |
dialog |
|
1401 | 8618 |
addTextLabel:'more text'; |
8619 |
addHorizontalLine; |
|
8620 |
addOkButton; |
|
8621 |
open. |
|
593 | 8622 |
" |
8623 |
||
8624 |
"Modified: 19.4.1996 / 15:11:30 / cg" |
|
8625 |
! |
|
8626 |
||
8627 |
addVerticalSpace |
|
8628 |
"add a default vertical space (1 mm)" |
|
8629 |
||
8630 |
self addVerticalSpace:(ViewSpacing). |
|
8631 |
||
8632 |
" |
|
8633 |
|dialog| |
|
8634 |
||
8635 |
dialog := DialogBox new. |
|
8636 |
dialog addTextLabel:'some title string'. |
|
8637 |
dialog addVerticalSpace. |
|
8638 |
dialog addTextLabel:'more text'. |
|
8639 |
||
8640 |
dialog addOkButton. |
|
8641 |
dialog open. |
|
8642 |
" |
|
8643 |
||
8644 |
"Modified: 9.2.1996 / 21:41:10 / cg" |
|
8645 |
! |
|
8646 |
||
8647 |
addVerticalSpace:nPixel |
|
8648 |
"add some pixels of space to the next component" |
|
8649 |
||
8650 |
yPosition := yPosition + nPixel. |
|
8651 |
needResize := true. |
|
8652 |
||
8653 |
" |
|
8654 |
|dialog| |
|
8655 |
||
8656 |
dialog := DialogBox new. |
|
8657 |
dialog addTextLabel:'some title string'. |
|
8658 |
dialog addVerticalSpace:50. |
|
8659 |
dialog addTextLabel:'more text'. |
|
8660 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8661 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8662 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8663 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8664 |
|
593 | 8665 |
"Modified: 9.2.1996 / 21:41:23 / cg" |
8666 |
! ! |
|
8667 |
||
8668 |
!DialogBox methodsFor:'construction-lists'! |
|
8669 |
||
2116 | 8670 |
addList:listHolder lines:nLines validation:validateionBlock |
8671 |
^ self |
|
8672 |
addListBoxOn:listHolder |
|
8673 |
withNumberOfLines:nLines |
|
8674 |
hScrollable:true |
|
8675 |
vScrollable:true |
|
8676 |
||
8677 |
"Created: / 4.2.2000 / 00:04:49 / cg" |
|
8678 |
"Modified: / 4.2.2000 / 00:06:06 / cg" |
|
8679 |
! |
|
8680 |
||
593 | 8681 |
addListBoxOn:aModel |
8682 |
"add a selectionInListView to the box. |
|
8683 |
The listViews ScrollWrapper is returned" |
|
8684 |
||
8685 |
^ self |
|
1401 | 8686 |
addListBoxOn:aModel |
8687 |
withNumberOfLines:nil |
|
8688 |
hScrollable:false |
|
8689 |
vScrollable:true. |
|
593 | 8690 |
|
8691 |
" |
|
8692 |
|dialog model listView| |
|
8693 |
||
8694 |
model := SelectionInList new. |
|
8695 |
model list:#('one' 'two' 'three' 'four'). |
|
8696 |
model selectionIndex:2. |
|
8697 |
||
8698 |
dialog := DialogBox new. |
|
8699 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8700 |
||
8701 |
listView := dialog addListBoxOn:model. |
|
8702 |
||
8703 |
dialog addAbortButton; addOkButton. |
|
8704 |
dialog open. |
|
8705 |
||
655 | 8706 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8707 |
" |
8708 |
||
8709 |
"Modified: 27.4.1996 / 18:27:58 / cg" |
|
8710 |
! |
|
8711 |
||
8712 |
addListBoxOn:aModel class:aListViewClass |
|
8713 |
"create & add an instance of aListViewClass to the box. |
|
8714 |
The listViews ScrollWrapper is returned" |
|
8715 |
||
8716 |
^ self |
|
1401 | 8717 |
addListBoxOn:aModel |
8718 |
class:aListViewClass |
|
8719 |
withNumberOfLines:nil |
|
8720 |
hScrollable:false |
|
8721 |
vScrollable:true. |
|
593 | 8722 |
|
8723 |
"Created: 19.4.1996 / 13:06:14 / cg" |
|
8724 |
"Modified: 27.4.1996 / 18:27:53 / cg" |
|
8725 |
! |
|
8726 |
||
8727 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines |
|
8728 |
"create and add an instance of aListViewClass to the box. |
|
8729 |
The list has numLines (if nonNil) number of lines shown. |
|
8730 |
The listViews ScrollWrapper is returned" |
|
8731 |
||
8732 |
^ self |
|
1401 | 8733 |
addListBoxOn:aModel |
8734 |
class:aListViewClass |
|
8735 |
withNumberOfLines:numLines |
|
8736 |
hScrollable:false |
|
8737 |
vScrollable:true. |
|
593 | 8738 |
|
8739 |
"Created: 19.4.1996 / 13:05:05 / cg" |
|
8740 |
"Modified: 27.4.1996 / 18:27:48 / cg" |
|
8741 |
! |
|
8742 |
||
8743 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
766 | 8744 |
"add an instance of aListViewClass (selectionInListView) to the box. |
593 | 8745 |
The list has numLines (if nonNil) number of lines shown. |
8746 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8747 |
||
766 | 8748 |
|l| |
8749 |
||
8750 |
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
|
8751 |
(aListViewClass canUnderstand:#doubleClickAction:) ifTrue:[ |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8752 |
l doubleClickAction:[:name | self okPressed]. |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8753 |
]. |
766 | 8754 |
^ l |
593 | 8755 |
|
8756 |
" |
|
8757 |
|dialog listView| |
|
8758 |
||
8759 |
dialog := DialogBox new. |
|
8760 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8761 |
||
8762 |
listView := dialog |
|
3812
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8763 |
addListBoxOn:nil |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8764 |
class:FileSelectionList |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8765 |
withNumberOfLines:10 |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8766 |
hScrollable:false |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8767 |
vScrollable:false. |
593 | 8768 |
|
8769 |
listView directory:'/etc'. |
|
8770 |
||
8771 |
dialog addAbortButton; addOkButton. |
|
8772 |
dialog open. |
|
8773 |
||
655 | 8774 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView selectionValue]. |
593 | 8775 |
" |
8776 |
||
8777 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8778 |
"Modified: 27.4.1996 / 18:26:15 / cg" |
|
766 | 8779 |
"Modified: 15.6.1996 / 00:31:20 / stefan" |
593 | 8780 |
! |
8781 |
||
8782 |
addListBoxOn:aModel withNumberOfLines:numLines |
|
8783 |
"add a selectionInListView to the box. |
|
8784 |
The list has numLines (if nonNil) number of lines shown. |
|
8785 |
The listViews ScrollWrapper is returned" |
|
8786 |
||
8787 |
^ self |
|
1401 | 8788 |
addListBoxOn:aModel |
8789 |
withNumberOfLines:numLines |
|
8790 |
hScrollable:false |
|
8791 |
vScrollable:true. |
|
593 | 8792 |
|
8793 |
" |
|
8794 |
|dialog model listView| |
|
8795 |
||
8796 |
model := SelectionInList new. |
|
8797 |
model list:#('one' 'two' 'three' 'four'). |
|
8798 |
model selectionIndex:2. |
|
8799 |
||
8800 |
dialog := DialogBox new. |
|
8801 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8802 |
||
8803 |
listView := dialog addListBoxOn:model withNumberOfLines:3. |
|
8804 |
||
8805 |
dialog addAbortButton; addOkButton. |
|
8806 |
dialog open. |
|
8807 |
||
655 | 8808 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8809 |
" |
8810 |
||
8811 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8812 |
"Modified: 27.4.1996 / 18:27:42 / cg" |
|
8813 |
! |
|
8814 |
||
8815 |
addListBoxOn:aModel withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
8816 |
"add a selectionInListView to the box. |
|
8817 |
The list has numLines (if nonNil) number of lines shown. |
|
8818 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8819 |
||
8820 |
^ self |
|
1401 | 8821 |
addListBoxOn:aModel |
8822 |
class:SelectionInListView |
|
8823 |
withNumberOfLines:numLines |
|
8824 |
hScrollable:hs |
|
8825 |
vScrollable:vs |
|
593 | 8826 |
|
8827 |
" |
|
8828 |
|dialog model listView| |
|
8829 |
||
8830 |
model := SelectionInList new. |
|
8831 |
model list:#('one' 'two' 'three' 'four'). |
|
8832 |
model selectionIndex:2. |
|
8833 |
||
8834 |
dialog := DialogBox new. |
|
8835 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8836 |
||
8837 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:true vScrollable:true. |
|
8838 |
||
8839 |
dialog addAbortButton; addOkButton. |
|
8840 |
dialog open. |
|
8841 |
||
655 | 8842 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8843 |
" |
8844 |
||
8845 |
" |
|
8846 |
|dialog model listView| |
|
8847 |
||
8848 |
model := SelectionInList new. |
|
8849 |
model list:#('one' 'two' 'three' 'four'). |
|
8850 |
model selectionIndex:2. |
|
8851 |
||
8852 |
dialog := DialogBox new. |
|
8853 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8854 |
||
8855 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:false vScrollable:false. |
|
8856 |
||
8857 |
dialog addAbortButton; addOkButton. |
|
8858 |
dialog open. |
|
8859 |
||
655 | 8860 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8861 |
" |
8862 |
||
8863 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8864 |
"Modified: 27.4.1996 / 18:26:36 / cg" |
|
8865 |
! |
|
8866 |
||
8867 |
addPopUpList:labelString on:aModel |
|
8868 |
"create a popUpList with a label on aModel and add it. |
|
8869 |
Returns the box." |
|
8870 |
||
8871 |
^ self addPopUpList:labelString on:aModel tabable:true |
|
8872 |
! |
|
8873 |
||
8874 |
addPopUpList:labelString on:aModel tabable:tabable |
|
8875 |
"create a popUpList on aModel and add it. |
|
8876 |
Returns the popUpList." |
|
8877 |
||
8878 |
|p box l| |
|
8879 |
||
8880 |
p := PopUpList on:aModel. |
|
8881 |
p resize; sizeFixed:true. |
|
8882 |
labelString notNil ifTrue:[ |
|
1401 | 8883 |
box := HorizontalPanelView new. |
8884 |
box borderWidth:0; horizontalLayout:#rightSpace. |
|
8885 |
box add:(l := Label label:labelString). |
|
8886 |
l borderWidth:0. |
|
8887 |
box add:p. |
|
593 | 8888 |
] ifFalse:[ |
1401 | 8889 |
box := p. |
593 | 8890 |
]. |
8891 |
self addComponent:box tabable:tabable tabbedComponent:p. |
|
8892 |
^ p |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
8893 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8894 |
"Modified: 31.5.1996 / 21:25:17 / cg" |
593 | 8895 |
! |
8896 |
||
8897 |
addPopUpListOn:aModel |
|
8898 |
"create a popUpList on aModel and add it. |
|
8899 |
Returns the box." |
|
8900 |
||
8901 |
^ self addPopUpList:nil on:aModel tabable:true |
|
8902 |
! |
|
8903 |
||
8904 |
addPopUpListOn:aModel tabable:tabable |
|
8905 |
"create a popUpList on aModel and add it. |
|
8906 |
Returns the popUpList." |
|
8907 |
||
8908 |
^ self addPopUpList:nil on:aModel tabable:tabable |
|
766 | 8909 |
! |
8910 |
||
4293
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8911 |
addRadioButton:labelString on:aRadioButtonGroupModel value:radioValue tabable:tabable |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8912 |
"create a radio button on aModel and add it. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8913 |
Returns the radio button." |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8914 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8915 |
|r| |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8916 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8917 |
r := RadioButton label:labelString. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8918 |
aRadioButtonGroupModel add:r value:radioValue. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8919 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8920 |
self addComponent:r tabable:tabable. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8921 |
^ r |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8922 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8923 |
"Created: / 23-07-2011 / 17:28:08 / cg" |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8924 |
! |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8925 |
|
766 | 8926 |
addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
8927 |
"add an instance of aListViewClass to the box. |
|
8928 |
The list has numLines (if nonNil) number of lines shown. |
|
8929 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8930 |
||
8931 |
|l scr h dH| |
|
8932 |
||
8933 |
l := aListViewClass new. |
|
8934 |
l model:aModel. |
|
8935 |
||
877 | 8936 |
(vs or:[hs]) ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8937 |
hs ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8938 |
scr := HVScrollableView forView:l miniScrollerH:true . |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8939 |
] ifFalse:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8940 |
scr := ScrollableView forView:l |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8941 |
]. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8942 |
scr resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8943 |
"/ Transcript show:scr height; show:' '; showCR:l height. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8944 |
dH := scr height - l height. |
766 | 8945 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8946 |
l level:-1. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8947 |
scr := l. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8948 |
dH := 0. |
766 | 8949 |
]. |
8950 |
||
8951 |
numLines notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8952 |
h := l heightForLines:numLines. |
766 | 8953 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8954 |
h := l preferredHeight |
766 | 8955 |
]. |
8956 |
self addComponent:scr withHeight:(h + dH). |
|
8957 |
^ scr |
|
8958 |
||
8959 |
" |
|
8960 |
|dialog listView| |
|
8961 |
||
8962 |
dialog := DialogBox new. |
|
8963 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8964 |
||
8965 |
listView := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8966 |
addTextBoxOn:nil |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8967 |
class:EditTextView |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8968 |
withNumberOfLines:10 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8969 |
hScrollable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8970 |
vScrollable:true. |
766 | 8971 |
|
8972 |
||
8973 |
dialog addAbortButton; addOkButton. |
|
8974 |
dialog open. |
|
8975 |
||
8976 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView contents]. |
|
8977 |
" |
|
8978 |
||
8979 |
"Created: 14.6.1996 / 23:33:47 / stefan" |
|
877 | 8980 |
"Modified: 8.11.1996 / 15:31:15 / cg" |
593 | 8981 |
! ! |
8982 |
||
8983 |
!DialogBox methodsFor:'construction-rows & columns'! |
|
8984 |
||
130 | 8985 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock |
8986 |
"add some elements in a vertical column. |
|
8987 |
Equally space elements as returned from aBlock." |
|
8988 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8989 |
self |
1401 | 8990 |
addColumn:aRow |
8991 |
fromX:leftX toX:rightX |
|
8992 |
collect:aBlock |
|
8993 |
tabable:false |
|
130 | 8994 |
|
8995 |
" |
|
8996 |
|dialog| |
|
8997 |
||
8998 |
dialog := Dialog new. |
|
8999 |
dialog |
|
1401 | 9000 |
addColumn:#('label1' 'label2' 'lbl3' 'l4' 'label5') |
9001 |
fromX:0.0 |
|
9002 |
toX:1.0 |
|
9003 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9004 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9005 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9006 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9007 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9008 |
|
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 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9011 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9012 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9013 |
dialog |
1401 | 9014 |
addColumn:#('label1' 'label2' 'label3' 'label4' 'label5') |
9015 |
fromX:0.25 |
|
9016 |
toX:0.75 |
|
9017 |
collect:[:label | (Label label:label) adjust:#left]. |
|
130 | 9018 |
|
9019 |
dialog addOkButton. |
|
9020 |
dialog open. |
|
9021 |
" |
|
9022 |
||
9023 |
" |
|
9024 |
|dialog y| |
|
9025 |
||
9026 |
dialog := Dialog new. |
|
9027 |
y := dialog yPosition. |
|
9028 |
dialog |
|
1401 | 9029 |
addColumn:#('a1' 'b1' 'c1' 'd1') |
9030 |
fromX:0 |
|
9031 |
toX:(1/3) |
|
9032 |
collect:[:label | Label label:label]. |
|
130 | 9033 |
|
9034 |
dialog yPosition:y. |
|
9035 |
dialog |
|
1401 | 9036 |
addColumn:#('a2' 'b2' 'c2' 'd2') |
9037 |
fromX:(1/3) |
|
9038 |
toX:(2/3) |
|
9039 |
collect:[:label | Label label:label]. |
|
130 | 9040 |
|
9041 |
dialog yPosition:y. |
|
9042 |
dialog |
|
1401 | 9043 |
addColumn:#('a3' 'b3' 'c3' 'd3') |
9044 |
fromX:(2/3) |
|
9045 |
toX:1 |
|
9046 |
collect:[:label | Label label:label]. |
|
130 | 9047 |
|
9048 |
dialog addOkButton. |
|
9049 |
dialog open. |
|
9050 |
" |
|
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 |
"Modified: 9.2.1996 / 22:22:12 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9053 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9054 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9055 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9056 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9057 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9058 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9059 |
self |
1401 | 9060 |
addColumn:aRow |
9061 |
fromX:leftX toX:rightX |
|
9062 |
collect:aBlock |
|
9063 |
tabable:tabable |
|
9064 |
horizontalLayout:#fitSpace |
|
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 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9068 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9069 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
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 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9072 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9073 |
dialog |
1401 | 9074 |
addColumn:#('one' 'two' 'three' 'four') |
9075 |
fromX:0 |
|
9076 |
toX:0.3 |
|
9077 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9078 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9079 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9080 |
dialog |
1401 | 9081 |
addColumn:values |
9082 |
fromX:0.3 |
|
9083 |
toX:1.0 |
|
9084 |
collect:[:value | EditField on:value] |
|
9085 |
tabable:true. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9086 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9087 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9088 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9089 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9090 |
dialog accepted ifTrue:[ |
1401 | 9091 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9092 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9093 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9094 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9095 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9096 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9097 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9098 |
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
|
9099 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9100 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9101 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9102 |
dialog |
1401 | 9103 |
addColumn:(1 to:4) |
9104 |
fromX:0 |
|
9105 |
toX:0.5 |
|
9106 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
9107 |
tabable:true |
|
9108 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9109 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9110 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9111 |
dialog |
1401 | 9112 |
addColumn:(5 to:8) |
9113 |
fromX:0.5 |
|
9114 |
toX:1.0 |
|
9115 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
9116 |
tabable:true |
|
9117 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9118 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9119 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9120 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9121 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9122 |
dialog accepted ifTrue:[ |
1401 | 9123 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9124 |
] |
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 |
"Created: 9.2.1996 / 21:51:47 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9128 |
"Modified: 9.2.1996 / 22:22:02 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9129 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9130 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9131 |
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
|
9132 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9133 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9134 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9135 |
|helper component| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9136 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9137 |
helper := VerticalPanelView new. |
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 |
aRow do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9140 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9141 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9142 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9143 |
tabable ifTrue:[self makeTabable:component]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9144 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9145 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9146 |
helper resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9147 |
self addComponent:helper. |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9148 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9149 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9150 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9151 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9152 |
helper horizontalLayout:hLayout. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9153 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9154 |
right:rightX asFloat; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9155 |
leftInset:leftIndent; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9156 |
rightInset:rightIndent. |
344
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 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9159 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9160 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9161 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9162 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9163 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9164 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9165 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9166 |
addColumn:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9167 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9168 |
toX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9169 |
collect:[:label | Label label:label]. |
344
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 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9172 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9173 |
addColumn:values |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9174 |
fromX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9175 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9176 |
collect:[:value | EditField on:value] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9177 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9178 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9179 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9180 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9181 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9182 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9183 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9184 |
] |
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 y values| |
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 |
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
|
9191 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9192 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9193 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9194 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9195 |
addColumn:(1 to:4) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9196 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9197 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9198 |
collect:[:idx | CheckToggle on:(values at:idx)]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9199 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9200 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9201 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9202 |
addColumn:(5 to:8) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9203 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9204 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9205 |
collect:[:idx | CheckToggle on:(values at:idx)] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9206 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9207 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9208 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9209 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9210 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9211 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9212 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9213 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9214 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9215 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9216 |
"Modified: 9.2.1996 / 22:02:22 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9217 |
"Created: 9.2.1996 / 22:20:31 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9218 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9219 |
|
130 | 9220 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock |
9221 |
"add some elements in a horizontal row. |
|
9222 |
Equally space elements as returned from aBlock. |
|
9223 |
Advance y." |
|
9224 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9225 |
self |
1401 | 9226 |
addRow:aCol |
9227 |
fromX:leftX toX:rightX |
|
9228 |
collect:aBlock |
|
9229 |
tabable:true |
|
9230 |
horizontalLayout:#spread |
|
130 | 9231 |
|
9232 |
" |
|
9233 |
|dialog| |
|
9234 |
||
9235 |
dialog := Dialog new. |
|
9236 |
dialog |
|
1401 | 9237 |
addRow:#('a' 'b' 'c' 'd') |
9238 |
fromX:0 |
|
9239 |
toX:1 |
|
9240 |
collect:[:label | Label label:label]. |
|
130 | 9241 |
|
9242 |
dialog addOkButton. |
|
9243 |
dialog open. |
|
9244 |
" |
|
9245 |
||
9246 |
" |
|
9247 |
|dialog| |
|
9248 |
||
9249 |
dialog := Dialog new. |
|
9250 |
dialog |
|
1401 | 9251 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9252 |
fromX:0 |
|
9253 |
toX:1 |
|
9254 |
collect:[:label | Label label:label]. |
|
130 | 9255 |
|
9256 |
dialog |
|
1401 | 9257 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9258 |
fromX:0 |
|
9259 |
toX:0.5 |
|
9260 |
collect:[:label | Label label:label]. |
|
130 | 9261 |
|
9262 |
dialog |
|
1401 | 9263 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9264 |
fromX:0.5 |
|
9265 |
toX:1 |
|
9266 |
collect:[:label | Label label:label]. |
|
130 | 9267 |
|
9268 |
dialog addOkButton. |
|
9269 |
dialog open. |
|
9270 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9271 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9272 |
"Modified: 9.2.1996 / 22:25:16 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9273 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9274 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9275 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9276 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9277 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9278 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9279 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9280 |
self |
1401 | 9281 |
addRow:aCol |
9282 |
fromX:leftX toX:rightX |
|
9283 |
collect:aBlock |
|
9284 |
tabable:tabable |
|
9285 |
horizontalLayout:#spread |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9286 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9287 |
"Created: 9.2.1996 / 22:25:35 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9288 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9289 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9290 |
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
|
9291 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9292 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9293 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9294 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9295 |
^ self |
1401 | 9296 |
addRow:aCol |
9297 |
fromX:leftX toX:rightX |
|
9298 |
collect:aBlock |
|
9299 |
tabable:tabable |
|
9300 |
horizontalLayout:hLayout |
|
9301 |
verticalLayout:#fit |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9302 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9303 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9304 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9305 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9306 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9307 |
dialog |
1401 | 9308 |
addRow:#('a' 'b' 'c' 'd') |
9309 |
fromX:0 |
|
9310 |
toX:1 |
|
9311 |
collect:[:label | Label label:label] |
|
9312 |
tabable:false |
|
9313 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9314 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9315 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9316 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9317 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9318 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9319 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9320 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9321 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9322 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9323 |
dialog |
1401 | 9324 |
addRow:#('one' 'two' 'three' 'four') |
9325 |
fromX:0 |
|
9326 |
toX:1 |
|
9327 |
collect:[:label | Button label:label] |
|
9328 |
tabable:false |
|
9329 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9330 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9331 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9332 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9333 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9334 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9335 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9336 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9337 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9338 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9339 |
dialog |
1401 | 9340 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9341 |
fromX:0 |
|
9342 |
toX:1 |
|
9343 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9344 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9345 |
dialog |
1401 | 9346 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9347 |
fromX:0 |
|
9348 |
toX:0.5 |
|
9349 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9350 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9351 |
dialog |
1401 | 9352 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9353 |
fromX:0.5 |
|
9354 |
toX:1 |
|
9355 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9356 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9357 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9358 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9359 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9360 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9361 |
"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
|
9362 |
"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
|
9363 |
! |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9364 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9365 |
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
|
9366 |
"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
|
9367 |
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
|
9368 |
Advance y." |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9369 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9370 |
|helper component| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9371 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9372 |
helper := HorizontalPanelView new. |
792 | 9373 |
helper borderWidth:0. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9374 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9375 |
aCol do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9376 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9377 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9378 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9379 |
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
|
9380 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9381 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9382 |
helper resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9383 |
self addComponent:helper. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9384 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9385 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9386 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9387 |
"/ 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
|
9388 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9389 |
hLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9390 |
helper horizontalLayout:hLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9391 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9392 |
vLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9393 |
helper verticalLayout:vLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9394 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9395 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9396 |
right:rightX asFloat. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9397 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9398 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9399 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9400 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9401 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9402 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9403 |
addRow:#('a' 'b' 'c' 'd') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9404 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9405 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9406 |
collect:[:label | Label label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9407 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9408 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9409 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9410 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9411 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9412 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9413 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9414 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9415 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9416 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9417 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9418 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9419 |
addRow:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9420 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9421 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9422 |
collect:[:label | Button label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9423 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9424 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9425 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9426 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9427 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9428 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9429 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9430 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9431 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9432 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9433 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9434 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9435 |
addRow:#('a1' 'b1' 'c1' 'd1') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9436 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9437 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9438 |
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
|
9439 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9440 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9441 |
addRow:#('a2' 'b2' 'c2' 'd2') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9442 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9443 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9444 |
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
|
9445 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9446 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9447 |
addRow:#('a3' 'b3' 'c3' 'd3') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9448 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9449 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9450 |
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
|
9451 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9452 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9453 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9454 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9455 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9456 |
"Created: 31.5.1996 / 20:45:31 / cg" |
792 | 9457 |
"Modified: 17.7.1996 / 12:06:08 / cg" |
76 | 9458 |
! ! |
9459 |
||
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9460 |
!DialogBox methodsFor:'explicit focus control'! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9461 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9462 |
focusOnOk |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9463 |
windowGroup focusView:okButton |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9464 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9465 |
"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
|
9466 |
! ! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9467 |
|
4227 | 9468 |
!DialogBox methodsFor:'initialization & release'! |
76 | 9469 |
|
9470 |
initialize |
|
9471 |
super initialize. |
|
9472 |
||
573 | 9473 |
"/ label := 'Dialog'. |
948 | 9474 |
acceptValue := ValueHolder newBoolean. |
76 | 9475 |
|
9476 |
acceptReturnAsOK := true. |
|
125 | 9477 |
acceptOnLeave := true. |
1757 | 9478 |
focusToOKOnLeave := DefaultFocusToOKOnLeave. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9479 |
hideOnAccept := true. |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9480 |
autoAccept := true. |
76 | 9481 |
|
9482 |
buttonPanel := HorizontalPanelView in:self. |
|
118 | 9483 |
buttonPanel |
1757 | 9484 |
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
|
9485 |
bottomInset:ViewSpacing; |
4887 | 9486 |
topInset:((gc font height + ViewSpacing) * 2) negated; |
1757 | 9487 |
borderWidth:0; |
9488 |
horizontalLayout:#spread. |
|
118 | 9489 |
|
4633 | 9490 |
buttonPanel rightInset:(self device extentOfResizeHandle x). |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9491 |
"/ 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
|
9492 |
buttonPanel reverseOrderIfOKAtLeft:true. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9493 |
|
122 | 9494 |
yPosition := ViewSpacing. |
312
008267b920d9
allow more control over the indent when adding components
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
9495 |
leftIndent := rightIndent := (ViewSpacing // 2). |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9496 |
needResize := true. |
76 | 9497 |
|
9498 |
" |
|
9499 |
|b| |
|
9500 |
b := DialogBox new. |
|
118 | 9501 |
b addAbortButton; |
9502 |
addOkButton; |
|
9503 |
showAtPointer |
|
76 | 9504 |
" |
9505 |
" |
|
9506 |
|b| |
|
9507 |
b := DialogBox new. |
|
118 | 9508 |
b addOkButton; |
9509 |
showAtPointer |
|
9510 |
" |
|
76 | 9511 |
" |
118 | 9512 |
|b| |
9513 |
b := DialogBox new. |
|
9514 |
b addTextLabel:'hello world'; |
|
9515 |
addOkButton; |
|
9516 |
showAtPointer |
|
9517 |
" |
|
9518 |
" |
|
9519 |
|b| |
|
9520 |
b := DialogBox new. |
|
9521 |
b addTextLabel:'hello world'; |
|
9522 |
addVerticalSpace:50; |
|
9523 |
addOkButton; |
|
9524 |
showAtPointer |
|
9525 |
" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9526 |
|
1614 | 9527 |
"Modified: / 23.12.1997 / 10:05:24 / md" |
9528 |
"Modified: / 27.7.1998 / 20:16:37 / cg" |
|
76 | 9529 |
! |
9530 |
||
9531 |
reAdjustGeometry |
|
9532 |
"sent late in snapin processing - gives me a chance |
|
9533 |
to resize for changed font dimensions." |
|
9534 |
||
9535 |
super reAdjustGeometry. |
|
9536 |
okButton notNil ifTrue:[okButton resize]. |
|
9537 |
abortButton notNil ifTrue:[abortButton resize]. |
|
9538 |
self resize |
|
9539 |
! ! |
|
9540 |
||
4671 | 9541 |
!DialogBox methodsFor:'layout control'! |
9542 |
||
9543 |
bottomAlign:widgets |
|
9544 |
"mhmh - seems similar to our stickAtBottom functionality - to be checked" |
|
9545 |
||
9546 |
'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR. |
|
9547 |
"/ self halt:'unimplemented VW functionality'. |
|
9548 |
||
9549 |
"Created: / 4.2.2000 / 00:10:21 / cg" |
|
9550 |
"Modified: / 5.2.2000 / 15:31:23 / cg" |
|
9551 |
! |
|
9552 |
||
9553 |
bottomAlignLowerEdge:widget |
|
9554 |
"mhmh - seems similar to our stickAtBottom functionality - to be checked" |
|
9555 |
||
9556 |
"/ self halt:'unimplemented VW functionality'. |
|
9557 |
self stickAtBottomWithVariableHeight:widget |
|
9558 |
||
9559 |
"Modified: / 5.2.2000 / 15:31:15 / cg" |
|
9560 |
! |
|
9561 |
||
9562 |
leftIndent |
|
9563 |
"return the current indent |
|
9564 |
(current x position - thats where the next component will be located)." |
|
9565 |
||
9566 |
^ leftIndent |
|
9567 |
||
9568 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
9569 |
! |
|
9570 |
||
9571 |
leftIndent:aNumber |
|
9572 |
"set the left indent |
|
9573 |
(current x position - that's where the next component(s) will be located). |
|
9574 |
Setting this before adding a component will place it indented" |
|
9575 |
||
9576 |
leftIndent := aNumber. |
|
9577 |
needResize := true. |
|
9578 |
||
9579 |
" |
|
9580 |
|dialog| |
|
9581 |
||
9582 |
dialog := DialogBox new. |
|
9583 |
(dialog addTextLabel:'label1') adjust:#left. |
|
9584 |
dialog leftIndent:20. |
|
9585 |
(dialog addTextLabel:'label2') adjust:#left. |
|
9586 |
dialog leftIndent:40. |
|
9587 |
(dialog addTextLabel:'label3') adjust:#left. |
|
9588 |
dialog leftIndent:60. |
|
9589 |
(dialog addTextLabel:'label4') adjust:#left. |
|
9590 |
||
9591 |
dialog addOkButton. |
|
9592 |
dialog open. |
|
9593 |
" |
|
9594 |
||
9595 |
"Modified: 9.2.1996 / 21:42:20 / cg" |
|
9596 |
! |
|
9597 |
||
9598 |
rightIndent |
|
9599 |
"return the current right indent." |
|
9600 |
||
9601 |
^ rightIndent |
|
9602 |
||
9603 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
9604 |
! |
|
9605 |
||
9606 |
rightIndent:aNumber |
|
9607 |
"set the right indent" |
|
9608 |
||
9609 |
rightIndent := aNumber. |
|
9610 |
needResize := true. |
|
9611 |
||
9612 |
" |
|
9613 |
|dialog| |
|
9614 |
||
9615 |
dialog := DialogBox new. |
|
9616 |
(dialog addTextLabel:'label1') adjust:#right. |
|
9617 |
dialog rightIndent:20. |
|
9618 |
(dialog addTextLabel:'label2') adjust:#right. |
|
9619 |
dialog rightIndent:40. |
|
9620 |
(dialog addTextLabel:'label3') adjust:#right. |
|
9621 |
dialog rightIndent:60. |
|
9622 |
(dialog addTextLabel:'label4') adjust:#right. |
|
9623 |
||
9624 |
dialog addOkButton. |
|
9625 |
dialog open. |
|
9626 |
" |
|
9627 |
||
9628 |
"Modified: 9.2.1996 / 21:42:46 / cg" |
|
9629 |
! |
|
9630 |
||
9631 |
setInitialGap |
|
9632 |
||
9633 |
"Created: / 4.2.2000 / 00:01:44 / cg" |
|
9634 |
! |
|
9635 |
||
9636 |
stickAtBottomWithFixHeight:aComponent |
|
9637 |
"arrange for a component to be positioned at a constant offset |
|
9638 |
from the bottom of the box and its height to remain the same. |
|
9639 |
This will keep the component at a constant distance from the bottom |
|
9640 |
(without this setup, it would stay at a constant offset from the top). |
|
9641 |
ATTENTION: use this as a last step, after all components have been added." |
|
9642 |
||
9643 |
self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0 |
|
9644 |
||
9645 |
" |
|
9646 |
compare the resizing behavior of: |
|
9647 |
||
9648 |
|box| |
|
9649 |
||
9650 |
box := Dialog new. |
|
9651 |
box addTextLabel:'hello'. |
|
9652 |
box addTextLabel:'hello2'. |
|
9653 |
box addOkButton. |
|
9654 |
box show |
|
9655 |
||
9656 |
with: |
|
9657 |
||
9658 |
|box l2| |
|
9659 |
||
9660 |
box := Dialog new. |
|
9661 |
box addTextLabel:'hello'. |
|
9662 |
l2 := box addTextLabel:'hello2'. |
|
9663 |
box addOkButton. |
|
9664 |
box stickAtBottomWithFixHeight:l2. |
|
9665 |
box show |
|
9666 |
" |
|
9667 |
||
9668 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
|
9669 |
"Modified: / 18.8.2000 / 21:38:21 / cg" |
|
9670 |
! |
|
9671 |
||
9672 |
stickAtBottomWithFixHeight:aComponent left:left right:right |
|
9673 |
"arrange for a component to be positioned at a constant offset |
|
9674 |
from the bottom of the box and its height to remain the same. |
|
9675 |
This will keep the component at a constant distance from the bottom |
|
9676 |
(without this setup, it would stay at a constant offset from the top). |
|
9677 |
ATTENTION: use this as a last step, after all components have been added." |
|
9678 |
||
9679 |
self resize. |
|
9680 |
||
9681 |
aComponent |
|
9682 |
topInset:(self height - aComponent top) negated; |
|
9683 |
bottomInset:(self height - aComponent bottom); |
|
9684 |
origin:left @ 1.0; corner:right @ 1.0. |
|
9685 |
||
9686 |
" |
|
9687 |
compare the resizing behavior of: |
|
9688 |
||
9689 |
|box| |
|
9690 |
||
9691 |
box := Dialog new. |
|
9692 |
box addTextLabel:'hello'. |
|
9693 |
box addTextLabel:'hello2'. |
|
9694 |
box addOkButton. |
|
9695 |
box show |
|
9696 |
||
9697 |
with: |
|
9698 |
||
9699 |
|box l2| |
|
9700 |
||
9701 |
box := Dialog new. |
|
9702 |
box addTextLabel:'hello'. |
|
9703 |
l2 := box addTextLabel:'hello2'. |
|
9704 |
box addOkButton. |
|
9705 |
box stickAtBottomWithFixHeight:l2. |
|
9706 |
box show |
|
9707 |
" |
|
9708 |
||
9709 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
|
9710 |
"Modified: / 18.8.2000 / 21:38:26 / cg" |
|
9711 |
! |
|
9712 |
||
9713 |
stickAtBottomWithVariableHeight:aComponent |
|
9714 |
"arrange for a component to be positioned at a constant offset |
|
9715 |
from the bottom of the box and its height to be adjusted. |
|
9716 |
This will resize the component for a constant distance from the top, |
|
9717 |
and the bottom. |
|
9718 |
(without this setup, its height would remain constant). |
|
9719 |
ATTENTION: use this as a last step, after all components have been added." |
|
9720 |
||
9721 |
self resize. |
|
9722 |
||
9723 |
aComponent |
|
9724 |
bottomInset:(self height - aComponent bottom); |
|
9725 |
corner:1.0@1.0. |
|
9726 |
||
9727 |
" |
|
9728 |
compare the resizing behavior of: |
|
9729 |
||
9730 |
|box| |
|
9731 |
||
9732 |
box := Dialog new. |
|
9733 |
box addTextLabel:'hello'. |
|
9734 |
(box addComponent:(SelectionInListView new)) level:-1. |
|
9735 |
box addOkButton. |
|
9736 |
box show |
|
9737 |
||
9738 |
with: |
|
9739 |
||
9740 |
|box list| |
|
9741 |
||
9742 |
box := Dialog new. |
|
9743 |
box addTextLabel:'hello'. |
|
9744 |
list := (box addComponent:(SelectionInListView new)) level:-1. |
|
9745 |
box addOkButton. |
|
9746 |
box stickAtBottomWithVariableHeight:list. |
|
9747 |
box show |
|
9748 |
" |
|
9749 |
||
9750 |
"Modified: / 18.8.2000 / 21:38:35 / cg" |
|
9751 |
! |
|
9752 |
||
9753 |
yPosition |
|
9754 |
"return the current y position (thats where the next component |
|
9755 |
will be located)." |
|
9756 |
||
9757 |
^ yPosition |
|
9758 |
! |
|
9759 |
||
9760 |
yPosition:aNumber |
|
9761 |
"set the current y position (thats where the next component |
|
9762 |
will be located)." |
|
9763 |
||
9764 |
yPosition := aNumber. |
|
9765 |
needResize := true. |
|
9766 |
||
9767 |
" |
|
9768 |
|dialog pos| |
|
9769 |
||
9770 |
dialog := DialogBox new. |
|
9771 |
pos := dialog yPosition. |
|
9772 |
(dialog addTextLabel:'label1') width:0.5. |
|
9773 |
dialog yPosition:pos. |
|
9774 |
(dialog addTextLabel:'label2') width:0.5; left:0.5. |
|
9775 |
||
9776 |
dialog addOkButton. |
|
9777 |
dialog open. |
|
9778 |
" |
|
9779 |
||
9780 |
" |
|
9781 |
|dialog pos| |
|
9782 |
||
9783 |
dialog := DialogBox new. |
|
9784 |
pos := dialog yPosition. |
|
9785 |
#('one' 'two' 'three' 'four') |
|
9786 |
with:#(0.0 0.25 0.5 0.75) do:[:lbl :x | |
|
9787 |
dialog yPosition:pos. |
|
9788 |
(dialog addComponent:(Button label:lbl) tabable:true) |
|
9789 |
width:0.25; left:x. |
|
9790 |
]. |
|
9791 |
||
9792 |
dialog addOkButton. |
|
9793 |
dialog open. |
|
9794 |
" |
|
9795 |
||
9796 |
"Modified: 9.2.1996 / 21:46:40 / cg" |
|
9797 |
! ! |
|
9798 |
||
197 | 9799 |
!DialogBox methodsFor:'private'! |
9800 |
||
9801 |
basicAddComponent:aComponent |
|
9802 |
"add a component, dont change its size" |
|
9803 |
||
9804 |
addedComponents isNil ifTrue:[ |
|
2126 | 9805 |
addedComponents := OrderedCollection new. |
197 | 9806 |
]. |
9807 |
addedComponents add:aComponent. |
|
9808 |
self addSubView:aComponent. |
|
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9809 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9810 |
needResize := true. |
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9811 |
"/ 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
|
9812 |
preferredExtent := nil. |
197 | 9813 |
! |
9814 |
||
9815 |
hideAndEvaluate:aBlock |
|
9816 |
"if I am modal, make myself invisible and evaluate aBlock. |
|
9817 |
If nonModal, stay up, but also evaluate the block." |
|
9818 |
||
9819 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9820 |
self hide. |
197 | 9821 |
]. |
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9822 |
aBlock notNil ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9823 |
aBlock numArgs == 0 ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9824 |
aBlock value |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9825 |
] ifFalse:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9826 |
aBlock value:(self actionArgument) |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9827 |
] |
2673
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9828 |
]. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9829 |
|
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9830 |
(windowGroup isNil or:[windowGroup isModal not]) ifTrue:[ |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9831 |
self destroy. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9832 |
]. |
197 | 9833 |
|
9834 |
"Modified: 5.9.1995 / 19:06:33 / claus" |
|
9835 |
! |
|
9836 |
||
2116 | 9837 |
preOpen |
9838 |
||
9839 |
"Created: / 4.2.2000 / 00:10:48 / cg" |
|
9840 |
! |
|
9841 |
||
197 | 9842 |
realize |
9843 |
"if any inputFields where added, activate the first one" |
|
9844 |
||
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9845 |
verticalPanel notNil ifTrue:[ |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9846 |
verticalPanel extent:verticalPanel preferredExtent. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9847 |
preferredExtent := nil. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9848 |
self extent:(self preferredExtent). |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9849 |
]. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9850 |
|
1877
a46bf520f9c6
realize first, then assign focus
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9851 |
super realize. |
3467 | 9852 |
|
9853 |
buttonPanel notNil ifTrue:[ |
|
4384
cd3a12b6fbf1
comment/format in: #verticalPanel
Claus Gittinger <cg@exept.de>
parents:
4380
diff
changeset
|
9854 |
buttonPanel raise. |
3467 | 9855 |
buttonPanel subViews do:[:eachButton | |
9856 |
eachButton canTab:true. |
|
9857 |
] |
|
9858 |
]. |
|
9859 |
||
197 | 9860 |
inputFieldGroup notNil ifTrue:[ |
1646 | 9861 |
inputFieldGroup activateFirstIfNoCurrent |
197 | 9862 |
]. |
1646 | 9863 |
|
4384
cd3a12b6fbf1
comment/format in: #verticalPanel
Claus Gittinger <cg@exept.de>
parents:
4380
diff
changeset
|
9864 |
"Modified: / 28-02-2012 / 15:54:10 / cg" |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9865 |
! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9866 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9867 |
resize |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9868 |
needResize ifTrue:[ |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9869 |
"/ verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9870 |
"/ verticalPanel extent:verticalPanel preferredExtent. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9871 |
"/ preferredExtent := nil. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9872 |
"/ self extent:(self preferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9873 |
"/ ]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9874 |
needResize := false. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9875 |
super resize |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9876 |
] |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9877 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9878 |
"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
|
9879 |
"Modified: 27.1.1996 / 18:25:40 / cg" |
197 | 9880 |
! ! |
9881 |
||
120 | 9882 |
!DialogBox methodsFor:'queries'! |
118 | 9883 |
|
121 | 9884 |
accepted |
128 | 9885 |
"after the box has closed: |
9886 |
return true if accepted, false if canceled" |
|
125 | 9887 |
|
128 | 9888 |
^ acceptValue value |
121 | 9889 |
! |
9890 |
||
2116 | 9891 |
interfaceSpecFor:aSelector |
9892 |
"return an interface spec. |
|
9893 |
Notice - Dialog should be moved under AppModel so this becomes obsolete." |
|
9894 |
||
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9895 |
^ UISpecification from:(self specificationFor:aSelector) |
2116 | 9896 |
! |
9897 |
||
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9898 |
maxPreferredWidthOfAddedComponents |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9899 |
"helper for computing my preferred extent. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9900 |
That is the max component width" |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9901 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9902 |
^ (addedComponents ? #()) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9903 |
inject:0 |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9904 |
into:[:max :element | |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9905 |
|eExt prefWidth scale rel relX| |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9906 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9907 |
prefWidth := element preferredWidth. |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9908 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9909 |
"/ special (for your convenience) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9910 |
"/ 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
|
9911 |
"/ 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
|
9912 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9913 |
(rel := element relativeExtent) notNil ifTrue:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9914 |
relX := rel x. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9915 |
(relX isNil or:[relX isInteger]) ifFalse:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9916 |
prefWidth := (prefWidth * (1 / relX)) rounded |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9917 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9918 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9919 |
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
|
9920 |
max max:(eExt + element leftInset + element rightInset)]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9921 |
! |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9922 |
|
120 | 9923 |
positionOffset |
9924 |
"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
|
9925 |
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
|
9926 |
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
|
9927 |
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
|
9928 |
use my superclasses offset." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9929 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9930 |
|idx butt buttons| |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9931 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9932 |
buttonPanel notNil ifTrue:[ |
2332 | 9933 |
buttons := buttonPanel subViews. |
9934 |
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
|
9935 |
idx := buttons findFirst:[:b | b isDefault]. |
2332 | 9936 |
idx ~~ 0 ifTrue:[ |
9937 |
butt := buttons at:idx. |
|
9938 |
||
9939 |
"get our size (preferredExtent) and compute |
|
9940 |
origin and extent of buttonPanel and okButton. |
|
9941 |
This is normally done on view realization." |
|
9942 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9943 |
needResize ifTrue:[ self resize ]. |
2332 | 9944 |
buttonPanel |
9945 |
pixelOrigin:buttonPanel computeOrigin |
|
9946 |
extent:buttonPanel computeExtent. |
|
9947 |
buttonPanel setChildPositionsIfChanged. |
|
2732
9a96cfc123c0
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
2718
diff
changeset
|
9948 |
^ (butt originRelativeTo:self) + (butt extent // 2). |
2332 | 9949 |
] |
9950 |
] |
|
118 | 9951 |
]. |
913 | 9952 |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9953 |
^ super positionOffset |
912
310c4970e613
Fix #positionOffset to show 'senders' box with cursor on ok-button.
Stefan Vogel <sv@exept.de>
parents:
884
diff
changeset
|
9954 |
|
913 | 9955 |
"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
|
9956 |
"Modified: 16.1.1997 / 22:00:23 / cg" |
118 | 9957 |
! |
9958 |
||
130 | 9959 |
preferredExtent |
132 | 9960 |
"return my preferred extent. |
9961 |
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
|
9962 |
whichever is larger, by the sum of the component's heights." |
118 | 9963 |
|
120 | 9964 |
|w h p| |
118 | 9965 |
|
3756
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9966 |
"/ If I have an explicit preferredExtent.. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9967 |
explicitExtent notNil ifTrue:[ |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9968 |
^ explicitExtent |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9969 |
]. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9970 |
|
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9971 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9972 |
preferredExtent notNil ifTrue:[ |
2801 | 9973 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9974 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9975 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9976 |
h := yPosition + ViewSpacing. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9977 |
verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9978 |
"/ 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
|
9979 |
"/ 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
|
9980 |
"/ do this now. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9981 |
verticalPanel extent:(verticalPanel computePreferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9982 |
h := h + verticalPanel height. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9983 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9984 |
|
120 | 9985 |
addedComponents notNil ifTrue:[ |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9986 |
w := self maxPreferredWidthOfAddedComponents. |
120 | 9987 |
] ifFalse:[ |
3618 | 9988 |
w := super preferredExtent x. |
120 | 9989 |
]. |
132 | 9990 |
w := w max:width. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9991 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9992 |
subViews size ~~ 0 ifTrue:[ |
2801 | 9993 |
p := buttonPanel preferredExtent. |
9994 |
w := w max:p x. |
|
9995 |
h := h |
|
9996 |
+ p y |
|
9997 |
+ ViewSpacing. |
|
120 | 9998 |
]. |
118 | 9999 |
|
120 | 10000 |
"/ okButton isNil ifTrue:[ |
130 | 10001 |
"/ ^ super preferredExtent |
120 | 10002 |
"/ ]. |
130 | 10003 |
"/ p := buttonPanel preferredExtent. |
120 | 10004 |
"/ w := p x. |
10005 |
"/ h := ViewSpacing |
|
10006 |
"/ + p y |
|
10007 |
"/ + ViewSpacing. |
|
10008 |
"/ |
|
10009 |
^ w @ h |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
10010 |
|
797 | 10011 |
"Modified: 19.7.1996 / 20:43:52 / cg" |
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
10012 |
! |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
10013 |
|
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
10014 |
specificationFor:aKey |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
10015 |
"return an interface specs literal encoding. |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
10016 |
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
|
10017 |
|
2568 | 10018 |
^ ApplicationModel |
10019 |
specificationFor:aKey |
|
10020 |
application:self |
|
10021 |
onDevice:(self graphicsDevice) |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
10022 |
! ! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
10023 |
|
197 | 10024 |
!DialogBox methodsFor:'user actions'! |
76 | 10025 |
|
197 | 10026 |
abortPressed |
10027 |
"sent by the cancel button; user pressed abort button |
|
10028 |
- hide myself and evaluate okAction" |
|
121 | 10029 |
|
197 | 10030 |
abortButton turnOffWithoutRedraw. |
10031 |
acceptValue value:false. |
|
121 | 10032 |
|
197 | 10033 |
"/ actually, only hides if I have been opened modal |
10034 |
self hideAndEvaluate:abortAction |
|
121 | 10035 |
! |
10036 |
||
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
10037 |
actionArgument |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
10038 |
^ nil |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
10039 |
! |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
10040 |
|
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10041 |
closeCancel |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10042 |
"closed via escape" |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10043 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10044 |
acceptValue value:false. |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10045 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10046 |
"/ actually, only hides if I have been opened modal |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10047 |
self hideAndEvaluate:abortAction |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10048 |
! |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10049 |
|
197 | 10050 |
doAccept |
10051 |
"let all components accept (i.e. update their model from the values), |
|
10052 |
then set my accept value to true. |
|
10053 |
This is confusing: this method was originally called #accept, |
|
10054 |
but renamed for compatibility with ST-80, where #accept returns the |
|
10055 |
accept-valueHolder (which looks like a bad name to me ...)." |
|
76 | 10056 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
10057 |
autoAccept ifTrue:[ |
1401 | 10058 |
addedComponents notNil ifTrue:[ |
10059 |
addedComponents do:[:aComponent | |
|
10060 |
(aComponent respondsTo:#accept) ifTrue:[ |
|
10061 |
aComponent accept |
|
10062 |
] |
|
10063 |
] |
|
10064 |
]. |
|
197 | 10065 |
]. |
10066 |
acceptValue value:true. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
10067 |
|
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
10068 |
"Modified: 4.3.1996 / 12:14:56 / cg" |
128 | 10069 |
! |
10070 |
||
197 | 10071 |
keyPress:aKey x:x y:y |
2700 | 10072 |
"return-key duplicates ok-function if acceptReturnAsOK is true" |
76 | 10073 |
|
4493 | 10074 |
<resource: #keyboard (#Return #Escape)> |
490 | 10075 |
|
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10076 |
|b| |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
10077 |
|
3809 | 10078 |
"/ oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has |
10079 |
"/ no one to inform about RETURN/ESCAPE. So the procesing here is still needed. |
|
10080 |
||
3808
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10081 |
(aKey == #Return) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10082 |
(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
|
10083 |
^ self okPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10084 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10085 |
(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
|
10086 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10087 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10088 |
(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
|
10089 |
b turnOnWithAction. b turnOffWithAction. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10090 |
^ self. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10091 |
] |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10092 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10093 |
|
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10094 |
(aKey == #Escape) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10095 |
(abortButton notNil) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10096 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10097 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10098 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
10099 |
|
197 | 10100 |
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
|
10101 |
|
490 | 10102 |
"Modified: 7.3.1996 / 13:15:09 / cg" |
76 | 10103 |
! |
10104 |
||
197 | 10105 |
lastFieldLeft |
10106 |
"if the dialog involves input fields, this is called |
|
10107 |
when the last field is left by Return-key or NextField-key" |
|
120 | 10108 |
|
197 | 10109 |
acceptOnLeave ifTrue:[ |
1401 | 10110 |
acceptReturnAsOK ifTrue:[ |
10111 |
focusToOKOnLeave ifTrue:[ |
|
10112 |
self focusOnOk. |
|
10113 |
^ self. |
|
10114 |
]. |
|
10115 |
self okPressed |
|
10116 |
] |
|
197 | 10117 |
]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10118 |
inputFieldGroup activateFirst |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
10119 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
10120 |
"Modified: 19.4.1996 / 17:09:02 / cg" |
76 | 10121 |
! |
10122 |
||
197 | 10123 |
okPressed |
10124 |
"sent by the okButton; user pressed ok-button |
|
10125 |
- make myself invisible and if an action was specified do it" |
|
128 | 10126 |
|
197 | 10127 |
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
|
10128 |
|
197 | 10129 |
self doAccept. |
10130 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10131 |
acceptCheck notNil ifTrue:[ |
302 | 10132 |
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
|
10133 |
]. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10134 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10135 |
hideOnAccept ifTrue:[ |
302 | 10136 |
"/ actually, only hides if I have been opened modal |
10137 |
self hideAndEvaluate:okAction. |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10138 |
] ifFalse:[ |
302 | 10139 |
okAction value |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
10140 |
] |
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
10141 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
10142 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
10143 |
openDialog |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
10144 |
self showAtPointer. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
10145 |
^ self accepted |
128 | 10146 |
! ! |
240 | 10147 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
10148 |
!DialogBox class methodsFor:'documentation'! |
240 | 10149 |
|
10150 |
version |
|
5028 | 10151 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.355 2014-05-17 12:38:43 cg Exp $' |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
10152 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
10153 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
10154 |
version_CVS |
5028 | 10155 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.355 2014-05-17 12:38:43 cg Exp $' |
240 | 10156 |
! ! |
2618 | 10157 |
|
4493 | 10158 |
|
498 | 10159 |
DialogBox initialize! |