author | Claus Gittinger <cg@exept.de> |
Wed, 02 Feb 2011 13:29:16 +0100 | |
changeset 4222 | 53a2a6433f59 |
parent 4220 | 9d4156203a02 |
child 4227 | 527b124369f3 |
permissions | -rw-r--r-- |
76 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
13 |
|
76 | 14 |
ModalBox subclass:#DialogBox |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
15 |
instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
16 |
acceptReturnAsOK yPosition leftIndent rightIndent addedComponents |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
17 |
inputFieldGroup acceptOnLeave acceptValue tabableElements |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
18 |
hideOnAccept acceptCheck needResize autoAccept focusToOKOnLeave |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
19 |
bindings namedComponents verticalPanel' |
2439 | 20 |
classVariableNames:'DefaultFocusToOKOnLeave AboutToOpenBoxNotificationSignal' |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
21 |
poolDictionaries:'' |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
22 |
category:'Views-DialogBoxes' |
76 | 23 |
! |
24 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
25 |
!DialogBox class methodsFor:'documentation'! |
76 | 26 |
|
197 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
76 | 39 |
! |
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
this class implements the common behavior of dialogboxes. |
|
44 |
||
647 | 45 |
DialogBox is also a superclass of many other boxes - see InfoBox, |
76 | 46 |
WarningBox, YesNoBox etc. for concrete examples. |
47 |
Most of them simply add buttons or other elements. |
|
48 |
||
121 | 49 |
For programmatically created boxes, instances support adding of components |
50 |
in a top-to-bottom fashion, and also keep track of added text-fields and, |
|
51 |
since they are most common, automatically create an EnterFieldGroup for |
|
52 |
them. |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
53 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
54 |
Caveat: |
3935 | 55 |
more adding support is required - especially for row-wise construction. |
56 |
The programmatic interface is best suited for row-wise |
|
57 |
arranged components; laying out elements in columns is a bit |
|
58 |
complicate - for complicated dialogs, it may be better to not use |
|
59 |
the automatic arrangement, but instead give explicit layouts to |
|
60 |
the components (in a subclass) or better use the UIPainter. |
|
122 | 61 |
|
600 | 62 |
Compatibility note: |
3935 | 63 |
For ST-80 compatibility, DialogBox is also accessable under |
64 |
the global named 'Dialog' (which is the name of an ST-80 class, |
|
65 |
providing a very similar protocol). |
|
66 |
This may lead to confusion, if DialogBox is recompiled - you have |
|
67 |
to manually assign Dialog again to refer to the new DialogBox class. |
|
68 |
In future versions of ST/X, DialogBox may be renamed to Dialog. |
|
600 | 69 |
|
183 | 70 |
Historic note: |
3935 | 71 |
originally, ST/X had separate classes for the various entry methods; |
72 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
73 |
ST-80 has all this defined in the common Dialog. |
|
74 |
Therefore, for compatibility, many ST/X methods defined here in Dialogs |
|
75 |
class protocol simply dispatch to some other boxes class method. |
|
76 |
In the future, those existing subclasses' functionality is going to |
|
77 |
be moved full into Dialog, and the subclasses will be replaced by dummy |
|
78 |
delegators. (They will be kept for backward compatibility, though). |
|
183 | 79 |
|
121 | 80 |
|
585 | 81 |
[instance variables:] |
76 | 82 |
|
3935 | 83 |
buttonPanel <PanelView> contains the button(s) |
84 |
||
85 |
okButton <Button> the ok-Button |
|
86 |
||
87 |
okAction <Block> the action to be performed when ok is pressed, |
|
88 |
or return is pressed. |
|
89 |
||
90 |
acceptReturnAsOK <Boolean> if true, pressing the return-key counts |
|
91 |
as if ok was pressed. Default is true. |
|
92 |
||
93 |
abortButton <Button> the cancel-Button |
|
94 |
||
95 |
abortAction <Block> the action to be performed when cancel is |
|
96 |
pressed. |
|
97 |
||
98 |
yPosisition <Integer> current y position when adding components |
|
99 |
||
100 |
leftIndent <Integer> left inset to use when adding components |
|
101 |
||
102 |
rightIndent <Integer> right inset to use when adding components |
|
103 |
||
104 |
addedComponents <Collection> programmatically added components |
|
105 |
||
106 |
inputFieldGroup <EnterFieldGroup> |
|
107 |
for added input fields |
|
108 |
||
109 |
acceptOnLeave <Boolean> if true (the default) and there are |
|
110 |
tabable inputFields, accept and close when |
|
111 |
the last field is left. If false, the ok |
|
112 |
button must be pressed to close the box. |
|
113 |
||
114 |
acceptedValue v(<Boolean>) valueHolder on a boolean |
|
115 |
after close: holds true if box was accepted |
|
116 |
(i.e. ok-Button was pressed), false if box was |
|
117 |
closed via cancel or window manager. |
|
118 |
||
119 |
autoAccept Boolean if true, pressing ok (or return) |
|
120 |
sends #accept to all subcomponents. |
|
121 |
I.e. all subfields update their models |
|
122 |
first. The default is true. |
|
123 |
||
124 |
variablePanel nil|VPanel an optional additional panel to be filled dynamically |
|
125 |
in an aboutToOpenNotification hook. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
126 |
|
100 | 127 |
For compatibility with ST-80, this class is also available under |
128 |
the global names DialogView and Dialog (see patches file). |
|
585 | 129 |
|
130 |
[author:] |
|
3935 | 131 |
Claus Gittinger |
593 | 132 |
|
133 |
[see also:] |
|
3935 | 134 |
Button CheckToggle Toggle |
135 |
EditField SelectionInListView FileSelectionList |
|
136 |
FramedBox Separator |
|
137 |
( introduction to view programming :html: programming/viewintro.html ) |
|
76 | 138 |
" |
139 |
! |
|
140 |
||
141 |
examples |
|
142 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
143 |
historically, DialogBox was used as an abstract class as a base for InfoBox, |
600 | 144 |
YesNoBox etc. |
145 |
However, the programmatic construction protocol (#addComponent:) |
|
146 |
now allows those classes to be easily replaced and future versions of |
|
147 |
ST/X may do this and make those subclasses obsolete. |
|
148 |
However, dummy stubs will remain to exist for backward compatibility |
|
149 |
(i.e. do not fear using YesNoBox, EnterBox etc.) |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
150 |
|
125 | 151 |
For most simple standard dialogs, there are ready to use |
152 |
methods in the class protocol. |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
153 |
|
125 | 154 |
For example: |
155 |
||
156 |
info & warnings: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
157 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
158 |
Dialog information:'hi there' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
159 |
[exEnd] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
160 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
161 |
Dialog warn:'oops' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
162 |
[exEnd] |
125 | 163 |
|
164 |
||
165 |
yes/no questions: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
166 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
167 |
(Dialog confirm:'is this simple ?') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
168 |
ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
169 |
Transcript showCR:'thats what I expected' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
170 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
171 |
Transcript showCR:'read more examples and documentation' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
172 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
173 |
[exEnd] |
125 | 174 |
|
175 |
||
176 |
yes/no question with cancel option: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
177 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
178 |
|answer| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
179 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
180 |
answer := Dialog confirmWithCancel:'is this simple ?'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
181 |
answer isNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
182 |
Transcript showCR:'no easy decision' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
183 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
184 |
answer ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
185 |
Transcript showCR:'thats what I expected' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
186 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
187 |
Transcript showCR:'read more examples and documentation' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
188 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
189 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
190 |
[exEnd] |
125 | 191 |
|
192 |
||
193 |
asking for a string: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
194 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
195 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
196 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
197 |
s := Dialog request:'enter your name, please:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
198 |
s notEmpty ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
199 |
Transcript showCR:'you entered: ' , s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
200 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
201 |
[exEnd] |
125 | 202 |
|
203 |
||
204 |
asking for a string with given default: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
205 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
206 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
207 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
208 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
209 |
request:'enter your name, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
210 |
initialAnswer:(OperatingSystem getLoginName). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
211 |
s notEmpty ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
212 |
Transcript showCR:'you entered: ' , s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
213 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
214 |
[exEnd] |
125 | 215 |
|
216 |
||
217 |
asking for a filename: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
218 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
219 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
220 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
221 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
222 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
223 |
default:''. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
224 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
225 |
[exEnd] |
125 | 226 |
|
227 |
||
1030 | 228 |
with a namefiler pattern: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
229 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
230 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
231 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
232 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
233 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
234 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
235 |
pattern:'*.rc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
236 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
237 |
[exEnd] |
1030 | 238 |
|
239 |
||
240 |
another namefiler pattern: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
241 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
242 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
243 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
244 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
245 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
246 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
247 |
pattern:'*.rc;*.st;*.h'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
248 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
249 |
[exEnd] |
1030 | 250 |
|
251 |
||
125 | 252 |
with changed button label and pattern: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
253 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
254 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
255 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
256 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
257 |
requestFileName:'select a file, please:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
258 |
default:'' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
259 |
ok:'show' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
260 |
abort:'cancel' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
261 |
pattern:'*.rc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
262 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
263 |
[exEnd] |
125 | 264 |
|
302 | 265 |
|
266 |
asking for a password: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
267 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
268 |
|s| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
269 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
270 |
s := Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
271 |
requestPassword:'enter your secret, please:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
272 |
Transcript show:'you entered: '; showCR:s. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
273 |
[exEnd] |
302 | 274 |
|
645 | 275 |
multiple choice dialogs: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
276 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
277 |
Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
278 |
choose:'choose any' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
279 |
fromList:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
280 |
values:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
281 |
buttons:#('one' 'two' 'three' 'four') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
282 |
values:#(1 2 3 4) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
283 |
lines:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
284 |
cancel:nil |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
285 |
[exEnd] |
645 | 286 |
|
287 |
multiple choice dialog, with list & buttons: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
288 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
289 |
Transcript showCR:( |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
290 |
Dialog |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
291 |
choose:'choose example' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
292 |
fromList:#('one' 'two' 'three' 'four') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
293 |
values:#(1 2 3 4) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
294 |
buttons:#('five' 'six' 'seven') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
295 |
values:#(5 6 7) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
296 |
lines:4 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
297 |
cancel:[Transcript flash. #aborted] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
298 |
) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
299 |
[exEnd] |
645 | 300 |
|
301 |
You can (and often have to) construct custom dialogs programmatically, |
|
302 |
from individual components. As shown in the following examples: |
|
91 | 303 |
|
121 | 304 |
basic (unusable) example: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
305 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
306 |
DialogBox new open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
307 |
[exEnd] |
76 | 308 |
|
121 | 309 |
still unusable - only an ok-button: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
310 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
311 |
DialogBox new addOkButton; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
312 |
[exEnd] |
121 | 313 |
|
314 |
both ok- and abortButtons: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
315 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
316 |
DialogBox new addAbortButton; addOkButton; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
317 |
[exEnd] |
121 | 318 |
|
122 | 319 |
with different ok-label: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
320 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
321 |
DialogBox new addAbortButton; addOkButtonLabelled:'yeah'; open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
322 |
[exEnd] |
122 | 323 |
|
645 | 324 |
adding a (centered by default) textlabel gives an infoBox: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
325 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
326 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
327 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
328 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
329 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
330 |
[exEnd] |
121 | 331 |
|
332 |
a textlabel with abort- and okButton gives a yesNoBox: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
333 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
334 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
335 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
336 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
337 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
338 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
339 |
[exEnd] |
121 | 340 |
|
341 |
the same, adjusting the labels contents to the left: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
342 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
343 |
|box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
344 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
345 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
346 |
(box addTextLabel:'hello') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
347 |
box addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
348 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
349 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
350 |
[exEnd] |
121 | 351 |
|
122 | 352 |
with modified buttons: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
353 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
354 |
|box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
355 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
356 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
357 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
358 |
box addAbortButtonLabelled:'not really'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
359 |
(box addOkButtonLabelled:'yes, absolutely') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
360 |
activeBackgroundColor:Color red. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
361 |
box open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
362 |
[exEnd] |
122 | 363 |
|
364 |
||
645 | 365 |
mswindows style (different up/down bitmaps in buttons): |
366 |
((try tabbing ...) |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
367 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
368 |
|b box| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
369 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
370 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
371 |
(box addTextLabel:'are you certain ?') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
372 |
b := Button new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
373 |
b activeLogo:(Image fromFile:'cancel_down.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
374 |
b passiveLogo:(Image fromFile:'cancel_up.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
375 |
b focusLogo:(Image fromFile:'cancel_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
376 |
b beImageButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
377 |
box addAbortButton:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
378 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
379 |
b := Button new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
380 |
b activeLogo:(Image fromFile:'ok_down.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
381 |
b passiveLogo:(Image fromFile:'ok_up.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
382 |
b focusLogo:(Image fromFile:'ok_focus.bmp' inPackage:'stx:goodies/bitmaps/winImages'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
383 |
b beImageButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
384 |
box addOkButton:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
385 |
box open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
386 |
[exEnd] |
162 | 387 |
|
388 |
||
121 | 389 |
two textlabels: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
390 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
391 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
392 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
393 |
addTextLabel:'world'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
394 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
395 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
396 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
397 |
[exEnd] |
118 | 398 |
|
121 | 399 |
fixing the dialogs size (suppres it calculating its size from the |
130 | 400 |
preferredExtents of its components): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
401 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
402 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
403 |
label:'a simple dialog'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
404 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
405 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
406 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
407 |
extent:200@200; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
408 |
sizeFixed:true; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
409 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
410 |
[exEnd] |
118 | 411 |
|
121 | 412 |
asking the box if it was closed via ok: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
413 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
414 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
415 |
label:'a simple dialog'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
416 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
417 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
418 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
419 |
extent:200@200; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
420 |
sizeFixed:true; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
421 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
422 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
423 |
Transcript showCR:'yes' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
424 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
425 |
Transcript showCR:'no' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
426 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
427 |
[exEnd] |
118 | 428 |
|
121 | 429 |
textLabels are not limited to strings (although, the name which is |
430 |
used for ST-80 compatibility, suggests it): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
431 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
432 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
433 |
addTextLabel:(Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages'); |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
434 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
435 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
436 |
[exEnd] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
437 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
438 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
439 |
DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
440 |
addTextLabel:'hello'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
441 |
addTextLabel:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
442 |
magnifiedTo:200@150); |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
443 |
addTextLabel:'world'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
444 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
445 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
446 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
447 |
[exEnd] |
120 | 448 |
|
121 | 449 |
adding an input field (on a string model): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
450 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
451 |
|stringModel| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
452 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
453 |
stringModel := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
454 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
455 |
addTextLabel:'Please enter a string:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
456 |
addInputFieldOn:stringModel; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
457 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
458 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
459 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
460 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
461 |
Transcript showCR:'entered: ', stringModel value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
462 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
463 |
[exEnd] |
120 | 464 |
|
465 |
||
121 | 466 |
multiple input fields (notice, that the dialog connects the fields |
467 |
in a group, so stepping is allowed via Cursor and Return keys): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
468 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
469 |
|firstName lastName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
470 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
471 |
firstName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
472 |
lastName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
473 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
474 |
addTextLabel:'Please enter your name:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
475 |
addInputFieldOn:firstName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
476 |
addVerticalSpace; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
477 |
addInputFieldOn:lastName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
478 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
479 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
480 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
481 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
482 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
483 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
484 |
[exEnd] |
121 | 485 |
|
486 |
||
487 |
of course, the model may contain a value initially: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
488 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
489 |
|firstName lastName p line i name| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
490 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
491 |
firstName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
492 |
lastName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
493 |
p := PipeStream readingFrom:'finger ' , OperatingSystem getLoginName. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
494 |
p notNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
495 |
line := p nextLine. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
496 |
(i := line findString:'Name:') ~~ 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
497 |
name := line copyFrom:(i + 'Name:' size). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
498 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
499 |
(i := line findString:'real life:') == 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
500 |
line := p nextLine. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
501 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
502 |
(i := line findString:'real life:') ~~ 0 ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
503 |
name := line copyFrom:(i + 'real life:' size). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
504 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
505 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
506 |
name notNil ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
507 |
firstName value: name asCollectionOfWords first. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
508 |
lastName value: name asCollectionOfWords last. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
509 |
Transcript showCR:'initially ' , firstName value , ' ' , lastName value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
510 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
511 |
p close. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
512 |
]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
513 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
514 |
(DialogBox new |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
515 |
addTextLabel:'Please enter your name:'; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
516 |
addInputFieldOn:firstName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
517 |
addVerticalSpace; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
518 |
addInputFieldOn:lastName; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
519 |
addAbortButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
520 |
addOkButton; |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
521 |
open |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
522 |
) accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
523 |
Transcript showCR:'entered: ', firstName value , ' ' , lastName value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
524 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
525 |
[exEnd] |
121 | 526 |
|
120 | 527 |
|
302 | 528 |
validated password entry: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
529 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
530 |
|box firstEntry secondEntry| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
531 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
532 |
firstEntry := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
533 |
secondEntry := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
534 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
535 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
536 |
(box addTextLabel:'Please enter your secret:') adjust:#left. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
537 |
(box addInputFieldOn:firstEntry) passwordCharacter:$*. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
538 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
539 |
(box addInputFieldOn:secondEntry) passwordCharacter:$*. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
540 |
box addAbortButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
541 |
box addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
542 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
543 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
544 |
firstEntry value ~= secondEntry value ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
545 |
Transcript showCR:'wrong input - try again' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
546 |
] ifFalse:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
547 |
Transcript showCR:'entered: ', firstEntry value |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
548 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
549 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
550 |
[exEnd] |
593 | 551 |
|
552 |
input fields with a label: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
553 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
554 |
|box firstNameHolder middleNameHolder lastNameHolder| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
555 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
556 |
firstNameHolder := 'John' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
557 |
middleNameHolder := 'F' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
558 |
lastNameHolder := 'Peters' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
559 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
560 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
561 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
562 |
addLabelledInputField:'first name:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
563 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
564 |
on:firstNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
565 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
566 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
567 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
568 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
569 |
addLabelledInputField:'middle initial:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
570 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
571 |
on:middleNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
572 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
573 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
574 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
575 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
576 |
addLabelledInputField:'last name:' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
577 |
adjust:#right |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
578 |
on:lastNameHolder |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
579 |
tabable:true |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
580 |
separateAtX:0.4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
581 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
582 |
box addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
583 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
584 |
[exEnd] |
593 | 585 |
|
586 |
||
587 |
constructing a dialog from other elements: |
|
121 | 588 |
adding a fileSelectionList: |
589 |
(since the dialog adds the component with its preferred extent, |
|
590 |
ignoring the 300-height, this looks ugly ... |
|
591 |
... especially when resized vertically) |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
592 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
593 |
|top l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
594 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
595 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
596 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
597 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
598 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
599 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
600 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
601 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
602 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
603 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
604 |
scr extent:(1.0 @ 300). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
605 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
606 |
top addComponent:scr. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
607 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
608 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
609 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
610 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
611 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
612 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
613 |
[exEnd] |
121 | 614 |
|
615 |
same, looks better, since the height is made larger (not using |
|
616 |
fileLists preferredExtent): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
617 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
618 |
|top l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
619 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
620 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
621 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
622 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
623 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
624 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
625 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
626 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
627 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
628 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
629 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
630 |
top addComponent:scr withExtent:300@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
631 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
632 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
633 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
634 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
635 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
636 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
637 |
[exEnd] |
121 | 638 |
|
639 |
||
640 |
again, setting the boxes initial size and fixing it |
|
130 | 641 |
(let it ignore the components' preferredExtent): |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
642 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
643 |
|top fixFrame l scr fileName| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
644 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
645 |
fileName := '' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
646 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
647 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
648 |
top extent:300@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
649 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
650 |
fixFrame := View new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
651 |
fixFrame extent:(1.0 @ 300). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
652 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
653 |
l := FileSelectionList new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
654 |
l useIndex:false. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
655 |
l doubleClickAction:[:name | top okPressed]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
656 |
l action:[:name | fileName value:name]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
657 |
scr := ScrollableView forView:l. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
658 |
scr origin:0.0@0.0 corner:1.0@1.0. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
659 |
fixFrame add:scr. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
660 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
661 |
top addComponent:fixFrame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
662 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
663 |
top openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
664 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
665 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
666 |
Transcript show:'fileName: '; showCR:fileName value storeString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
667 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
668 |
[exEnd] |
118 | 669 |
|
670 |
||
671 |
adding a panel with checkBoxes: |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
672 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
673 |
|top panel b value1 value2 value3 value4| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
674 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
675 |
value1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
676 |
value2 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
677 |
value3 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
678 |
value4 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
679 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
680 |
top := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
681 |
top extent:200@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
682 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
683 |
panel := VerticalPanelView new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
684 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
685 |
b := CheckBox on:value1. b label:'check1'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
686 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
687 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
688 |
b := CheckBox on:value2. b label:'check2'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
689 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
690 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
691 |
b := CheckBox on:value3. b label:'check3'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
692 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
693 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
694 |
b := CheckBox on:value4. b label:'check4'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
695 |
panel addSubView:b. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
696 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
697 |
top addComponent:panel. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
698 |
top addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
699 |
top open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
700 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
701 |
top accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
702 |
Transcript show:'value1: '; showCR:value1 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
703 |
Transcript show:'value2: '; showCR:value2 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
704 |
Transcript show:'value3: '; showCR:value3 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
705 |
Transcript show:'value4: '; showCR:value4 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
706 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
707 |
[exEnd] |
118 | 708 |
|
120 | 709 |
same, using a more convenient interface: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
710 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
711 |
|box value1 value2 value3 value4| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
712 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
713 |
value1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
714 |
value2 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
715 |
value3 := false asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
716 |
value4 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
717 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
718 |
box := DialogBox new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
719 |
box extent:200@300. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
720 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
721 |
box addCheckBox:'check1' on:value1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
722 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
723 |
box addCheckBox:'check2' on:value2. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
724 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
725 |
box addCheckBox:'check3' on:value3. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
726 |
box addVerticalSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
727 |
box addCheckBox:'check4' on:value4. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
728 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
729 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
730 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
731 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
732 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
733 |
Transcript show:'value1: '; showCR:value1 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
734 |
Transcript show:'value2: '; showCR:value2 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
735 |
Transcript show:'value3: '; showCR:value3 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
736 |
Transcript show:'value4: '; showCR:value4 value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
737 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
738 |
[exEnd] |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
739 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
740 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
741 |
same, using an even better interface: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
742 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
743 |
|box values labels| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
744 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
745 |
values := #(true false false true) collect:[:val | val asValue]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
746 |
labels := #('check1' 'check2' 'check3' 'check4'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
747 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
748 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
749 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
750 |
box |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
751 |
addColumn:(1 to:labels size) |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
752 |
fromX:0.0 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
753 |
toX:1.0 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
754 |
collect:[:index | CheckBox label:(labels at:index) model:(values at:index)] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
755 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
756 |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
757 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
758 |
box open. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
759 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
760 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
761 |
values with:labels do:[:val :lbl | |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
762 |
Transcript show:(lbl , ': '); showCR:val value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
763 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
764 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
765 |
[exEnd] |
126 | 766 |
|
767 |
||
164 | 768 |
adding two panels in a frame: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
769 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
770 |
|box frame vPanel1 vPanel2 m1 m2 m3 m4 chk ef| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
771 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
772 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
773 |
box label:'example'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
774 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
775 |
frame := FramedBox label:'frame'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
776 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
777 |
vPanel1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
778 |
vPanel1 horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
779 |
vPanel1 verticalLayout:#spreadSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
780 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
781 |
vPanel2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
782 |
vPanel2 horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
783 |
vPanel2 verticalLayout:#spreadSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
784 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
785 |
m1 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
786 |
m2 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
787 |
m3 := true asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
788 |
m4 := 'hello' asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
789 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
790 |
vPanel1 add:(Label label:'check1'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
791 |
vPanel1 add:(Label label:'m2'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
792 |
vPanel1 add:(Label label:'m3'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
793 |
vPanel1 add:(Label label:'enter'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
794 |
vPanel1 add:(Label label:'lbl1'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
795 |
vPanel1 add:(Label label:'lbl2'). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
796 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
797 |
vPanel2 add:(chk := CheckToggle on:m1). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
798 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
799 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
800 |
vPanel2 add:(chk := CheckToggle on:m2). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
801 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
802 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
803 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
804 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
805 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
806 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
807 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
808 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
809 |
vPanel2 add:(chk := CheckToggle on:m3). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
810 |
box makeTabable:chk. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
811 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
812 |
vPanel2 add:(ef := EditField on:m4). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
813 |
ef immediateAccept:true. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
814 |
box makeTabable:ef. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
815 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
816 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
817 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
818 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
819 |
box openModal. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
820 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
821 |
Transcript showCR:'accepted with:'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
822 |
Transcript showCR:' m1: ' , m1 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
823 |
Transcript showCR:' m2: ' , m2 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
824 |
Transcript showCR:' m3: ' , m3 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
825 |
Transcript showCR:' m4: ' , m4 value printString. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
826 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
827 |
[exEnd] |
593 | 828 |
|
829 |
||
830 |
||
831 |
a full example (combined settings dialog - as in launcher): |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
832 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
833 |
|box warnSTX allowUnderscore immutableArrays logDoits |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
834 |
listOfLanguages listOfStyles styleNames |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
835 |
frame panel c resourceDir dir | |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
836 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
837 |
warnSTX := Compiler warnSTXSpecials asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
838 |
allowUnderscore := Compiler allowUnderscoreInIdentifier asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
839 |
immutableArrays := Compiler arraysAreImmutable asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
840 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
841 |
logDoits := Smalltalk logDoits asValue. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
842 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
843 |
listOfLanguages := SelectionInList with:#('english' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
844 |
'french' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
845 |
'german' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
846 |
'italian' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
847 |
'spanish' |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
848 |
). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
849 |
listOfLanguages selection:(Language asString). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
850 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
851 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
852 |
resourceDir := Smalltalk getSystemFileName:'resources'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
853 |
dir := FileDirectory directoryNamed:resourceDir. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
854 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
855 |
styleNames := dir select:[:aFileName | aFileName endsWith:'.style']. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
856 |
styleNames := styleNames collect:[:aFileName | aFileName copyWithoutLast:6]. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
857 |
listOfStyles := SelectionInList with:styleNames sort. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
858 |
listOfStyles selection:(View defaultStyle asString). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
859 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
860 |
box := Dialog new. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
861 |
box label:'Settings'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
862 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
863 |
frame := FramedBox label:'Compiler'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
864 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
865 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
866 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
867 |
panel add:((CheckBox on:warnSTX) label:'warn about ST/X language extensions'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
868 |
panel add:((CheckBox on:allowUnderscore) label:'allow underscore in identifiers'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
869 |
panel add:((CheckBox on:immutableArrays) label:'literal arrays are immutable'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
870 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
871 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
872 |
frame := FramedBox label:'Misc'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
873 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
874 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
875 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
876 |
panel add:((CheckBox on:logDoits) label:'log doIts in changes file'; resize). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
877 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
878 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
879 |
frame := FramedBox label:'Language'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
880 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
881 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
882 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
883 |
panel add:((PopUpList on:listOfLanguages) width:0.5). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
884 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
885 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
886 |
frame := FramedBox label:'Style'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
887 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
888 |
panel horizontalLayout:#leftSpace. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
889 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
890 |
panel add:((PopUpList on:listOfStyles) width:0.5). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
891 |
box addComponent:frame. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
892 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
893 |
box addAbortButton; addOkButton. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
894 |
box showAtPointer. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
895 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
896 |
box accepted ifTrue:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
897 |
Transcript topView withCursor:Cursor wait do:[ |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
898 |
Compiler warnSTXSpecials:warnSTX value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
899 |
Compiler allowUnderscoreInIdentifier:allowUnderscore value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
900 |
Compiler arraysAreImmutable:immutableArrays value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
901 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
902 |
Smalltalk logDoits:logDoits value. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
903 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
904 |
Transcript showCR:'change language to ' , listOfLanguages selection , ' ...'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
905 |
Smalltalk at:#Language put:listOfLanguages selection asSymbol. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
906 |
Smalltalk changed:#Language. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
907 |
ResourcePack flushCachedResourcePacks. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
908 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
909 |
Transcript showCR:'change style to ' , listOfStyles selection , ' ...'. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
910 |
View defaultStyle:listOfStyles selection asSymbol. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
911 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
912 |
] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
913 |
[exEnd] |
625 | 914 |
an example from Hopkins/Horan: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
915 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
916 |
|aText index| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
917 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
918 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
919 |
index := aText findString:'Smalltalk/X' startingAt:1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
920 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
921 |
to:'Smalltalk/X' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
922 |
with:#bold. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
923 |
index := aText findString:'Introduction' startingAt:index. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
924 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
925 |
to:'Introduction' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
926 |
with:#italic. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
927 |
Dialog warn:aText |
625 | 928 |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
929 |
[exEnd] |
625 | 930 |
the same, with colors: |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
931 |
[exBegin] |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
932 |
|aText index| |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
933 |
|
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
934 |
aText := 'Smalltalk/X: An Introduction to Application Development' asText. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
935 |
index := aText findString:'Smalltalk/X' startingAt:1. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
936 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
937 |
to:'Smalltalk/X' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
938 |
with:(Array with:#bold with:#underline with:(#color->Color red)). |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
939 |
index := aText findString:'Introduction' startingAt:index. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
940 |
aText emphasizeFrom:index |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
941 |
to:'Introduction' size + index - 1 |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
942 |
with:#italic. |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
943 |
Dialog warn:aText |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
944 |
[exEnd] |
76 | 945 |
" |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
946 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
947 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
948 |
inputFocus |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
949 |
" |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
950 |
a DialogBox with multiple input fields can be configured on how it |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
951 |
shall behave if the RETURN key is pressed. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
952 |
|
600 | 953 |
The default is to shift the focus to the ok-button - thus, another return |
954 |
has to be entered (as confirmation) to close & accept the box. |
|
955 |
||
956 |
This can be changed to force an automatic OK with: |
|
1401 | 957 |
aBox focusToOKOnLeave:false |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
958 |
|
600 | 959 |
Then, leaving the last field with return, automatically accepts the box, |
960 |
as if ok was pressed. (useful for simple - single entry dialogs). |
|
961 |
All simple dialogs (like 'enter a searchString') behave this way. |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
962 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
963 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
964 |
With: |
1401 | 965 |
aBox acceptReturnAsOK:false |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
966 |
|
600 | 967 |
any focusShift or automatic OK is turned off, and the input group |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
968 |
switches its focus back to the topMost field. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
969 |
The default for this is true. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
970 |
(useful, if you want an explicit ok from the user, or need all fields |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
971 |
to be handled somehow). |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
972 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
973 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
974 |
Simply leaving the group with a cursor movement may also be either |
600 | 975 |
interpreted as a return (the default), or again wrap back to the top |
976 |
of the group. |
|
977 |
||
978 |
With: |
|
1401 | 979 |
aBox acceptOnLeave:false |
600 | 980 |
this is turned off, so that with cursor-down, the focus is moved back |
981 |
to the first entry field. The default is true. |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
982 |
" |
76 | 983 |
! ! |
984 |
||
2768 | 985 |
!DialogBox class methodsFor:'Compatibility-VW'! |
1371 | 986 |
|
987 |
choose:aString fromList:list values:listValues lines:maxLines cancel:cancelBlock for:aView |
|
988 |
"launch a Dialog showing the message and list. |
|
989 |
The user can select an item and click ok; in this case, the corresponding value |
|
990 |
from listValues is returned (doubleclick works as well). |
|
991 |
If cancel is pressed, the value of cancelBlock is returned. |
|
992 |
Pressing ok without a selection is treated like cancel. |
|
993 |
This is a new VW2.5 interface - passing an addtional argument. |
|
994 |
In ST/X, this is not needed and ignored" |
|
995 |
||
996 |
^ self |
|
1401 | 997 |
choose:aString |
998 |
fromList:list |
|
999 |
values:listValues |
|
1000 |
lines:maxLines |
|
1001 |
cancel:cancelBlock |
|
1371 | 1002 |
|
1003 |
" |
|
1004 |
Transcript showCR:( |
|
1401 | 1005 |
Dialog |
1006 |
choose:'choose any' |
|
1007 |
fromList:#('one' 'two' 'three' 'four') |
|
1008 |
values:#(1 2 3 4) |
|
1009 |
lines:4 |
|
1010 |
cancel:nil |
|
1371 | 1011 |
) |
1012 |
||
1013 |
Transcript showCR:( |
|
1401 | 1014 |
Dialog |
1015 |
choose:'choose example' |
|
1016 |
fromList:#('one' 'two' 'three' 'four') |
|
1017 |
values:#(1 2 3 4) |
|
1018 |
lines:4 |
|
1019 |
cancel:[Transcript flash. #aborted] |
|
1371 | 1020 |
) |
1021 |
" |
|
1022 |
||
1023 |
"Created: / 1.11.1997 / 13:21:32 / cg" |
|
1024 |
"Modified: / 1.11.1997 / 13:21:54 / cg" |
|
1025 |
! |
|
1102 | 1026 |
|
1027 |
confirm:aMessageString for:ignoredView |
|
1371 | 1028 |
"VW compatibility - confirm using the same viewStyle as in the view |
1102 | 1029 |
argument; not supported in ST/X (who mixes styles ?)" |
1030 |
||
3456 | 1031 |
^ self |
1032 |
confirm:aMessageString |
|
1033 |
title:nil |
|
1034 |
yesLabel:nil noLabel:nil |
|
1035 |
initialAnswer:true. |
|
1036 |
||
1037 |
"Created: / 06-03-1997 / 15:45:54 / cg" |
|
1038 |
"Modified: / 02-03-2007 / 15:25:15 / cg" |
|
1371 | 1039 |
! |
1040 |
||
1041 |
request:aString for:aView |
|
1042 |
"launch a Dialog, which allows user to enter something. |
|
1043 |
Return the entered string (may be empty string) |
|
1044 |
or the empty string (if cancel was pressed), |
|
1045 |
This is a new VW2.5 interface - passing an addtional argument. |
|
1046 |
In ST/X, this is not needed and ignored" |
|
1047 |
||
1048 |
^ self |
|
1401 | 1049 |
request:aString |
1371 | 1050 |
|
1051 |
"Created: / 31.10.1997 / 03:26:32 / cg" |
|
1052 |
"Modified: / 31.10.1997 / 11:53:50 / cg" |
|
1053 |
! |
|
1054 |
||
1055 |
request:aString initialAnswer:initial for:aView |
|
1056 |
"launch a Dialog, which allows user to enter something. |
|
1057 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
1058 |
This is a new VW2.5 interface - passing an addtional argument. |
|
1059 |
In ST/X, this is not needed and ignored" |
|
1060 |
||
1061 |
^ self |
|
1401 | 1062 |
request:aString |
1063 |
initialAnswer:initial |
|
1371 | 1064 |
|
1065 |
"Modified: / 29.5.1996 / 14:30:05 / cg" |
|
1066 |
"Created: / 1.11.1997 / 13:18:29 / cg" |
|
1067 |
! |
|
1068 |
||
1069 |
requestFileName:title default:default version:versionSym ifFail:failBlock for:aViewOrNil |
|
1070 |
"new VW2.5 interface - passing an addtional argument. |
|
1071 |
In ST/X, this is not needed and ignored" |
|
1072 |
||
1073 |
^ self |
|
1401 | 1074 |
requestFileName:title default:default version:versionSym ifFail:failBlock |
1371 | 1075 |
|
1076 |
"Created: / 31.10.1997 / 02:00:42 / cg" |
|
1077 |
"Modified: / 31.10.1997 / 11:52:53 / cg" |
|
1102 | 1078 |
! |
1079 |
||
1080 |
warn:aMessageString for:ignoredView |
|
1371 | 1081 |
"VW compatibility - warn using the same viewStyle as in the view |
1102 | 1082 |
argument; not supported in ST/X (who mixes styles ?)" |
1083 |
||
1084 |
^ self warn:aMessageString |
|
1085 |
||
1371 | 1086 |
"Created: / 6.3.1997 / 15:46:02 / cg" |
1087 |
"Modified: / 31.10.1997 / 11:54:35 / cg" |
|
1102 | 1088 |
! ! |
1089 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1090 |
!DialogBox class methodsFor:'class initialization'! |
498 | 1091 |
|
1092 |
initialize |
|
528
3ed1f0b5a0bb
oops - dont clobber Dialog global if subclasses #initialize
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
1093 |
self == DialogBox ifTrue:[ |
1757 | 1094 |
Dialog := self |
1095 |
]. |
|
1096 |
||
1097 |
DefaultFocusToOKOnLeave := false. |
|
3902
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1098 |
|
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1099 |
"/ for backward whitebox compatibility (customer subclasses which access the classVar directly) |
eb4576429ff0
AboutToOpenBoxNotificationSignal moved to SimpleView and now raised
Claus Gittinger <cg@exept.de>
parents:
3888
diff
changeset
|
1100 |
AboutToOpenBoxNotificationSignal := SimpleView aboutToOpenBoxNotificationSignal |
498 | 1101 |
! ! |
1102 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1103 |
!DialogBox class methodsFor:'common dialogs'! |
100 | 1104 |
|
2479 | 1105 |
about:text label:label icon:image |
1106 |
"opens an standard about box for an application." |
|
1107 |
||
1108 |
|box| |
|
1109 |
||
1110 |
AboutBox isNil ifTrue:[ |
|
1111 |
"/ this handles bad installations of ST/X, |
|
1112 |
"/ where the AboutBox is missing. |
|
1113 |
"/ (May vanish in the future) |
|
1114 |
^ self information:text |
|
1115 |
]. |
|
1116 |
||
1117 |
box := AboutBox title:text. |
|
1118 |
||
2672 | 1119 |
box image:image. |
2479 | 1120 |
box label:label. |
1121 |
box autoHideAfter:10 with:[]. |
|
3548
7cc719de254f
aboutToObenBoxNotification for aboutBox
Claus Gittinger <cg@exept.de>
parents:
3538
diff
changeset
|
1122 |
self showAndThenDestroyBox:box. |
7cc719de254f
aboutToObenBoxNotification for aboutBox
Claus Gittinger <cg@exept.de>
parents:
3538
diff
changeset
|
1123 |
"/ box open. |
2479 | 1124 |
|
1125 |
"Created: / 17.11.2001 / 23:04:53 / cg" |
|
1126 |
"Modified: / 17.11.2001 / 23:06:06 / cg" |
|
1127 |
! |
|
1128 |
||
2499 | 1129 |
aboutClass:aClass |
4132
783ba5afbcf0
comment/format in: #aboutClass:
Claus Gittinger <cg@exept.de>
parents:
4104
diff
changeset
|
1130 |
"opens a standard (simple) aboutBox for aClass." |
2499 | 1131 |
|
1132 |
|rev clsRev msg resources| |
|
1133 |
||
1134 |
rev := ''. |
|
1135 |
||
1136 |
(clsRev := aClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
|
1137 |
resources := aClass classResources. |
|
1138 |
||
1139 |
msg := '\' withCRs , aClass name asBoldText, rev. |
|
1140 |
||
1141 |
self |
|
1142 |
about:(resources string:msg) |
|
1143 |
label:(resources string:'About ' , aClass nameWithoutPrefix) |
|
3629
e4ff4d031bbc
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
3622
diff
changeset
|
1144 |
icon:aClass defaultIconForAboutBox |
2499 | 1145 |
! |
1146 |
||
1703
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1147 |
informUser:aString during:aBlock |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1148 |
"show a message-box while executing aBlock" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1149 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1150 |
|box| |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1151 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1152 |
[ |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1153 |
box := InfoBox title:aString. |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1154 |
box hideButtons. |
2439 | 1155 |
self showBox:box. "/ box showAtPointer. |
1704
304ccbc56ec4
fixed #informUser:during: in case of timeSlicer not running.
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
1156 |
] forkAt:(Processor activePriority + 1). |
2522
d80496af7eaf
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
2517
diff
changeset
|
1157 |
aBlock ensure:[box destroy] |
1703
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1158 |
|
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1159 |
" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1160 |
Dialog informUser:'wait a second...' during:[Delay waitForSeconds:1] |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1161 |
Dialog informUser:'wait a few seconds...' during:[10000 factorial] |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1162 |
" |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1163 |
! |
8881861270f1
added #informUser:during: utility.
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1164 |
|
2622 | 1165 |
informUser:aString during:aBlock cancel:canCancel |
1166 |
"show a message-box while executing aBlock" |
|
1167 |
||
1168 |
|box subProcess| |
|
1169 |
||
1170 |
box := InfoBox title:aString. |
|
1171 |
canCancel ifTrue:[ |
|
2640
2672ec342e7e
Do not refer to uninitialized ClassResources
Stefan Vogel <sv@exept.de>
parents:
2637
diff
changeset
|
1172 |
box okText:(self classResources string:'Abort'). |
2622 | 1173 |
] ifFalse:[ |
1174 |
box hideButtons. |
|
1175 |
]. |
|
1176 |
||
1177 |
subProcess := [ |
|
1178 |
aBlock ensure:[box destroy] |
|
1179 |
] forkAt:(Processor activePriority - 1). |
|
1180 |
||
1181 |
self showBox:box. |
|
1182 |
subProcess terminate. |
|
1183 |
||
1184 |
||
1185 |
" |
|
1186 |
Dialog informUser:'don''t wait ...' during:[true] cancel:true |
|
3137 | 1187 |
Dialog informUser:'please wait a second...' during:[Delay waitForSeconds:1] cancel:true |
1188 |
Dialog informUser:'please wait, while I compute 30000 factorial...' during:[30000 factorial] cancel:true |
|
2622 | 1189 |
" |
1190 |
! |
|
1191 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1192 |
information:aString |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1193 |
"launch a Dialog to tell user something" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1194 |
|
2493 | 1195 |
|currentScreen| |
1196 |
||
2781 | 1197 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
2493 | 1198 |
^ currentScreen |
1199 |
nativeInformationOK:aString |
|
1200 |
title:aString |
|
1201 |
]. |
|
2439 | 1202 |
self showAndThenDestroyBox:(InfoBox title:aString) |
197 | 1203 |
|
1204 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1205 |
Dialog information:'help' |
197 | 1206 |
" |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1207 |
|
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1208 |
"Modified: 29.5.1996 / 15:23:03 / cg" |
197 | 1209 |
! |
1210 |
||
4208 | 1211 |
information:aString title:windowTitle |
1212 |
"launch a Dialog to tell user something" |
|
1213 |
||
1214 |
|currentScreen| |
|
1215 |
||
1216 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1217 |
^ currentScreen |
|
1218 |
nativeInformationOK:aString |
|
1219 |
title:windowTitle |
|
1220 |
]. |
|
1221 |
self showAndThenDestroyBox:(InfoBox title:aString label:windowTitle) |
|
1222 |
||
1223 |
" |
|
1224 |
Dialog information:'help' title:'Attention' |
|
1225 |
" |
|
1226 |
||
1227 |
"Created: / 22-12-2010 / 19:33:23 / cg" |
|
1228 |
! |
|
1229 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1230 |
warn:aString |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1231 |
"launch a Dialog to warn user" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1232 |
|
2493 | 1233 |
|currentScreen| |
1234 |
||
2781 | 1235 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
2493 | 1236 |
^ currentScreen |
1237 |
nativeWarnOK:aString |
|
1238 |
title:aString |
|
1239 |
]. |
|
2439 | 1240 |
self showAndThenDestroyBox:(WarningBox title:aString) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1241 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1242 |
" |
625 | 1243 |
Dialog warn:'some warning message' |
1244 |
||
1245 |
Dialog warn:('some text with italic emphasis' asText |
|
2439 | 1246 |
emphasizeFrom:16 to:22 with:#italic) |
625 | 1247 |
|
1248 |
Dialog warn:('some warning message' asText |
|
2439 | 1249 |
emphasizeAllWith:(#color->Color red)) |
625 | 1250 |
|
1251 |
Dialog warn:('some text with color emphasis' asText |
|
2439 | 1252 |
emphasizeFrom:6 to:10 with:(#color->Color blue); |
1253 |
emphasizeFrom:16 to:20 with:(#color->Color red)) |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1254 |
" |
625 | 1255 |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
1256 |
"Modified: 29.5.1996 / 15:23:14 / cg" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1257 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1258 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1259 |
!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
|
1260 |
|
197 | 1261 |
confirm:aString |
3355 | 1262 |
"open a modal yes-no dialog. |
1263 |
Return true for yes, false for no" |
|
197 | 1264 |
|
498 | 1265 |
^ self |
3456 | 1266 |
confirm:aString |
1267 |
title:nil |
|
1268 |
yesLabel:nil noLabel:nil |
|
1269 |
initialAnswer:true. |
|
498 | 1270 |
|
197 | 1271 |
" |
307
d3fe810390cb
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 |
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
|
1273 |
|
655 | 1274 |
Transcript showCR:( |
2298 | 1275 |
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
|
1276 |
) |
197 | 1277 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1278 |
|
3456 | 1279 |
"Modified: / 02-03-2007 / 15:25:34 / cg" |
197 | 1280 |
! |
1281 |
||
2317 | 1282 |
confirm:aString default:what |
1283 |
"launch a Dialog, which allows user to enter yes or no. |
|
1284 |
return true for yes, false for no. |
|
1285 |
InitialAnswer must be true or false and defines which button is to be |
|
1286 |
the default (i.e. return-) button" |
|
1287 |
||
3456 | 1288 |
^ self |
1289 |
confirm:aString |
|
1290 |
title:nil |
|
1291 |
yesLabel:nil noLabel:nil |
|
1292 |
initialAnswer:what. |
|
2453 | 1293 |
|
1294 |
" |
|
1295 |
Dialog confirm:'Are you happy' default:true |
|
1296 |
||
1297 |
Dialog confirm:'Are you happy' default:false |
|
1298 |
" |
|
3456 | 1299 |
|
1300 |
"Modified: / 02-03-2007 / 15:25:23 / cg" |
|
2317 | 1301 |
! |
1302 |
||
197 | 1303 |
confirm:aString initialAnswer:what |
1304 |
"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
|
1305 |
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
|
1306 |
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
|
1307 |
the default (i.e. return-) button" |
197 | 1308 |
|
2439 | 1309 |
^ self |
1310 |
confirm:aString |
|
1311 |
title:nil |
|
3456 | 1312 |
yesLabel:nil noLabel:nil |
2439 | 1313 |
initialAnswer:what. |
197 | 1314 |
|
1315 |
" |
|
1316 |
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
|
1317 |
|
655 | 1318 |
Transcript showCR:( |
2361 | 1319 |
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
|
1320 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1321 |
|
655 | 1322 |
Transcript showCR:( |
2361 | 1323 |
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
|
1324 |
) |
197 | 1325 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1326 |
|
3456 | 1327 |
"Modified: / 02-03-2007 / 15:24:52 / cg" |
197 | 1328 |
! |
1329 |
||
2618 | 1330 |
confirm:aString initialAnswer:what noLabel:noText |
1331 |
"launch a Dialog, which allows user to enter yes or no. |
|
1332 |
return true for yes, false for no. |
|
1333 |
InitialAnswer must be true or false and defines which button is to be |
|
1334 |
the default (i.e. return-) button" |
|
1335 |
||
1336 |
^ self |
|
1337 |
confirm:aString |
|
1338 |
title:nil |
|
3456 | 1339 |
yesLabel:nil noLabel:noText |
2618 | 1340 |
initialAnswer:what. |
3456 | 1341 |
|
1342 |
"Modified: / 02-03-2007 / 15:24:49 / cg" |
|
2618 | 1343 |
! |
1344 |
||
2079 | 1345 |
confirm:aString noLabel:noText |
1346 |
"launch a Dialog, which allows user to enter yes or no. |
|
1347 |
return true for yes, false for no. |
|
1348 |
The no-button is labeled noText (for example, if you need a 'cancel' there)" |
|
1349 |
||
1350 |
^ self |
|
1351 |
confirm:aString |
|
2493 | 1352 |
title:nil |
3456 | 1353 |
yesLabel:nil noLabel:noText |
1354 |
initialAnswer:true |
|
2079 | 1355 |
|
1356 |
" |
|
1357 |
Dialog confirm:'really ?' |
|
1358 |
||
2493 | 1359 |
Dialog confirm:'really ?' noLabel:'Cancel' |
2079 | 1360 |
" |
3456 | 1361 |
|
1362 |
"Modified: / 02-03-2007 / 15:24:43 / cg" |
|
1363 |
! |
|
1364 |
||
1365 |
confirm:aString title:title |
|
1366 |
"open a modal yes-no dialog. |
|
1367 |
Return true for yes, false for no" |
|
1368 |
||
1369 |
^ self |
|
1370 |
confirm:aString |
|
1371 |
title:nil |
|
1372 |
yesLabel:nil noLabel:nil |
|
1373 |
initialAnswer:true |
|
1374 |
||
1375 |
" |
|
1376 |
Dialog confirm:'really ?' |
|
1377 |
||
1378 |
Transcript showCR:( |
|
1379 |
Dialog confirm:'are you certain ?' |
|
1380 |
) |
|
1381 |
" |
|
1382 |
||
1383 |
"Created: / 02-03-2007 / 15:21:25 / cg" |
|
2079 | 1384 |
! |
1385 |
||
1386 |
confirm:aString title:title noLabel:noText |
|
1387 |
"launch a Dialog, which allows user to enter yes or no. |
|
1388 |
return true for yes, false for no. |
|
1389 |
The no buttons label is defined by noText (for example, to make it 'cancel')." |
|
1390 |
||
1391 |
^ self |
|
2493 | 1392 |
confirm:aString |
1393 |
title:title |
|
1394 |
yesLabel:nil noLabel:noText |
|
3456 | 1395 |
initialAnswer:true |
2079 | 1396 |
|
1397 |
" |
|
1398 |
Dialog |
|
1399 |
confirm:'really ?' |
|
1400 |
title:'fooBar' |
|
2493 | 1401 |
noLabel:'Nope' |
2079 | 1402 |
" |
1403 |
||
1404 |
" |
|
1405 |
Dialog |
|
1406 |
confirm:'really ?' |
|
1407 |
title:nil |
|
2493 | 1408 |
noLabel:'Cancel' |
2079 | 1409 |
" |
3456 | 1410 |
|
1411 |
"Modified: / 02-03-2007 / 15:23:55 / cg" |
|
2079 | 1412 |
! |
1413 |
||
498 | 1414 |
confirm:aString title:title yesLabel:yesText noLabel:noText |
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1415 |
"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
|
1416 |
return true for yes, false for no. |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1417 |
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
|
1418 |
|
2493 | 1419 |
^ self |
1420 |
confirm:aString |
|
1421 |
title:title |
|
1422 |
yesLabel:yesText noLabel:noText |
|
1423 |
initialAnswer:true |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1424 |
|
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1425 |
" |
498 | 1426 |
Dialog |
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1427 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1428 |
title:'fooBar' |
2493 | 1429 |
yesLabel:'Oh well' |
1430 |
noLabel:'Nope' |
|
498 | 1431 |
" |
1432 |
||
881 | 1433 |
" |
1434 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1435 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1436 |
title:nil |
2493 | 1437 |
yesLabel:'Oh well' |
1438 |
noLabel:'Nope' |
|
881 | 1439 |
" |
1440 |
||
1441 |
" |
|
1442 |
Dialog |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1443 |
confirm:'really ?' |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1444 |
title:'' |
2493 | 1445 |
yesLabel:'Oh well' |
1446 |
noLabel:'Nope' |
|
1488
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1447 |
" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1448 |
|
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1449 |
"Created: / 21.2.1996 / 01:10:14 / cg" |
630b308c4295
ESC returns false in #confirm-dialog
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1450 |
"Modified: / 18.4.1998 / 19:25:21 / cg" |
498 | 1451 |
! |
1452 |
||
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1453 |
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
|
1454 |
"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
|
1455 |
return true for yes, false for no. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1456 |
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
|
1457 |
|
3456 | 1458 |
|box answer t currentScreen| |
1459 |
||
1460 |
t := title. |
|
1461 |
t isNil ifTrue:[ t := self classResources string:'Confirm' ]. |
|
1462 |
||
1463 |
((currentScreen := Screen current) notNil and:[currentScreen nativeDialogs]) ifTrue:[ |
|
1464 |
"/ experimental |
|
1465 |
^ currentScreen |
|
1466 |
nativeConfirmYesNo:aString |
|
1467 |
title:t |
|
1468 |
initialAnswer:what |
|
1469 |
]. |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1470 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1471 |
box := YesNoBox title:aString. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1472 |
yesText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1473 |
box yesLabel:yesText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1474 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1475 |
noText notNil ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1476 |
box noLabel:noText. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1477 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1478 |
answer := false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1479 |
box yesAction:[answer := true]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1480 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1481 |
box label:t. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1482 |
what == false ifTrue:[ |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1483 |
box okButton isReturnButton:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1484 |
box acceptReturnAsOK:false. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1485 |
box cancelButton beReturnButton. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1486 |
]. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1487 |
|
2439 | 1488 |
self showAndThenDestroyBox:box. |
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1489 |
box yesAction:nil noAction:nil. |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1490 |
^ answer |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1491 |
|
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1492 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1493 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1494 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1495 |
title:'fooBar' |
2493 | 1496 |
yesLabel:'Oh well' |
1497 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1498 |
initialAnswer:true |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1499 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1500 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1501 |
Dialog |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1502 |
confirm:'really ?' |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1503 |
title:'fooBar' |
2493 | 1504 |
yesLabel:'Oh well' |
1505 |
noLabel:'Nope' |
|
2374
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1506 |
initialAnswer:false |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1507 |
" |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1508 |
|
3456 | 1509 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1510 |
"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
|
1511 |
! |
01d107c523aa
code reuse; added #confirm...yesLabel:noLabel:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
2362
diff
changeset
|
1512 |
|
2710 | 1513 |
confirm:msg withCancel:aBoolean |
1514 |
"launch a Dialog, which allows user to enter yes, no and optionally: cancel. |
|
1515 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1516 |
||
1517 |
aBoolean ifTrue:[ |
|
1518 |
^ Dialog confirmWithCancel:msg. |
|
1519 |
] ifFalse:[ |
|
1520 |
^ Dialog confirm:msg. |
|
1521 |
]. |
|
1522 |
||
1523 |
" |
|
1524 |
Dialog confirm:'really ?' withCancel:false |
|
1525 |
Dialog confirm:'really ?' withCancel:true |
|
1526 |
" |
|
1527 |
! |
|
1528 |
||
3357
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1529 |
confirm:msg withCancel:aBoolean default:default |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1530 |
"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
|
1531 |
return true for 'yes', false for 'no', nil for 'cancel'" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1532 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1533 |
aBoolean ifTrue:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1534 |
^ Dialog confirmWithCancel:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1535 |
] ifFalse:[ |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1536 |
^ Dialog confirm:msg default:default. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1537 |
]. |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1538 |
|
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1539 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1540 |
Dialog confirm:'really ?' withCancel:false |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1541 |
Dialog confirm:'really ?' withCancel:true |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1542 |
" |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1543 |
! |
f00242a1c6cd
+confirm:withCancel:default:
Claus Gittinger <cg@exept.de>
parents:
3355
diff
changeset
|
1544 |
|
3382 | 1545 |
confirm:aString yesLabel:yesText |
1546 |
"launch a Dialog, which allows user to enter yes or no. |
|
1547 |
return true for yes, false for no. |
|
1548 |
The yes button's label is defined by yesText." |
|
1549 |
||
1550 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:nil |
|
1551 |
||
1552 |
" |
|
1553 |
Dialog |
|
1554 |
confirm:'really ?' |
|
1555 |
yesLabel:'Oh well' |
|
1556 |
" |
|
1557 |
||
1558 |
"Created: / 04-09-2006 / 11:18:50 / cg" |
|
1559 |
! |
|
1560 |
||
498 | 1561 |
confirm:aString yesLabel:yesText noLabel:noText |
1562 |
"launch a Dialog, which allows user to enter yes or no. |
|
1563 |
return true for yes, false for no. |
|
3382 | 1564 |
The yes/no buttons' labels are defined by yesText/noText." |
498 | 1565 |
|
1566 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText |
|
1567 |
||
1568 |
" |
|
2493 | 1569 |
Dialog |
1570 |
confirm:'really ?' |
|
1571 |
yesLabel:'Oh well' |
|
1572 |
noLabel:'Nope' |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1573 |
" |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1574 |
|
3382 | 1575 |
"Created: / 21-02-1996 / 01:10:14 / cg" |
1576 |
"Modified: / 04-09-2006 / 11:19:00 / cg" |
|
253
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1577 |
! |
f071ff350cd5
added confirm with button-labels
Claus Gittinger <cg@exept.de>
parents:
241
diff
changeset
|
1578 |
|
3255 | 1579 |
confirm:aString yesLabel:yesText noLabel:noText initialAnswer:what |
1580 |
"launch a Dialog, which allows user to enter yes or no. |
|
1581 |
return true for yes, false for no. |
|
1582 |
The yes/no buttons labels are defined by yesText/noText." |
|
1583 |
||
1584 |
^ self confirm:aString title:nil yesLabel:yesText noLabel:noText initialAnswer:what |
|
1585 |
||
1586 |
" |
|
1587 |
Dialog |
|
1588 |
confirm:'really ?' |
|
1589 |
yesLabel:'Oh well' |
|
1590 |
noLabel:'Nope' |
|
1591 |
initialAnswer:false |
|
1592 |
" |
|
1593 |
||
1594 |
"Created: 21.2.1996 / 01:10:14 / cg" |
|
1595 |
"Modified: 8.3.1996 / 21:15:06 / cg" |
|
1596 |
! |
|
1597 |
||
2790 | 1598 |
confirmOKCancel:aString |
1599 |
"launch a Dialog, which allows user to enter OK or Cancel. |
|
1600 |
return true for OK, false for Cancel." |
|
1601 |
||
1602 |
|resources| |
|
1603 |
||
1604 |
resources := self classResources. |
|
1605 |
^ self |
|
1606 |
confirm:aString |
|
1607 |
yesLabel:(resources string:'OK') |
|
1608 |
noLabel:(resources string:'Cancel') |
|
1609 |
||
1610 |
" |
|
1611 |
Dialog confirmOKCancel:'really ?' |
|
1612 |
" |
|
1613 |
! |
|
1614 |
||
197 | 1615 |
confirmWithCancel:aString |
1616 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1617 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1618 |
||
3456 | 1619 |
^ self |
1620 |
confirmWithCancel:aString |
|
1621 |
default:nil |
|
1622 |
title:nil |
|
1004 | 1623 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1624 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1625 |
Dialog confirmWithCancel:'really ?' |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1626 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1627 |
|
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1628 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1629 |
Transcript showCR:( |
3456 | 1630 |
Dialog confirmWithCancel:'really ?' |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1631 |
) |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1632 |
" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1633 |
|
3456 | 1634 |
"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
|
1635 |
! |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1636 |
|
1004 | 1637 |
confirmWithCancel:aString default:default |
1638 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1639 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1640 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1641 |
||
3456 | 1642 |
^ self |
2415 | 1643 |
confirmWithCancel:aString |
3456 | 1644 |
default:default |
1645 |
title:nil |
|
2790 | 1646 |
|
1004 | 1647 |
" |
1648 |
Dialog confirmWithCancel:'really ?' default:false |
|
2437 | 1649 |
Dialog confirmWithCancel:'really ?' default:true |
1004 | 1650 |
" |
3456 | 1651 |
|
1652 |
"Modified: / 02-03-2007 / 15:26:13 / cg" |
|
1004 | 1653 |
! |
1654 |
||
2788
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1655 |
confirmWithCancel:aString default:defaultValue onCancel:cancelValue |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1656 |
"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
|
1657 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1658 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1659 |
|answer| |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1660 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1661 |
answer := self confirmWithCancel:aString default:defaultValue. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1662 |
answer isNil ifTrue:[ |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1663 |
^ cancelValue value |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1664 |
]. |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1665 |
^ answer |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1666 |
|
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1667 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1668 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1669 |
" |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1670 |
! |
6e4b5ada3f89
+confirmWithCancel:default:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2787
diff
changeset
|
1671 |
|
3456 | 1672 |
confirmWithCancel:aString default:default title:titleString |
1673 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1674 |
return true for 'yes', false for 'no', nil for 'cancel'. |
|
1675 |
The default argument marks the return-button; it may be one of nil, false or true" |
|
1676 |
||
1677 |
^ self |
|
1678 |
confirmWithCancel:aString |
|
1679 |
labels:(self classResources array:#('Cancel' 'No' 'Yes') ) |
|
1680 |
values:#(nil false true) |
|
1681 |
default:(#(nil false true) indexOf:default ifAbsent:nil) |
|
1682 |
title:titleString |
|
1683 |
||
1684 |
" |
|
1685 |
Dialog confirmWithCancel:'really ?' default:false |
|
1686 |
Dialog confirmWithCancel:'really ?' default:true |
|
1687 |
" |
|
1688 |
||
1689 |
"Created: / 02-03-2007 / 15:09:56 / cg" |
|
1690 |
! |
|
1691 |
||
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1692 |
confirmWithCancel:aString labels:labelArray |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1693 |
"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
|
1694 |
Return true for 'yes', false for 'no', nil for 'cancel'. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1695 |
The default is yes. |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1696 |
The buttons labels are given in labelArray" |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1697 |
|
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1698 |
^ self |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1699 |
confirmWithCancel:aString |
3456 | 1700 |
labels:(self classResources array:labelArray) |
1701 |
default:3 |
|
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1702 |
" |
2493 | 1703 |
Dialog confirmWithCancel:'really ?' labels:#( 'Oops' 'Nope' 'Yea') |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1704 |
" |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1705 |
|
3456 | 1706 |
"Modified: / 02-03-2007 / 15:10:34 / cg" |
1624
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1707 |
! |
bc716c00b226
added #confirmWithCancel:labels:
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
1708 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1709 |
confirmWithCancel:aString labels:buttonLabels default:default |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1710 |
"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
|
1711 |
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
|
1712 |
The strings for cancel, no and yes are to be passed in |
1004 | 1713 |
buttonLabels; |
1714 |
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
|
1715 |
return button (1 to 3)" |
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1716 |
|
1707 | 1717 |
^ self |
1718 |
confirmWithCancel:aString |
|
1719 |
labels:buttonLabels |
|
1720 |
values:#(nil false true) |
|
1721 |
default:default |
|
1722 |
||
1723 |
" |
|
1724 |
Transcript showCR:( |
|
1725 |
Dialog |
|
1726 |
confirmWithCancel:'really ?' |
|
2493 | 1727 |
labels:#('mhmh' 'Maybe' 'Definitely') |
1707 | 1728 |
default:3 |
1729 |
) |
|
1730 |
" |
|
1731 |
||
1732 |
"Created: / 18.10.1996 / 14:50:51 / cg" |
|
1733 |
"Modified: / 21.10.1998 / 15:49:16 / cg" |
|
1734 |
! |
|
1735 |
||
1736 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default |
|
1737 |
"launch a Dialog, which allows user to click on any button. |
|
1738 |
Return the corresponding value from the values array. |
|
1739 |
The labels for for the buttons are to be passed in |
|
1740 |
buttonLabels; |
|
1741 |
The default argument (if non-nil) defines the index of the |
|
1742 |
return button (1 to n)" |
|
1743 |
||
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1744 |
^ self |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1745 |
confirmWithCancel:aString |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1746 |
labels:buttonLabels |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1747 |
values:buttonValues |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1748 |
default:default |
3456 | 1749 |
title:nil |
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1750 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1751 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1752 |
Transcript showCR:( |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1753 |
Dialog |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1754 |
confirmWithCancel:'really ?' |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1755 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1756 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1757 |
default:3 |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1758 |
) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1759 |
" |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1760 |
|
3456 | 1761 |
"Created: / 18-10-1996 / 14:50:51 / cg" |
1762 |
"Modified: / 02-03-2007 / 15:09:24 / cg" |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1763 |
! |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1764 |
|
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1765 |
confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default boxLabel:boxLabelOrNil |
3456 | 1766 |
"obsolete - for backward compatibility" |
1767 |
||
1768 |
^ self |
|
1769 |
confirmWithCancel:aString |
|
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1770 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1771 |
values:buttonValues |
3456 | 1772 |
default:default |
1773 |
title:boxLabelOrNil |
|
1774 |
||
1775 |
"Modified: / 02-03-2007 / 15:09:11 / cg" |
|
1776 |
! |
|
1777 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1778 |
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
|
1779 |
"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
|
1780 |
Return the corresponding value from the values array. |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1781 |
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
|
1782 |
buttonLabels; |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1783 |
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
|
1784 |
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
|
1785 |
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
|
1786 |
|
3701 | 1787 |
|box buttons answer i| |
197 | 1788 |
|
1708
dc23c5ca439e
fixed button-creation in confirmWithCancel.
Claus Gittinger <cg@exept.de>
parents:
1707
diff
changeset
|
1789 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1790 |
box buttonTitles:buttonLabels |
1707 | 1791 |
actions:(buttonValues collect:[:v | [answer := v]]). |
2972
d66d46e04cd4
Use #image:/#label: instead of obsolete #form:
Stefan Vogel <sv@exept.de>
parents:
2966
diff
changeset
|
1792 |
box image:(YesNoBox iconBitmap). |
3622 | 1793 |
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
|
1794 |
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
|
1795 |
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
|
1796 |
ifFalse:[ buttonValues indexOf:default]) |
3622 | 1797 |
]. |
2493 | 1798 |
box label:(boxLabelOrNil ? (self classResources string:'Confirm')). |
3701 | 1799 |
buttons := box buttons. |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1800 |
(i := buttonValues indexOf:true) ~~ 0 ifTrue:[ |
3701 | 1801 |
i <= buttons size ifTrue:[ |
1802 |
(buttons at:i) cursor:(Cursor thumbsUp). |
|
3218 | 1803 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1804 |
]. |
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1805 |
(i := buttonValues indexOf:false) ~~ 0 ifTrue:[ |
3701 | 1806 |
i <= buttons size ifTrue:[ |
1807 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1808 |
] |
2907
8867601e24c6
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2830
diff
changeset
|
1809 |
]. |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1810 |
(i := buttonValues indexOf:nil) ~~ 0 ifTrue:[ |
3701 | 1811 |
i <= buttons size ifTrue:[ |
1812 |
(buttons at:i) cursor:(Cursor thumbsDown). |
|
3218 | 1813 |
] |
2908
b26616b2e603
thumbsUp/Down in confirm dialog
Claus Gittinger <cg@exept.de>
parents:
2907
diff
changeset
|
1814 |
]. |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1815 |
checkLabelOrNil notNil ifTrue:[ |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1816 |
box addCheckBox:checkLabelOrNil on:checkHolderOrNil. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1817 |
]. |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1818 |
|
2439 | 1819 |
self showAndThenDestroyBox:box. |
197 | 1820 |
box actions:nil. |
1821 |
^ answer |
|
1822 |
||
1823 |
" |
|
1707 | 1824 |
Transcript showCR:( |
1825 |
Dialog |
|
1826 |
confirmWithCancel:'really ?' |
|
1748
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1827 |
labels:#('mhmh' 'maybe' 'definitely') |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1828 |
values:#(1 2 3) |
88215be18503
+ confirmWithCancel:labels:values:default:boxLabel:
Claus Gittinger <cg@exept.de>
parents:
1740
diff
changeset
|
1829 |
default:3 |
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1830 |
check:'Again' on:(true asValue) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1831 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1832 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1833 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1834 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1835 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1836 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1837 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1838 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1839 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1840 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1841 |
title:'hello there' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1842 |
) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1843 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1844 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1845 |
"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
|
1846 |
! |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1847 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1848 |
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
|
1849 |
"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
|
1850 |
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
|
1851 |
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
|
1852 |
buttonLabels; |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1853 |
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
|
1854 |
return button (1 to n)" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1855 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1856 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1857 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1858 |
labels:buttonLabels |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1859 |
values:buttonValues |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1860 |
default:default |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1861 |
check:nil on:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1862 |
title:boxLabelOrNil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1863 |
|
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1864 |
" |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1865 |
Transcript showCR:( |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1866 |
Dialog |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1867 |
confirmWithCancel:'really ?' |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1868 |
labels:#('mhmh' 'maybe' 'definitely') |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1869 |
values:#(1 2 3) |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1870 |
default:3 |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1871 |
title:'hello there' |
1707 | 1872 |
) |
1873 |
" |
|
1874 |
||
3456 | 1875 |
"Created: / 02-03-2007 / 15:08:49 / cg" |
2787
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1876 |
! |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1877 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1878 |
confirmWithCancel:aString onCancel:cancelValue |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1879 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1880 |
return true for 'yes', false for 'no', cancelValues value for 'cancel'" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1881 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1882 |
|answer| |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1883 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1884 |
answer := self confirmWithCancel:aString. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1885 |
answer isNil ifTrue:[ |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1886 |
^ cancelValue value |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1887 |
]. |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1888 |
^ answer |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1889 |
|
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1890 |
" |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1891 |
Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise] |
401103ebccb7
+confirmWithCancel:onCancel:
Claus Gittinger <cg@exept.de>
parents:
2781
diff
changeset
|
1892 |
" |
3456 | 1893 |
! |
1894 |
||
1895 |
confirmWithCancel:aString title:titleString |
|
1896 |
"launch a Dialog, which allows user to enter yes, no and cancel. |
|
1897 |
return true for 'yes', false for 'no', nil for 'cancel'" |
|
1898 |
||
3906
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1899 |
^ self |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1900 |
confirmWithCancel:aString |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1901 |
default:nil |
75ca4638f79e
added a public entry to confirm with an additional
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
1902 |
title:titleString |
3456 | 1903 |
|
1904 |
" |
|
1905 |
Dialog confirmWithCancel:'really ?' |
|
1906 |
" |
|
1907 |
||
1908 |
" |
|
1909 |
Transcript showCR:( |
|
1910 |
Dialog confirmWithCancel:'really ?' |
|
1911 |
) |
|
1912 |
" |
|
1913 |
||
1914 |
"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
|
1915 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
1916 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1917 |
!DialogBox class methodsFor:'defaults'! |
573 | 1918 |
|
1919 |
defaultLabel |
|
1920 |
"return the boxes default window title." |
|
1921 |
||
1922 |
^ 'Dialog' |
|
1923 |
||
1924 |
"Created: 23.4.1996 / 17:13:10 / cg" |
|
1757 | 1925 |
! |
1926 |
||
1927 |
updateStyleCache |
|
1928 |
"extract values from the styleSheet and cache them in class variables" |
|
1929 |
||
1930 |
<resource: #style (#'dialogBox.returnShiftsFocusToOK')> |
|
1931 |
||
1932 |
DefaultFocusToOKOnLeave := StyleSheet at:'dialogBox.returnShiftsFocusToOK' default:false. |
|
1933 |
||
573 | 1934 |
! ! |
1935 |
||
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
1936 |
!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
|
1937 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1938 |
requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1939 |
"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
|
1940 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1941 |
^ self |
2825 | 1942 |
requestDirectoryName:'Select Directory' |
1943 |
default:nil |
|
1944 |
ok:nil abort:nil |
|
1945 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1946 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1947 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1948 |
Dialog requestDirectoryName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1949 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1950 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1951 |
"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
|
1952 |
"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
|
1953 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1954 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1955 |
requestDirectoryName:title |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1956 |
"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
|
1957 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1958 |
^ self |
2825 | 1959 |
requestDirectoryName:title |
1960 |
default:nil |
|
1961 |
ok:nil abort:nil |
|
1962 |
ifFail:'' |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1963 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1964 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1965 |
Dialog |
2825 | 1966 |
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
|
1967 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1968 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1969 |
"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
|
1970 |
"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
|
1971 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1972 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1973 |
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
|
1974 |
"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
|
1975 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1976 |
^ self |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
1977 |
requestDirectoryName:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
1978 |
default:aFileName |
2825 | 1979 |
ok:nil abort:nil |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
1980 |
ifFail:'' |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1981 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1982 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1983 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
1984 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
1985 |
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
|
1986 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1987 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1988 |
"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
|
1989 |
"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
|
1990 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
1991 |
|
2966 | 1992 |
requestDirectoryName:title default:aFileName acceptReturnAsOK:aBoolean |
1993 |
"same as requestFileName, but only show directories" |
|
1994 |
||
1995 |
^ self |
|
1996 |
requestDirectoryName:title |
|
1997 |
default:aFileName |
|
1998 |
ok:nil abort:nil |
|
1999 |
ifFail:'' |
|
2000 |
acceptReturnAsOK:aBoolean |
|
2001 |
||
2002 |
" |
|
2003 |
Dialog |
|
2004 |
requestDirectoryName:'which directory ?' |
|
2005 |
default:'/etc' |
|
2006 |
" |
|
2007 |
||
2008 |
"Created: 19.4.1996 / 14:29:10 / cg" |
|
2009 |
"Modified: 19.4.1996 / 14:31:52 / cg" |
|
2010 |
! |
|
2011 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2012 |
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
|
2013 |
"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
|
2014 |
|
2825 | 2015 |
^ self |
2016 |
requestDirectoryName:title |
|
2017 |
default:aFileName |
|
2018 |
ok:nil abort:nil |
|
2019 |
ifFail:failBlock |
|
2020 |
||
2021 |
" |
|
2022 |
Dialog |
|
2023 |
requestDirectoryName:'which directory ?' |
|
2024 |
default:'/etc' |
|
2025 |
ifFail:'none' 'none' |
|
2026 |
" |
|
2027 |
||
2028 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2029 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2030 |
! |
|
2031 |
||
2032 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText |
|
2033 |
"same as requestFileName, but only show directories" |
|
2034 |
||
2035 |
^ self |
|
2036 |
requestDirectoryName:title |
|
2037 |
default:aFileName |
|
2038 |
ok:okText abort:abortText |
|
2039 |
ifFail:'' |
|
2040 |
||
2041 |
" |
|
2042 |
Dialog |
|
2043 |
requestDirectoryName:'which directory ?' |
|
2044 |
default:'/etc' |
|
2045 |
ok:'Yes' abort:'No' |
|
2046 |
" |
|
2047 |
||
2048 |
"Created: 19.4.1996 / 14:31:04 / cg" |
|
2049 |
"Modified: 23.10.1997 / 19:24:41 / cg" |
|
2050 |
! |
|
2051 |
||
2052 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock |
|
2966 | 2053 |
"Same as requestFileName, but only show directories. |
2054 |
" |
|
2055 |
||
2056 |
^ self requestDirectoryName:title |
|
2057 |
default: aFileName |
|
2058 |
ok: okText |
|
2059 |
abort: abortText |
|
2060 |
ifFail: failBlock |
|
2061 |
acceptReturnAsOK: false |
|
2062 |
! |
|
2063 |
||
2064 |
requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
|
2065 |
"Same as requestFileName, but only show directories. |
|
2066 |
Extended to accept return as ok if wanted." |
|
2825 | 2067 |
|
2068 |
|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
|
2069 |
|
2621 | 2070 |
UserPreferences current useNewFileDialog ifTrue:[ |
3004 | 2071 |
^ "FileDialogV2" FileDialog requestDirectoryName:title default:aFileName ok:okText abort:abortText ifFail:failBlock acceptReturnAsOK:aBoolean |
2621 | 2072 |
]. |
2789 | 2073 |
|
2074 |
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
|
2075 |
fileBox := FileSelectionBox |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2076 |
title:title |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2077 |
action:[:fileName | enteredName := fileName]. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2078 |
|
3352 | 2079 |
fileBox acceptReturnAsOK:aBoolean. |
2966 | 2080 |
|
2825 | 2081 |
okText notNil |
2082 |
ifTrue:[ t := okText ] |
|
2083 |
ifFalse:[ t := resources string:'OK' ]. |
|
2084 |
fileBox okText:t. |
|
2085 |
||
2086 |
abortText notNil |
|
2087 |
ifTrue:[ t := abortText ] |
|
2088 |
ifFalse:[ t := resources string:'Cancel' ]. |
|
2089 |
fileBox abortText:t. |
|
2090 |
||
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2091 |
fN := aFileName. |
1780
bfc30a82aae3
dont get confused with a nil default
Claus Gittinger <cg@exept.de>
parents:
1764
diff
changeset
|
2092 |
dirF := (aFileName ? '.') asFilename. |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2093 |
dirF name = dirF baseName ifFalse:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2094 |
dir := dirF directoryName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2095 |
fN := dirF baseName. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2096 |
] ifTrue:[ |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2097 |
dir := FileSelectionBox lastFileSelectionDirectory. |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2098 |
]. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2099 |
dir notNil ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2100 |
fileBox directory:dir. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2101 |
]. |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2102 |
|
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2103 |
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
|
2104 |
fileBox selectingDirectory:true. |
2439 | 2105 |
|
2106 |
self showAndThenDestroyBox:fileBox. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2107 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2108 |
(enteredName isEmptyOrNil) ifTrue:[ |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2109 |
^ failBlock value |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2110 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2111 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2112 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2113 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2114 |
^ enteredName |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2115 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2116 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2117 |
Dialog |
1740
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2118 |
requestDirectoryName:'which directory ?' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2119 |
default:'/etc' |
0160c5afae9c
care for default-dir in #requestDirectoryName:..
Claus Gittinger <cg@exept.de>
parents:
1736
diff
changeset
|
2120 |
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
|
2121 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2122 |
|
3352 | 2123 |
"Created: / 19-04-1996 / 14:31:04 / cg" |
2124 |
"Modified: / 23-08-2006 / 12:33:55 / cg" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2125 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2126 |
|
2631 | 2127 |
requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2128 |
"same as requestFileName, but only show directories" |
|
2129 |
||
2130 |
^ FileDialog |
|
2131 |
requestDirectoryName:titleString |
|
2132 |
default:aFileName |
|
2133 |
ok:okText |
|
2134 |
abort:abortText |
|
2135 |
version:versionSymbol |
|
2136 |
pattern:pattern |
|
2137 |
fromDirectory:aDirectoryPath |
|
2138 |
ifFail:failBlock |
|
2139 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2140 |
asLoadDialog:aBoolean. |
|
2141 |
! |
|
2142 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2143 |
requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2144 |
"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
|
2145 |
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
|
2146 |
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
|
2147 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2148 |
^ self |
1401 | 2149 |
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
|
2150 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2151 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2152 |
Dialog requestFileName |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2153 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2154 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2155 |
"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
|
2156 |
"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
|
2157 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2158 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2159 |
requestFileName:titleString |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2160 |
"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
|
2161 |
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
|
2162 |
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
|
2163 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2164 |
^ self |
1401 | 2165 |
requestFileName:titleString |
2166 |
default:'file.ext' |
|
183 | 2167 |
|
197 | 2168 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2169 |
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
|
2170 |
Dialog requestFileName:'enter a fileName:' |
183 | 2171 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2172 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2173 |
"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
|
2174 |
"Modified: 19.4.1996 / 13:53:17 / cg" |
118 | 2175 |
! |
2176 |
||
100 | 2177 |
requestFileName:titleString default:defaultName |
2178 |
"launch a Dialog, which allows user to enter a filename. |
|
2179 |
The box will not allow pressing 'ok' without an entered string. |
|
2180 |
Return the pathname string consisting of the full pathname of the filename, |
|
2181 |
or an empty string (if cancel was pressed)." |
|
2182 |
||
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2183 |
^ self |
1401 | 2184 |
requestFileName:titleString |
2185 |
default:defaultName |
|
2186 |
version:nil |
|
2187 |
ifFail:'' |
|
100 | 2188 |
|
2189 |
" |
|
2190 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
2191 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
|
2192 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2193 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2194 |
"Modified: 19.4.1996 / 13:47:44 / cg" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2195 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2196 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2197 |
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
|
2198 |
"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
|
2199 |
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
|
2200 |
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
|
2201 |
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
|
2202 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2203 |
^ self |
4181 | 2204 |
requestFileName:titleString |
2205 |
default:defaultName |
|
2206 |
version:nil |
|
2207 |
ifFail:'' |
|
2208 |
pattern:nil |
|
2209 |
fromDirectory:aDirectoryPath |
|
2210 |
forSave:false |
|
2211 |
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
|
2212 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2213 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2214 |
Dialog |
4181 | 2215 |
requestFileName:'enter a fileName:' |
2216 |
default:'Makefile.bak' |
|
2217 |
fromDirectory:'..' |
|
2218 |
" |
|
2219 |
||
2220 |
"Modified: / 27-10-2010 / 10:40:42 / cg" |
|
100 | 2221 |
! |
2222 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2223 |
requestFileName:titleString default:defaultName ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2224 |
"launch a Dialog, which allows user to enter a filename. |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2225 |
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
|
2226 |
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
|
2227 |
or an empty string (if cancel was pressed)." |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2228 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2229 |
^ self |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2230 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2231 |
default:defaultName |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2232 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2233 |
ifFail:cancelBlockOrValue |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2234 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2235 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2236 |
Dialog requestFileName:'enter a fileName:' default:'' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2237 |
Dialog requestFileName:'enter a fileName:' default:'Makefile.bak' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2238 |
" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2239 |
|
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2240 |
"Modified: 19.4.1996 / 13:47:44 / cg" |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2241 |
! |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2242 |
|
1736 | 2243 |
requestFileName:titleString default:defaultName ifFail:failReturn pattern:pattern fromDirectory:dir |
2244 |
"launch a Dialog, which allows user to enter a filename. |
|
2245 |
The files presented initially are those from dir. |
|
2246 |
The box will show ok/cancel in its buttons. |
|
2247 |
The matchPattern is set to pattern initially. |
|
2248 |
Return the string or failReturn if cancel was pressed." |
|
2249 |
||
2250 |
^ self |
|
2251 |
requestFileName:titleString |
|
2252 |
default:defaultName |
|
2253 |
version:nil |
|
2254 |
ifFail:failReturn |
|
2255 |
pattern:pattern |
|
2256 |
fromDirectory:dir |
|
2257 |
||
2258 |
! |
|
2259 |
||
2825 | 2260 |
requestFileName:titleString default:defaultName ok:okText abort:abortText |
2261 |
"launch a Dialog, which allows user to enter a filename. |
|
2262 |
The files presented initially are those from the current directory. |
|
2263 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2264 |
The matchPattern is set to pattern initially. |
|
2265 |
Return the string or nil if cancel was pressed." |
|
2266 |
||
2267 |
^ self |
|
2268 |
requestFileName:titleString |
|
2269 |
default:defaultName |
|
2270 |
ok:okText abort:abortText |
|
2271 |
pattern:'*' |
|
2272 |
||
2273 |
" |
|
2274 |
Dialog |
|
2275 |
requestFileName:'enter a fileName:' |
|
2276 |
default:'' |
|
2277 |
ok:'yeah' |
|
2278 |
abort:'oh, no' |
|
2279 |
" |
|
2280 |
! |
|
2281 |
||
197 | 2282 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
2283 |
"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
|
2284 |
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
|
2285 |
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
|
2286 |
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
|
2287 |
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
|
2288 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2289 |
^ self |
1401 | 2290 |
requestFileName:titleString |
2291 |
default:defaultName |
|
2292 |
ok:okText |
|
2293 |
abort:abortText |
|
2294 |
pattern:pattern |
|
2295 |
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
|
2296 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2297 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2298 |
Dialog |
1401 | 2299 |
requestFileName:'enter a fileName:' |
2300 |
default:'' |
|
2301 |
ok:'yeah' |
|
2302 |
abort:'oh, no' |
|
2303 |
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
|
2304 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2305 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2306 |
"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
|
2307 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2308 |
|
2218 | 2309 |
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
|
2310 |
"launch a Dialog, which allows user to enter a filename. |
2218 | 2311 |
The files presented initially are those in aDirectoryPathOrNil, or the |
2312 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
197 | 2313 |
The box will show okText in its okButton, abortText in the abortButton. |
2314 |
The matchPattern is set to pattern initially. |
|
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
2315 |
Return the string, or nil if cancel was pressed." |
197 | 2316 |
|
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2317 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2318 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2319 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2320 |
ok:okText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2321 |
abort:abortText |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2322 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2323 |
fromDirectory:aDirectoryPathOrNil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2324 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2325 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2326 |
|
4181 | 2327 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil forSave:forSave |
2328 |
"launch a Dialog, which allows user to enter a filename. |
|
2329 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2330 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2331 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2332 |
The matchPattern is set to pattern initially. |
|
2333 |
Return the string, or nil if cancel was pressed." |
|
2334 |
||
2335 |
^ self |
|
2336 |
requestFileName:titleString |
|
2337 |
default:defaultName |
|
2338 |
ok:okText |
|
2339 |
abort:abortText |
|
2340 |
pattern:pattern |
|
2341 |
fromDirectory:aDirectoryPathOrNil |
|
2342 |
forSave:forSave |
|
2343 |
whenBoxCreatedEvaluate:nil |
|
2344 |
||
2345 |
"Created: / 27-10-2010 / 11:22:58 / cg" |
|
2346 |
! |
|
2347 |
||
2348 |
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
|
2349 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2350 |
The files presented initially are those in aDirectoryPathOrNil, or the |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2351 |
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
|
2352 |
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
|
2353 |
The matchPattern is set to pattern initially. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2354 |
Return the string, or nil if cancel was pressed." |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2355 |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2356 |
|box defaultDir defaultNm dir enteredName| |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2357 |
|
4164 | 2358 |
Screen current nativeFileDialogs ifTrue:[ |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2359 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2360 |
^ Win32FileDialog |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2361 |
fileDialogFor:nil |
4181 | 2362 |
save:forSave |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2363 |
title:titleString |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2364 |
inDirectory:aDirectoryPathOrNil |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2365 |
initialAnswer:defaultName |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2366 |
filter:pattern |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2367 |
extension:nil |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2368 |
]. |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2369 |
]. |
2620 | 2370 |
UserPreferences current useNewFileDialog ifTrue:[ |
3575
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2371 |
^ FileDialog |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2372 |
requestFileName:titleString |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2373 |
default:defaultName |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2374 |
ok:okText abort:abortText |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2375 |
pattern:pattern |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2376 |
fromDirectory:aDirectoryPathOrNil |
01ed1cd65ff8
more native stuff (preparation only)
Claus Gittinger <cg@exept.de>
parents:
3574
diff
changeset
|
2377 |
whenBoxCreatedEvaluate:boxCreatedCallback |
2620 | 2378 |
]. |
2379 |
||
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2380 |
defaultNm := defaultName. |
2218 | 2381 |
defaultDir := aDirectoryPathOrNil. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2382 |
defaultDir isNil ifTrue:[ |
2218 | 2383 |
defaultNm notNil ifTrue:[ |
2384 |
defaultDir := defaultName asFilename directoryName. |
|
2385 |
defaultNm := defaultNm asFilename baseName. |
|
2386 |
defaultDir = Filename currentDirectory name ifTrue:[ |
|
2387 |
defaultName asFilename isExplicitRelative ifFalse:[ |
|
2388 |
defaultDir := nil |
|
2389 |
] |
|
2390 |
] |
|
2391 |
]. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2392 |
]. |
197 | 2393 |
|
2394 |
box := FileSelectionBox |
|
2218 | 2395 |
title:titleString |
2396 |
okText:okText |
|
2397 |
abortText:abortText |
|
2398 |
action:[:fileName | enteredName := fileName]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2399 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2400 |
defaultDir notNil ifTrue:[ |
2218 | 2401 |
box directory:defaultDir |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2402 |
] ifFalse:[ |
2218 | 2403 |
dir := FileSelectionBox lastFileSelectionDirectory. |
2404 |
dir notNil ifTrue:[ |
|
2405 |
box directory:dir. |
|
2406 |
]. |
|
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2407 |
]. |
197 | 2408 |
box pattern:pattern. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2409 |
box initialText:defaultNm. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2410 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2411 |
|
2412 |
self showAndThenDestroyBox:box. |
|
197 | 2413 |
box action:nil. |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2414 |
|
3237
4c6fe0664cab
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
3234
diff
changeset
|
2415 |
(enteredName notEmptyOrNil) ifTrue:[ |
2218 | 2416 |
FileSelectionBox lastFileSelectionDirectory:(enteredName asFilename directoryName). |
1360
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2417 |
]. |
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2418 |
|
ede30cea2827
also remember last directory in requestFileName dialogs
Claus Gittinger <cg@exept.de>
parents:
1355
diff
changeset
|
2419 |
^ enteredName |
197 | 2420 |
|
2421 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2422 |
Dialog |
2218 | 2423 |
requestFileName:'enter a fileName:' |
2424 |
default:'' |
|
2425 |
ok:'yeah' |
|
2426 |
abort:'oh, no' |
|
2427 |
pattern:'rc*' |
|
2428 |
fromDirectory:'/etc' |
|
197 | 2429 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2430 |
|
4164 | 2431 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
4181 | 2432 |
"Created: / 27-10-2010 / 11:21:05 / cg" |
2433 |
! |
|
2434 |
||
2435 |
requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
2436 |
"launch a Dialog, which allows user to enter a filename. |
|
2437 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2438 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2439 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2440 |
The matchPattern is set to pattern initially. |
|
2441 |
Return the string, or nil if cancel was pressed." |
|
2442 |
||
2443 |
^ self |
|
2444 |
requestFileName:titleString |
|
2445 |
default:defaultName |
|
2446 |
ok:okText |
|
2447 |
abort:abortText |
|
2448 |
pattern:pattern |
|
2449 |
fromDirectory:aDirectoryPathOrNil |
|
2450 |
forSave:false |
|
2451 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2452 |
||
2453 |
" |
|
2454 |
Dialog |
|
2455 |
requestFileName:'enter a fileName:' |
|
2456 |
default:'' |
|
2457 |
ok:'yeah' |
|
2458 |
abort:'oh, no' |
|
2459 |
pattern:'rc*' |
|
2460 |
fromDirectory:'/etc' |
|
2461 |
" |
|
2462 |
||
2463 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
2464 |
"Modified: / 27-10-2010 / 11:21:44 / cg" |
|
197 | 2465 |
! |
2466 |
||
2631 | 2467 |
requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean |
2468 |
"launch a Dialog, which allows user to enter a filename. |
|
2469 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
2470 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
2471 |
The box will show okText in its okButton, abortText in the abortButton. |
|
2472 |
The matchPattern is set to pattern initially. |
|
2473 |
Return the string, or nil if cancel was pressed |
|
2474 |
The version argument allows validation of the files existance; |
|
2475 |
it may be any of: |
|
2476 |
#mustBeNew - fail (return empty string) if the file exists |
|
2477 |
#new - confirm if the file exists |
|
2478 |
#mustBeOld - fail if the file does not exist |
|
2479 |
#old - confirm if the file does not exist |
|
2480 |
#any (other) - no validation |
|
2481 |
" |
|
2482 |
||
2483 |
^ FileDialog |
|
2484 |
requestFileName:titleString |
|
2485 |
default:defaultName |
|
2486 |
ok:okText |
|
2487 |
abort:abortText |
|
2488 |
version:versionSymbol |
|
2489 |
ifFail:failBlock |
|
2490 |
pattern:pattern |
|
2491 |
fromDirectory:aDirectoryPath |
|
2492 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2493 |
asLoadDialog:aBoolean. |
|
2494 |
! |
|
2495 |
||
1030 | 2496 |
requestFileName:titleString default:defaultName pattern:pattern |
2497 |
"launch a Dialog, which allows user to enter a filename. |
|
2498 |
The files presented initially are those from the current directory. |
|
2499 |
The box will show ok/cancel in its buttons. |
|
2500 |
The matchPattern is set to pattern initially. |
|
2501 |
Return the string or nil if cancel was pressed." |
|
2502 |
||
2415 | 2503 |
|resources| |
2504 |
||
2505 |
resources := self classResources. |
|
1030 | 2506 |
^ self |
2415 | 2507 |
requestFileName:titleString |
2508 |
default:defaultName |
|
3276 | 2509 |
ok:(resources string:'OK') |
2415 | 2510 |
abort:(resources string:'Cancel') |
2511 |
pattern:pattern |
|
2512 |
fromDirectory:nil |
|
1030 | 2513 |
|
2514 |
" |
|
2515 |
Dialog |
|
2415 | 2516 |
requestFileName:'enter a fileName:' |
2517 |
default:'' |
|
2518 |
pattern:'*.st' |
|
1030 | 2519 |
" |
2520 |
" |
|
2521 |
Dialog |
|
2415 | 2522 |
requestFileName:'enter a fileName:' |
2523 |
default:'' |
|
2524 |
pattern:'*.st;*.h' |
|
1030 | 2525 |
" |
2526 |
||
2527 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2528 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2529 |
! |
|
2530 |
||
2525 | 2531 |
requestFileName:titleString default:defaultName pattern:pattern fromDirectory:aDirectory |
2532 |
"launch a Dialog, which allows user to enter a filename. |
|
2533 |
The files presented initially are those from the current directory. |
|
2534 |
The box will show ok/cancel in its buttons. |
|
2535 |
The matchPattern is set to pattern initially. |
|
2536 |
Return the string or nil if cancel was pressed." |
|
2537 |
||
2538 |
|resources| |
|
2539 |
||
2540 |
resources := self classResources. |
|
2541 |
^ self |
|
2542 |
requestFileName:titleString |
|
2543 |
default:defaultName |
|
3276 | 2544 |
ok:(resources string:'OK') |
2525 | 2545 |
abort:(resources string:'Cancel') |
2546 |
pattern:pattern |
|
2547 |
fromDirectory:aDirectory |
|
2548 |
||
2549 |
" |
|
2550 |
Dialog |
|
2551 |
requestFileName:'enter a fileName:' |
|
2552 |
default:'' |
|
2553 |
pattern:'*.st' |
|
2554 |
" |
|
2555 |
" |
|
2556 |
Dialog |
|
2557 |
requestFileName:'enter a fileName:' |
|
2558 |
default:'' |
|
2559 |
pattern:'*.st;*.h' |
|
2560 |
" |
|
2561 |
||
2562 |
"Created: 21.2.1997 / 11:16:52 / cg" |
|
2563 |
"Modified: 21.2.1997 / 11:18:40 / cg" |
|
2564 |
! |
|
2565 |
||
100 | 2566 |
requestFileName:titleString default:defaultName version:versionSymbol |
2567 |
"launch a Dialog, which allows user to enter a filename. |
|
2568 |
The box will not allow pressing 'ok' without an entered string. |
|
2569 |
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
|
2570 |
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
|
2571 |
it may be any of: |
1401 | 2572 |
#mustBeNew - fail (return empty string) if the file exists |
2573 |
#new - confirm if the file exists |
|
2574 |
#mustBeOld - fail if the file does not exist |
|
2575 |
#old - confirm if the file does not exist |
|
2576 |
#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
|
2577 |
" |
100 | 2578 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2579 |
^ self |
1401 | 2580 |
requestFileName:titleString |
2581 |
default:defaultName |
|
2582 |
version:versionSymbol |
|
2583 |
ifFail:'' |
|
100 | 2584 |
|
2585 |
" |
|
2586 |
Dialog requestFileName:'enter a fileName:' |
|
1401 | 2587 |
default:'' |
2588 |
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
|
2589 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2590 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2591 |
default:'' |
2592 |
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
|
2593 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2594 |
Dialog requestFileName:'enter a fileName:' |
1401 | 2595 |
default:'' |
2596 |
version:#new |
|
100 | 2597 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2598 |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2599 |
"Modified: 19.4.1996 / 13:53:58 / cg" |
100 | 2600 |
! |
2601 |
||
2602 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
2603 |
"launch a Dialog, which allows user to enter a filename. |
|
2604 |
The box will not allow pressing 'ok' without an entered string. |
|
2605 |
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
|
2606 |
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
|
2607 |
it may be any of: |
1401 | 2608 |
#mustBeNew - fail (return empty string) if the file exists |
2609 |
#new - confirm if the file exists |
|
2610 |
#mustBeOld - fail if the file does not exist |
|
2611 |
#old - confirm if the file does not exist |
|
2612 |
#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
|
2613 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2614 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2615 |
^ self |
1401 | 2616 |
requestFileName:titleString |
2617 |
default:defaultName |
|
2618 |
version:versionSymbol |
|
2619 |
ifFail:failBlock |
|
2620 |
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
|
2621 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2622 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2623 |
Dialog |
1401 | 2624 |
requestFileName:'enter a fileName:' |
2625 |
default:'' |
|
2626 |
version:nil |
|
2627 |
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
|
2628 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2629 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2630 |
Dialog |
1401 | 2631 |
requestFileName:'enter a fileName:' |
2632 |
default:'' |
|
2633 |
version:#old |
|
2634 |
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
|
2635 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2636 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2637 |
"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
|
2638 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2639 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2640 |
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
|
2641 |
"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
|
2642 |
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
|
2643 |
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
|
2644 |
it may be any of: |
1736 | 2645 |
#mustBeNew - fail (return empty string) if the file exists |
2646 |
#new - confirm if the file exists |
|
2647 |
#mustBeOld - fail if the file does not exist |
|
2648 |
#old - confirm if the file does not exist |
|
2649 |
#any (other) - no validation |
|
2650 |
" |
|
2651 |
||
2652 |
^ self |
|
2653 |
requestFileName:titleString |
|
2654 |
default:defaultName |
|
2655 |
version:versionSymbol |
|
2656 |
ifFail:failBlock |
|
2657 |
pattern:nil |
|
2658 |
fromDirectory:aDirectoryPath |
|
1031 | 2659 |
|
2660 |
" |
|
2661 |
Dialog |
|
1736 | 2662 |
requestFileName:'enter a fileName:' |
2663 |
default:'' |
|
2664 |
version:nil |
|
2665 |
ifFail:['none'] |
|
2666 |
fromDirectory:'/etc' |
|
1031 | 2667 |
" |
2668 |
" |
|
2669 |
Dialog |
|
1736 | 2670 |
requestFileName:'enter a fileName:' |
2671 |
default:'' |
|
2672 |
version:#old |
|
2673 |
ifFail:['none'] |
|
2674 |
fromDirectory:'/etc' |
|
1031 | 2675 |
" |
2676 |
" |
|
2677 |
Dialog |
|
1736 | 2678 |
requestFileName:'enter a fileName:' |
2679 |
default:'' |
|
2680 |
version:#mustBeNew |
|
2681 |
ifFail:['none'] |
|
2682 |
fromDirectory:'/etc' |
|
1031 | 2683 |
" |
2684 |
||
2685 |
"Modified: 20.2.1997 / 18:12:28 / cg" |
|
2686 |
"Modified: 21.2.1997 / 14:27:27 / stefan" |
|
2687 |
! |
|
2688 |
||
2689 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
2690 |
"launch a Dialog, which allows user to enter a filename. |
|
2691 |
Return the string or the value of failBlock if cancel was pressed. |
|
2692 |
The version argument allows validation of the files existance; |
|
2693 |
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
|
2694 |
#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
|
2695 |
#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
|
2696 |
#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
|
2697 |
#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
|
2698 |
#any (other) - no validation |
1031 | 2699 |
" |
2700 |
||
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2701 |
^ self |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2702 |
requestFileName:titleString |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2703 |
default:defaultName |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2704 |
version:versionSymbol |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2705 |
ifFail:failBlock |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2706 |
pattern:pattern |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2707 |
fromDirectory:aDirectoryPath |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2708 |
whenBoxCreatedEvaluate:nil |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2709 |
! |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2710 |
|
4181 | 2711 |
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
|
2712 |
"launch a Dialog, which allows user to enter a filename. |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2713 |
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
|
2714 |
The version argument allows validation of the files existance; |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2715 |
it may be any of: |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2716 |
#mustBeNew - fail (return empty string) if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2717 |
#new - confirm if the file exists |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2718 |
#mustBeOld - fail if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2719 |
#old - confirm if the file does not exist |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2720 |
#any (other) - no validation |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2721 |
" |
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2722 |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2723 |
|box defaultDir defaultNm| |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2724 |
|
4164 | 2725 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 2726 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
2727 |
^ Win32FileDialog |
|
2728 |
fileDialogFor:nil |
|
4181 | 2729 |
save:forSave |
3574 | 2730 |
title:titleString |
2731 |
inDirectory:aDirectoryPath |
|
2732 |
initialAnswer:defaultName |
|
2733 |
filter:pattern |
|
2734 |
extension:nil |
|
2735 |
]. |
|
2736 |
]. |
|
2737 |
||
2621 | 2738 |
UserPreferences current useNewFileDialog ifTrue:[ |
2769 | 2739 |
^ FileDialog |
2740 |
requestFileName:titleString |
|
2741 |
default:defaultName |
|
2742 |
version:versionSymbol |
|
2743 |
ifFail:failBlock |
|
2744 |
pattern:pattern |
|
2745 |
fromDirectory:aDirectoryPath |
|
2746 |
whenBoxCreatedEvaluate:boxCreatedCallback. |
|
2621 | 2747 |
]. |
2773 | 2748 |
defaultName notNil ifTrue:[defaultNm := defaultName asFilename name]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2749 |
defaultDir := aDirectoryPath. |
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2750 |
defaultDir isNil ifTrue:[ |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2751 |
defaultNm notNil ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2752 |
defaultName asFilename withoutSuffix baseName = '*' ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2753 |
defaultDir := FileSelectionBox lastFileSelectionDirectory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2754 |
defaultNm := ''. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2755 |
] ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2756 |
defaultDir := defaultName asFilename directoryName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2757 |
defaultNm := defaultNm asFilename baseName. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2758 |
] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2759 |
]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2760 |
]. |
100 | 2761 |
|
2762 |
box := FileSelectionBox title:titleString. |
|
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2763 |
defaultDir notNil ifTrue:[box directory:defaultDir]. |
1031 | 2764 |
pattern notNil ifTrue:[box pattern:pattern]. |
1029
ddc27f751b3d
allow path as default in requestFileName;
Claus Gittinger <cg@exept.de>
parents:
1004
diff
changeset
|
2765 |
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
|
2766 |
box action:[:name | |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2767 |
versionSymbol == #mustBeNew ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2768 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2769 |
name asFilename exists ifTrue:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2770 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2771 |
versionSymbol == #new ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2772 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2773 |
name asFilename exists ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2774 |
(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
|
2775 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2776 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2777 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2778 |
versionSymbol == #mustBeOld ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2779 |
name asFilename exists ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2780 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2781 |
versionSymbol == #old ifTrue:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2782 |
"/ file may not exist |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2783 |
name asFilename exists ifFalse:[ |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2784 |
(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
|
2785 |
ifFalse:[^ '']. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2786 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2787 |
]. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2788 |
FileSelectionBox lastFileSelectionDirectory:box directory. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2789 |
box destroy. |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2790 |
^ 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
|
2791 |
]. |
2355
986d96f5ff6c
added postCreateCallBack option
Claus Gittinger <cg@exept.de>
parents:
2332
diff
changeset
|
2792 |
boxCreatedCallback notNil ifTrue:[boxCreatedCallback value:box]. |
2439 | 2793 |
self showAndThenDestroyBox:box. |
100 | 2794 |
box action:nil. |
2795 |
^ failBlock value |
|
2796 |
||
2797 |
" |
|
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2798 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2799 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2800 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2801 |
version:nil |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2802 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2803 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2804 |
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
|
2805 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2806 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2807 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2808 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2809 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2810 |
version:#old |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2811 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2812 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2813 |
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
|
2814 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2815 |
" |
549
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2816 |
Dialog |
1575
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2817 |
requestFileName:'enter a fileName:' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2818 |
default:'' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2819 |
version:#mustBeNew |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2820 |
ifFail:['none'] |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2821 |
pattern:'*.conf' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2822 |
fromDirectory:'/etc' |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2823 |
" |
a30ae9842432
use lastFileSelection if requesting a file without given dir,
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2824 |
|
4181 | 2825 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
2826 |
"Created: / 27-10-2010 / 10:38:10 / cg" |
|
2827 |
! |
|
2828 |
||
2829 |
requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback |
|
2830 |
"launch a Dialog, which allows user to enter a filename. |
|
2831 |
Return the string or the value of failBlock if cancel was pressed. |
|
2832 |
The version argument allows validation of the files existance; |
|
2833 |
it may be any of: |
|
2834 |
#mustBeNew - fail (return empty string) if the file exists |
|
2835 |
#new - confirm if the file exists |
|
2836 |
#mustBeOld - fail if the file does not exist |
|
2837 |
#old - confirm if the file does not exist |
|
2838 |
#any (other) - no validation |
|
2839 |
" |
|
2840 |
||
2841 |
^ self |
|
2842 |
requestFileName:titleString |
|
2843 |
default:defaultName |
|
2844 |
version:versionSymbol |
|
2845 |
ifFail:failBlock |
|
2846 |
pattern:pattern |
|
2847 |
fromDirectory:aDirectoryPath |
|
2848 |
forSave:false |
|
2849 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
2850 |
||
2851 |
" |
|
2852 |
Dialog |
|
2853 |
requestFileName:'enter a fileName:' |
|
2854 |
default:'' |
|
2855 |
version:nil |
|
2856 |
ifFail:['none'] |
|
2857 |
pattern:'*.conf' |
|
2858 |
fromDirectory:'/etc' |
|
2859 |
" |
|
2860 |
" |
|
2861 |
Dialog |
|
2862 |
requestFileName:'enter a fileName:' |
|
2863 |
default:'' |
|
2864 |
version:#old |
|
2865 |
ifFail:['none'] |
|
2866 |
pattern:'*.conf' |
|
2867 |
fromDirectory:'/etc' |
|
2868 |
" |
|
2869 |
" |
|
2870 |
Dialog |
|
2871 |
requestFileName:'enter a fileName:' |
|
2872 |
default:'' |
|
2873 |
version:#mustBeNew |
|
2874 |
ifFail:['none'] |
|
2875 |
pattern:'*.conf' |
|
2876 |
fromDirectory:'/etc' |
|
2877 |
" |
|
2878 |
||
4164 | 2879 |
"Created: / 21-02-1997 / 14:23:44 / stefan" |
2880 |
"Modified: / 24-08-2010 / 17:29:04 / sr" |
|
4181 | 2881 |
"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
|
2882 |
! |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2883 |
|
3877 | 2884 |
requestFileName:titleString fromDirectory:aDirectory |
2885 |
"launch a Dialog, which allows user to enter a filename. |
|
2886 |
The files presented initially are those from the current directory. |
|
2887 |
The box will show ok/cancel in its buttons. |
|
2888 |
Return the string or nil if cancel was pressed." |
|
2889 |
||
2890 |
^ self |
|
2891 |
requestFileName:titleString |
|
2892 |
default:nil |
|
2893 |
pattern:'*' |
|
2894 |
fromDirectory:aDirectory |
|
2895 |
||
2896 |
" |
|
2897 |
Dialog |
|
2898 |
requestFileName:'enter a fileName:' |
|
2899 |
fromDirectory:'../../libbasic' |
|
2900 |
" |
|
2901 |
! |
|
2902 |
||
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2903 |
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
|
2904 |
"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
|
2905 |
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
|
2906 |
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
|
2907 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2908 |
^ self |
2637
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2909 |
requestFileName:titleString |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2910 |
default:'file.ext' |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2911 |
version:nil |
1142eda23f83
added requestFileName:default:ifFail::
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
2912 |
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
|
2913 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2914 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2915 |
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
|
2916 |
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
|
2917 |
" |
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2918 |
|
c9d438ab85ce
moved all file request methods (class protocol) to DialogBox; added directory dialogs
Claus Gittinger <cg@exept.de>
parents:
535
diff
changeset
|
2919 |
"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
|
2920 |
"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
|
2921 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
2922 |
|
2524 | 2923 |
requestFileName:titleString pattern:pattern |
2924 |
"launch a Dialog, which allows user to enter a filename. |
|
2925 |
The files presented initially are those from the current directory. |
|
2926 |
The box will show ok/cancel in its buttons. |
|
2927 |
The matchPattern is set to pattern initially. |
|
2928 |
Return the string or nil if cancel was pressed." |
|
2929 |
||
2930 |
^ self |
|
2931 |
requestFileName:titleString |
|
2932 |
default:nil |
|
2933 |
pattern:pattern |
|
2934 |
||
2935 |
" |
|
2936 |
Dialog |
|
2937 |
requestFileName:'enter a fileName:' |
|
2938 |
pattern:'*.st' |
|
2939 |
" |
|
2940 |
" |
|
2941 |
Dialog |
|
2942 |
requestFileName:'enter a fileName:' |
|
2943 |
pattern:'*.st;*.h' |
|
2944 |
" |
|
2945 |
! |
|
2946 |
||
2525 | 2947 |
requestFileName:titleString pattern:pattern fromDirectory:aDirectory |
2948 |
"launch a Dialog, which allows user to enter a filename. |
|
2949 |
The files presented initially are those from the current directory. |
|
2950 |
The box will show ok/cancel in its buttons. |
|
2951 |
The matchPattern is set to pattern initially. |
|
2952 |
Return the string or nil if cancel was pressed." |
|
2953 |
||
2954 |
^ self |
|
2955 |
requestFileName:titleString |
|
2956 |
default:nil |
|
2957 |
pattern:pattern |
|
2958 |
fromDirectory:aDirectory |
|
2959 |
" |
|
2960 |
Dialog |
|
2961 |
requestFileName:'enter a fileName:' |
|
2962 |
pattern:'*.st' |
|
2963 |
" |
|
2964 |
" |
|
2965 |
Dialog |
|
2966 |
requestFileName:'enter a fileName:' |
|
2967 |
pattern:'*.st;*.h' |
|
2968 |
" |
|
2969 |
! |
|
2970 |
||
4181 | 2971 |
requestFileNameForSave:titleString |
2972 |
"launch a Dialog, which allows user to enter a filename. |
|
2973 |
Return the pathname string consisting of the full pathname of the filename, |
|
2974 |
or an empty string (if cancel was pressed)." |
|
2975 |
||
2976 |
^ self |
|
2977 |
requestFileNameForSave:titleString |
|
2978 |
default:'file.ext' |
|
2979 |
||
2980 |
" |
|
2981 |
Dialog requestFileName:'enter a fileName:' |
|
2982 |
Dialog requestFileName:'enter a fileName:' |
|
2983 |
" |
|
2984 |
||
2985 |
"Created: / 27-10-2010 / 11:31:52 / cg" |
|
2986 |
! |
|
2987 |
||
2988 |
requestFileNameForSave:titleString default:defaultName |
|
2989 |
"launch a Dialog, which allows user to enter a filename. |
|
2990 |
The box will not allow pressing 'ok' without an entered string. |
|
2991 |
Return the pathname string consisting of the full pathname of the filename, |
|
2992 |
or an empty string (if cancel was pressed)." |
|
2993 |
||
2994 |
^ self |
|
4182
46fec1281cbc
changed: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4181
diff
changeset
|
2995 |
requestFileNameForSave:titleString |
4181 | 2996 |
default:defaultName |
2997 |
version:nil |
|
2998 |
ifFail:'' |
|
2999 |
||
3000 |
" |
|
3001 |
Dialog requestFileName:'enter a fileName:' default:'' |
|
4183
c775db615fdf
comment/format in: #requestFileNameForSave:default:
Claus Gittinger <cg@exept.de>
parents:
4182
diff
changeset
|
3002 |
Dialog requestFileNameForSave:'enter a fileName:' default:'' |
4181 | 3003 |
" |
3004 |
||
3005 |
"Created: / 27-10-2010 / 11:32:06 / cg" |
|
3006 |
! |
|
3007 |
||
3008 |
requestFileNameForSave:titleString default:defaultName fromDirectory:aDirectoryPath |
|
3009 |
"launch a Dialog, which allows user to enter a filename. |
|
3010 |
The box will not allow pressing 'ok' without an entered string. |
|
3011 |
Return the pathname string consisting of the full pathname of the filename, |
|
3012 |
or an empty string (if cancel was pressed)." |
|
3013 |
||
3014 |
^ self |
|
3015 |
requestFileName:titleString |
|
3016 |
default:defaultName |
|
3017 |
version:nil |
|
3018 |
ifFail:'' |
|
3019 |
pattern:nil |
|
3020 |
fromDirectory:aDirectoryPath |
|
3021 |
forSave:true |
|
3022 |
whenBoxCreatedEvaluate:nil |
|
3023 |
||
3024 |
" |
|
3025 |
Dialog |
|
3026 |
requestFileName:'enter a fileName:' |
|
3027 |
default:'Makefile.bak' |
|
3028 |
fromDirectory:'..' |
|
3029 |
" |
|
3030 |
||
3031 |
"Created: / 27-10-2010 / 10:41:04 / cg" |
|
3032 |
! |
|
3033 |
||
3034 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern |
|
3035 |
"launch a Dialog, which allows user to enter a filename. |
|
3036 |
The files presented initially are those from the current directory. |
|
3037 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3038 |
The matchPattern is set to pattern initially. |
|
3039 |
Return the string or nil if cancel was pressed." |
|
3040 |
||
3041 |
^ self |
|
3042 |
requestFileNameForSave:titleString |
|
3043 |
default:defaultName |
|
3044 |
ok:okText |
|
3045 |
abort:abortText |
|
3046 |
pattern:pattern |
|
3047 |
fromDirectory:nil |
|
3048 |
||
3049 |
" |
|
3050 |
Dialog |
|
3051 |
requestFileName:'enter a fileName:' |
|
3052 |
default:'' |
|
3053 |
ok:'yeah' |
|
3054 |
abort:'oh, no' |
|
3055 |
pattern:'*.st' |
|
3056 |
" |
|
3057 |
||
3058 |
"Created: / 27-10-2010 / 11:29:20 / cg" |
|
3059 |
! |
|
3060 |
||
3061 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil |
|
3062 |
"launch a Dialog, which allows user to enter a filename. |
|
3063 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3064 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3065 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3066 |
The matchPattern is set to pattern initially. |
|
3067 |
Return the string, or nil if cancel was pressed." |
|
3068 |
||
3069 |
^ self |
|
3070 |
requestFileName:titleString |
|
3071 |
default:defaultName |
|
3072 |
ok:okText |
|
3073 |
abort:abortText |
|
3074 |
pattern:pattern |
|
3075 |
fromDirectory:aDirectoryPathOrNil |
|
3076 |
forSave:true |
|
3077 |
whenBoxCreatedEvaluate:nil |
|
3078 |
||
3079 |
"Created: / 27-10-2010 / 11:24:37 / cg" |
|
3080 |
! |
|
3081 |
||
3082 |
requestFileNameForSave:titleString default:defaultName ok:okText abort:abortText pattern:pattern fromDirectory:aDirectoryPathOrNil whenBoxCreatedEvaluate:boxCreatedCallback |
|
3083 |
"launch a Dialog, which allows user to enter a filename. |
|
3084 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3085 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3086 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3087 |
The matchPattern is set to pattern initially. |
|
3088 |
Return the string, or nil if cancel was pressed." |
|
3089 |
||
3090 |
^ self |
|
3091 |
requestFileName:titleString |
|
3092 |
default:defaultName |
|
3093 |
ok:okText |
|
3094 |
abort:abortText |
|
3095 |
pattern:pattern |
|
3096 |
fromDirectory:aDirectoryPathOrNil |
|
3097 |
forSave:true |
|
3098 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3099 |
||
3100 |
" |
|
3101 |
Dialog |
|
3102 |
requestFileName:'enter a fileName:' |
|
3103 |
default:'' |
|
3104 |
ok:'yeah' |
|
3105 |
abort:'oh, no' |
|
3106 |
pattern:'rc*' |
|
3107 |
fromDirectory:'/etc' |
|
3108 |
" |
|
3109 |
||
3110 |
"Modified: / 24-08-2010 / 17:28:57 / sr" |
|
3111 |
"Created: / 27-10-2010 / 11:23:40 / cg" |
|
3112 |
! |
|
3113 |
||
3114 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock |
|
3115 |
"launch a Dialog, which allows user to enter a filename. |
|
3116 |
The box will not allow pressing 'ok' without an entered string. |
|
3117 |
Return the string or the value of failBlock if cancel was pressed. |
|
3118 |
The version argument allows validation of the files existance; |
|
3119 |
it may be any of: |
|
3120 |
#mustBeNew - fail (return empty string) if the file exists |
|
3121 |
#new - confirm if the file exists |
|
3122 |
#mustBeOld - fail if the file does not exist |
|
3123 |
#old - confirm if the file does not exist |
|
3124 |
#any (other) - no validation |
|
3125 |
" |
|
3126 |
||
3127 |
^ self |
|
3128 |
requestFileNameForSave:titleString |
|
3129 |
default:defaultName |
|
3130 |
version:versionSymbol |
|
3131 |
ifFail:failBlock |
|
3132 |
fromDirectory:nil |
|
3133 |
||
3134 |
" |
|
3135 |
Dialog |
|
3136 |
requestFileName:'enter a fileName:' |
|
3137 |
default:'' |
|
3138 |
version:nil |
|
3139 |
ifFail:['none'] |
|
3140 |
" |
|
3141 |
" |
|
3142 |
Dialog |
|
3143 |
requestFileName:'enter a fileName:' |
|
3144 |
default:'' |
|
3145 |
version:#old |
|
3146 |
ifFail:['none'] |
|
3147 |
" |
|
3148 |
||
3149 |
"Created: / 27-10-2010 / 11:32:03 / cg" |
|
3150 |
! |
|
3151 |
||
3152 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath |
|
3153 |
"launch a Dialog, which allows user to enter a filename. |
|
3154 |
Return the string or the value of failBlock if cancel was pressed. |
|
3155 |
The version argument allows validation of the files existance; |
|
3156 |
it may be any of: |
|
3157 |
#mustBeNew - fail (return empty string) if the file exists |
|
3158 |
#new - confirm if the file exists |
|
3159 |
#mustBeOld - fail if the file does not exist |
|
3160 |
#old - confirm if the file does not exist |
|
3161 |
#any (other) - no validation |
|
3162 |
" |
|
3163 |
||
3164 |
^ self |
|
3165 |
requestFileNameForSave:titleString |
|
3166 |
default:defaultName |
|
3167 |
version:versionSymbol |
|
3168 |
ifFail:failBlock |
|
3169 |
pattern:nil |
|
3170 |
fromDirectory:aDirectoryPath |
|
3171 |
||
3172 |
" |
|
3173 |
Dialog |
|
3174 |
requestFileName:'enter a fileName:' |
|
3175 |
default:'' |
|
3176 |
version:nil |
|
3177 |
ifFail:['none'] |
|
3178 |
fromDirectory:'/etc' |
|
3179 |
" |
|
3180 |
" |
|
3181 |
Dialog |
|
3182 |
requestFileName:'enter a fileName:' |
|
3183 |
default:'' |
|
3184 |
version:#old |
|
3185 |
ifFail:['none'] |
|
3186 |
fromDirectory:'/etc' |
|
3187 |
" |
|
3188 |
" |
|
3189 |
Dialog |
|
3190 |
requestFileName:'enter a fileName:' |
|
3191 |
default:'' |
|
3192 |
version:#mustBeNew |
|
3193 |
ifFail:['none'] |
|
3194 |
fromDirectory:'/etc' |
|
3195 |
" |
|
3196 |
||
3197 |
"Modified: / 21-02-1997 / 14:27:27 / stefan" |
|
3198 |
"Created: / 27-10-2010 / 11:32:22 / cg" |
|
3199 |
! |
|
3200 |
||
3201 |
requestFileNameForSave:titleString default:defaultName version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath |
|
3202 |
"launch a Dialog, which allows user to enter a filename. |
|
3203 |
Return the string or the value of failBlock if cancel was pressed. |
|
3204 |
The version argument allows validation of the files existance; |
|
3205 |
it may be any of: |
|
3206 |
#mustBeNew - fail (return empty string) if the file exists |
|
3207 |
#new - confirm if the file exists |
|
3208 |
#mustBeOld - fail if the file does not exist |
|
3209 |
#old - confirm if the file does not exist |
|
3210 |
#any (other) - no validation |
|
3211 |
" |
|
3212 |
||
3213 |
^ self |
|
3214 |
requestFileName:titleString |
|
3215 |
default:defaultName |
|
3216 |
version:versionSymbol |
|
3217 |
ifFail:failBlock |
|
3218 |
pattern:pattern |
|
3219 |
fromDirectory:aDirectoryPath |
|
3220 |
forSave:true |
|
3221 |
whenBoxCreatedEvaluate:nil |
|
3222 |
||
3223 |
"Created: / 27-10-2010 / 11:32:55 / cg" |
|
3224 |
! |
|
3225 |
||
2631 | 3226 |
requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog |
3227 |
"launch a Dialog, which allows user to enter a filename. |
|
3228 |
The files presented initially are those in aDirectoryPathOrNil, or the |
|
3229 |
last fileBox directory (default: current directory) (if a nil path is given). |
|
3230 |
The box will show okText in its okButton, abortText in the abortButton. |
|
3231 |
The matchPattern is set to pattern initially. |
|
3232 |
Return all selected Filenames as filenames in a collection, or nil if cancel was pressed |
|
3233 |
" |
|
3234 |
||
3235 |
^ FileDialog |
|
3236 |
requestFileNames:titleString |
|
3237 |
default:defaultName |
|
3238 |
ok:okText |
|
3239 |
abort:abortText |
|
3240 |
ifFail:failBlock |
|
3241 |
pattern:pattern |
|
3242 |
fromDirectory:aDirectoryPath |
|
3243 |
whenBoxCreatedEvaluate:boxCreatedCallback |
|
3244 |
asLoadDialog:asLoadDialog. |
|
3245 |
! |
|
3246 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3247 |
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
|
3248 |
"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
|
3249 |
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
|
3250 |
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
|
3251 |
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
|
3252 |
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
|
3253 |
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
|
3254 |
|
1736 | 3255 |
^ self |
3256 |
requestFileName:titleString |
|
3257 |
default:defaultName |
|
3258 |
version:#new |
|
3259 |
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
|
3260 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3261 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3262 |
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
|
3263 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3264 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3265 |
"Modified: 27.1.1996 / 13:44:13 / cg" |
2694 | 3266 |
! |
3267 |
||
3268 |
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction:appendActionOrNil |
|
3418 | 3269 |
"save contents into a file - ask user for filename using a fileSelectionBox. |
3270 |
Append is NOT offered, if appendActionOrNil is nil." |
|
2694 | 3271 |
|
2789 | 3272 |
|doAppend fileBox fileName dialog default resources| |
2694 | 3273 |
|
3274 |
default := defaultOrNil. |
|
3275 |
default notNil ifTrue:[ default := default asString]. |
|
3276 |
||
2789 | 3277 |
resources := self classResources. |
3278 |
||
4164 | 3279 |
Screen current nativeFileDialogs ifTrue:[ |
3574 | 3280 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
3281 |
appendActionOrNil isNil ifTrue:[ |
|
3282 |
^ Win32FileDialog |
|
3283 |
fileDialogFor:nil |
|
3284 |
save:true |
|
3285 |
title:title |
|
3286 |
inDirectory:directoryOrNil |
|
3287 |
initialAnswer:default |
|
3288 |
filter:nil |
|
3289 |
extension:nil |
|
3290 |
]. |
|
3291 |
]. |
|
3292 |
]. |
|
3293 |
||
2694 | 3294 |
UserPreferences current useNewFileDialog ifTrue:[ |
3295 |
fileName := FileDialog |
|
3296 |
requestFileName:title |
|
3297 |
default:default |
|
2789 | 3298 |
ok:(resources string:'Save') |
2694 | 3299 |
abort:nil |
3300 |
version:nil |
|
3301 |
ifFail:nil |
|
3302 |
pattern:nil |
|
3303 |
fromDirectory:directoryOrNil |
|
3304 |
whenBoxCreatedEvaluate:[:box | (dialog := box) appendButtonVisibleHolder value:appendActionOrNil notNil]. |
|
3305 |
||
3306 |
doAppend := dialog appendWasPressed |
|
3307 |
] ifFalse:[ |
|
3308 |
fileBox := FileSaveBox |
|
3309 |
title:title |
|
2789 | 3310 |
okText:(resources string:'Save') |
3311 |
abortText:(resources string:'Cancel') |
|
2694 | 3312 |
action:[:fn | doAppend := false. fileName := fn]. |
3313 |
fileBox appendAction:[:fn | doAppend := true. fileName := fn]. |
|
3314 |
directoryOrNil notNil ifTrue:[ fileBox directory:directoryOrNil]. |
|
3315 |
default notNil ifTrue:[fileBox initialText:default]. |
|
3316 |
fileBox showAtPointer. |
|
3317 |
fileBox destroy. |
|
3318 |
]. |
|
3319 |
||
3320 |
fileName size > 0 ifTrue:[ |
|
2705
a7c0e46f20fb
requestSaveFileName:title default:defaultOrNil fromDirectory:directoryOrNil action:action appendAction
tm
parents:
2700
diff
changeset
|
3321 |
(doAppend ifTrue:[appendActionOrNil] ifFalse:[action]) |
2694 | 3322 |
value:fileName |
3323 |
]. |
|
3324 |
^ self. |
|
3418 | 3325 |
|
3326 |
" |
|
3327 |
Dialog |
|
3328 |
requestSaveFileName:'Save dialog example with append' |
|
3329 |
default:'xxx.txt' |
|
3330 |
fromDirectory:(Filename homeDirectory) |
|
3331 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3332 |
appendAction:[:fn | Transcript showCR:'append ',fn] |
|
3333 |
||
3334 |
Dialog |
|
3335 |
requestSaveFileName:'Save dialog example' |
|
3336 |
default:'xxx.txt' |
|
3337 |
fromDirectory:(Filename homeDirectory) |
|
3338 |
action:[:fn | Transcript showCR:'save ',fn] |
|
3339 |
appendAction:nil |
|
3340 |
" |
|
3341 |
||
3342 |
"Modified: / 27-10-2006 / 09:47:01 / cg" |
|
4164 | 3343 |
"Modified: / 24-08-2010 / 17:29:12 / sr" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3344 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3345 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
3346 |
!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
|
3347 |
|
2315 | 3348 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3349 |
"return a dialog asking for multiline text. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3350 |
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
|
3351 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3352 |
^ self |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3353 |
forRequestText:title |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3354 |
editViewClass:EditTextView |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3355 |
lines:numLines columns:numCols |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3356 |
initialAnswer:initialText model:textModel |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3357 |
setupWith: |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3358 |
[:textView :dialog| |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3359 |
textView model:textModel. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3360 |
textView acceptChannel:(dialog acceptChannel). |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3361 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3362 |
] |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3363 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3364 |
"Modified: / 12-10-2006 / 13:59:21 / cg" |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3365 |
! |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3366 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3367 |
forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel setupWith:aSetupBlockOrNil |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3368 |
"return a dialog asking for multiline text. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3369 |
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
|
3370 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3371 |
|dialog textView| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3372 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3373 |
dialog := self new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3374 |
(dialog addTextLabel:(self classResources string:title)) adjust:#left. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3375 |
textView := dialog addTextBoxOn:nil |
2315 | 3376 |
class:editViewClass |
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3377 |
withNumberOfLines:numLines |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3378 |
hScrollable:true |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3379 |
vScrollable:true. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3380 |
dialog width:(textView preferredExtentForLines:numLines cols:numCols) x. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3381 |
dialog addAbortAndOkButtons. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3382 |
dialog okButton isReturnButton:false. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3383 |
dialog makeTabable:textView. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3384 |
dialog stickAtBottomWithVariableHeight:textView. |
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3385 |
|
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3386 |
aSetupBlockOrNil notNil ifTrue:[ |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3387 |
aSetupBlockOrNil valueWithOptionalArgument:textView and:dialog |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3388 |
]. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3389 |
textModel notNil ifTrue:[ |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3390 |
textModel value:initialText. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3391 |
]. |
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3392 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3393 |
^ dialog |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3394 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3395 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3396 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3397 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3398 |
textHolder := ValueHolder new. |
2315 | 3399 |
dialog := Dialog |
3400 |
forRequestText:'foo' |
|
3401 |
editViewClass:EditTextView |
|
3402 |
lines:10 columns:40 |
|
3403 |
initialAnswer:'hello' model:textHolder. |
|
3404 |
dialog open. |
|
3405 |
dialog accepted ifTrue:[ |
|
3406 |
^ textHolder value |
|
3407 |
]. |
|
3408 |
^ nil |
|
3409 |
" |
|
3410 |
||
3411 |
" |
|
3412 |
|dialog textHolder| |
|
3413 |
||
3414 |
textHolder := ValueHolder new. |
|
3415 |
dialog := Dialog |
|
3416 |
forRequestText:'foo' |
|
3417 |
editViewClass:CodeView |
|
3418 |
lines:10 columns:40 |
|
3419 |
initialAnswer:'hello' model:textHolder. |
|
3420 |
dialog open. |
|
3421 |
dialog accepted ifTrue:[ |
|
3422 |
^ textHolder value |
|
3423 |
]. |
|
3424 |
^ nil |
|
3425 |
" |
|
3426 |
||
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3427 |
"Created: / 12-10-2006 / 13:59:27 / cg" |
2315 | 3428 |
! |
3429 |
||
3430 |
forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textModel |
|
3431 |
"return a dialog asking for multiline text. |
|
3432 |
The box is not shown yet, for further customization" |
|
3433 |
||
3434 |
^ self |
|
3435 |
forRequestText:title |
|
3436 |
editViewClass:EditTextView |
|
3437 |
lines:numLines columns:numCols |
|
3438 |
initialAnswer:initialText model:textModel |
|
3439 |
||
3440 |
" |
|
3441 |
|dialog textHolder| |
|
3442 |
||
3443 |
textHolder := ValueHolder new. |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3444 |
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
|
3445 |
dialog open. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3446 |
dialog accepted ifTrue:[ |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3447 |
^ textHolder value |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3448 |
]. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3449 |
^ nil |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3450 |
" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3451 |
|
3407
bad82e62870f
callBack hook in list/text-dialog
Claus Gittinger <cg@exept.de>
parents:
3404
diff
changeset
|
3452 |
"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
|
3453 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
3454 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3455 |
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
|
3456 |
"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
|
3457 |
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
|
3458 |
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
|
3459 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3460 |
^ self |
2439 | 3461 |
request:aString |
3462 |
displayAt:nil |
|
3463 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
3464 |
action:nil |
|
3465 |
initialAnswer:'' |
|
3466 |
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
|
3467 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3468 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3469 |
Dialog |
2439 | 3470 |
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
|
3471 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3472 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3473 |
"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
|
3474 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3475 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3476 |
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
|
3477 |
"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
|
3478 |
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
|
3479 |
that point. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3480 |
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
|
3481 |
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
|
3482 |
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
|
3483 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3484 |
^ self |
2444 | 3485 |
request:aString |
3486 |
displayAt:aPoint |
|
3487 |
centered:centered |
|
3488 |
action:resultAction |
|
3489 |
initialAnswer:initial |
|
3490 |
okLabel:nil |
|
3491 |
cancelLabel:nil |
|
3492 |
title:nil |
|
4093 | 3493 |
onCancel:nil |
2444 | 3494 |
list:nil |
3495 |
initialSelection:nil |
|
3496 |
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
|
3497 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3498 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3499 |
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
|
3500 |
|
2444 | 3501 |
Dialog |
2548 | 3502 |
request:'Enter a string:' |
2444 | 3503 |
displayAt:200@200 |
3504 |
centered:true |
|
3505 |
action:[:result | result printNewline] |
|
3506 |
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
|
3507 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3508 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3509 |
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
|
3510 |
|
2444 | 3511 |
Dialog |
2548 | 3512 |
request:'Enter a string:' |
2444 | 3513 |
displayAt:200@200 |
3514 |
centered:false |
|
3515 |
action:[:result | result printNewline] |
|
3516 |
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
|
3517 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3518 |
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
|
3519 |
|
2444 | 3520 |
Dialog |
2548 | 3521 |
request:'Enter a string:' |
2444 | 3522 |
displayAt:nil |
3523 |
centered:false |
|
3524 |
action:[:result | result printNewline] |
|
3525 |
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
|
3526 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3527 |
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
|
3528 |
|
2444 | 3529 |
Dialog |
2548 | 3530 |
request:'Enter a string:' |
2444 | 3531 |
displayAt:nil |
3532 |
centered:true |
|
3533 |
action:[:result | result printNewline] |
|
3534 |
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
|
3535 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3536 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3537 |
"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
|
3538 |
"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
|
3539 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3540 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3541 |
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
|
3542 |
"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
|
3543 |
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
|
3544 |
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
|
3545 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3546 |
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
|
3547 |
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
|
3548 |
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
|
3549 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3550 |
^ self |
2444 | 3551 |
request:aString |
3552 |
displayAt:aPoint |
|
3553 |
centered:centered |
|
3554 |
action:resultAction |
|
3555 |
initialAnswer:initial |
|
3556 |
okLabel:okLabel |
|
3557 |
cancelLabel:cancelLabel |
|
3558 |
title:nil |
|
3559 |
onCancel:cancelValue |
|
3560 |
list:nil |
|
3561 |
initialSelection:nil |
|
3562 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3563 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3564 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3565 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 3566 |
Dialog |
2548 | 3567 |
request:'Enter a string:' |
2444 | 3568 |
displayAt:0@0 |
3569 |
centered:true |
|
3570 |
action:[:result | result printNewline] |
|
3571 |
initialAnswer:'the default' |
|
2548 | 3572 |
okLabel:'Yes' |
3573 |
cancelLabel:'No' |
|
2444 | 3574 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3575 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3576 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3577 |
|
2444 | 3578 |
Dialog |
2548 | 3579 |
request:'Enter a string:' |
2444 | 3580 |
displayAt:200@200 |
3581 |
centered:true |
|
3582 |
action:[:result | result printNewline] |
|
3583 |
initialAnswer:'the default' |
|
2548 | 3584 |
okLabel:'Yes' |
3585 |
cancelLabel:'No' |
|
2444 | 3586 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3587 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3588 |
topLeft of box at 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3589 |
|
2444 | 3590 |
Dialog |
2548 | 3591 |
request:'Enter a string:' |
2444 | 3592 |
displayAt:200@200 |
3593 |
centered:false |
|
3594 |
action:[:result | result printNewline] |
|
3595 |
initialAnswer:'the default' |
|
2548 | 3596 |
okLabel:'Yes' |
3597 |
cancelLabel:'No' |
|
2444 | 3598 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3599 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3600 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3601 |
|
2444 | 3602 |
Dialog |
2548 | 3603 |
request:'Enter a string:' |
2444 | 3604 |
displayAt:nil |
3605 |
centered:false |
|
3606 |
action:[:result | result printNewline] |
|
3607 |
initialAnswer:'the default' |
|
2548 | 3608 |
okLabel:'Yes' |
3609 |
cancelLabel:'No' |
|
2444 | 3610 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3611 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3612 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3613 |
|
2444 | 3614 |
Dialog |
2548 | 3615 |
request:'Enter a string:' |
2444 | 3616 |
displayAt:nil |
3617 |
centered:true |
|
3618 |
action:[:result | result printNewline] |
|
3619 |
initialAnswer:'the default' |
|
2548 | 3620 |
okLabel:'Yes' |
3621 |
cancelLabel:'No' |
|
2444 | 3622 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3623 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3624 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3625 |
"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
|
3626 |
"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
|
3627 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3628 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3629 |
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
|
3630 |
"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
|
3631 |
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
|
3632 |
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
|
3633 |
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
|
3634 |
screen center (if centered is true). |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3635 |
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
|
3636 |
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
|
3637 |
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
|
3638 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3639 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3640 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3641 |
displayAt:aPoint |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3642 |
centered:centered |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3643 |
action:resultAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3644 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3645 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3646 |
cancelLabel:cancelLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3647 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3648 |
onCancel:cancelValue |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3649 |
list:nil |
2444 | 3650 |
initialSelection:nil |
3651 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3652 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3653 |
|
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3654 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3655 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3656 |
onCancel:cancelValue list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3657 |
"launch a Dialog, which allows user to enter a string. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3658 |
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
|
3659 |
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
|
3660 |
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
|
3661 |
screen center (if centered is true). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3662 |
The ok-button is labelled okLabel (or the default, ifNil), |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3663 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3664 |
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
|
3665 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3666 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3667 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3668 |
displayAt:aPoint |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3669 |
centered:centered |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3670 |
action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3671 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3672 |
okLabel:okLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3673 |
cancelLabel:cancelLabel |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3674 |
title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3675 |
onCancel:cancelValue |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3676 |
list:listToSelectFrom |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3677 |
initialSelection:nil |
2444 | 3678 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3679 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3680 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3681 |
centered around 200@200: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3682 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3683 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3684 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3685 |
displayAt:200@200 |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3686 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3687 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3688 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3689 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3690 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3691 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3692 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3693 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3694 |
under mouse pointer: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3695 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3696 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3697 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3698 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3699 |
centered:false |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3700 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3701 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3702 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3703 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3704 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3705 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3706 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3707 |
centered on the screen: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3708 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3709 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3710 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3711 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3712 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3713 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3714 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3715 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3716 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3717 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3718 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3719 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3720 |
with a list: |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3721 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3722 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3723 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3724 |
displayAt:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3725 |
centered:true |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3726 |
action:[:result | result printNewline] |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3727 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3728 |
okLabel:'yes' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3729 |
cancelLabel:'no' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3730 |
title:'foo' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3731 |
onCancel:#foo |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3732 |
list:#(foo bar baz) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3733 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3734 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3735 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3736 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3737 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3738 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3739 |
request:aString displayAt:aPoint centered:centered action:resultAction |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3740 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3741 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anInterval |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3742 |
"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
|
3743 |
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
|
3744 |
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
|
3745 |
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
|
3746 |
screen center (if centered is true). |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3747 |
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
|
3748 |
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
|
3749 |
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
|
3750 |
|
2444 | 3751 |
^ self |
3752 |
request:aString |
|
3753 |
displayAt:aPoint |
|
3754 |
centered:centered |
|
3755 |
action:resultAction |
|
3756 |
initialAnswer:initial |
|
3757 |
okLabel:okLabel |
|
3758 |
cancelLabel:cancelLabel |
|
3759 |
title:titleString |
|
3760 |
onCancel:cancelValue |
|
3761 |
list:listToSelectFrom |
|
3762 |
initialSelection:anInterval |
|
3763 |
entryCompletionBlock:nil |
|
3764 |
||
3765 |
" |
|
3766 |
centered around 200@200: |
|
3767 |
||
3768 |
Dialog |
|
2548 | 3769 |
request:'Enter a string:' |
2444 | 3770 |
displayAt:200@200 |
3771 |
centered:true |
|
3772 |
action:[:result | result printNewline] |
|
3773 |
initialAnswer:'the default' |
|
2548 | 3774 |
okLabel:'Yes' |
3775 |
cancelLabel:'No' |
|
2444 | 3776 |
title:'foo' |
3777 |
onCancel:#foo |
|
3778 |
||
3779 |
under mouse pointer: |
|
3780 |
||
3781 |
Dialog |
|
2548 | 3782 |
request:'Enter a string:' |
2444 | 3783 |
displayAt:nil |
3784 |
centered:false |
|
3785 |
action:[:result | result printNewline] |
|
3786 |
initialAnswer:'the default' |
|
2548 | 3787 |
okLabel:'Yes' |
3788 |
cancelLabel:'No' |
|
2444 | 3789 |
title:'foo' |
3790 |
onCancel:#foo |
|
3791 |
||
3792 |
centered on the screen: |
|
3793 |
||
3794 |
Dialog |
|
2548 | 3795 |
request:'Enter a string:' |
2444 | 3796 |
displayAt:nil |
3797 |
centered:true |
|
3798 |
action:[:result | result printNewline] |
|
3799 |
initialAnswer:'the default' |
|
2548 | 3800 |
okLabel:'Yes' |
3801 |
cancelLabel:'No' |
|
2444 | 3802 |
title:'foo' |
3803 |
onCancel:#foo |
|
3804 |
||
3805 |
with a list: |
|
3806 |
||
3807 |
Dialog |
|
2548 | 3808 |
request:'Enter a string:' |
2444 | 3809 |
displayAt:nil |
3810 |
centered:true |
|
3811 |
action:[:result | result printNewline] |
|
3812 |
initialAnswer:'the default' |
|
2548 | 3813 |
okLabel:'Yes' |
3814 |
cancelLabel:'No' |
|
2444 | 3815 |
title:'foo' |
3816 |
onCancel:#foo |
|
3817 |
list:#(foo bar baz) |
|
3818 |
" |
|
3819 |
||
3820 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
|
3821 |
"Modified: / 5.5.1999 / 10:50:22 / cg" |
|
3822 |
! |
|
3823 |
||
3824 |
request:aString displayAt:aPoint centered:centeredOrNil action:resultAction |
|
3825 |
initialAnswer:initial okLabel:okLabel cancelLabel:cancelLabel title:titleString |
|
3826 |
onCancel:cancelValue list:listToSelectFrom initialSelection:anInterval |
|
3827 |
entryCompletionBlock:entryCompletionBlock |
|
3828 |
"launch a Dialog, which allows user to enter a string. |
|
3829 |
The dialogs window is titled titleString, or the default (if nil). |
|
3830 |
If aPoint is nonNil, the box is shown there, optionally centered around it. |
|
3831 |
If it is nil, it is shown at the current pointer position or at the |
|
3832 |
screen center (if centered is true). |
|
3833 |
The ok-button is labelled okLabel (or the default, ifNil), |
|
3834 |
the cancel-button is labelled cancelLabel (or the default, ifNil). |
|
3835 |
Return the string or the value of cancelValue (if cancel was pressed)" |
|
3836 |
||
3837 |
|box centered| |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3838 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3839 |
listToSelectFrom isNil ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3840 |
box := EnterBox title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3841 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3842 |
box := EnterBoxWithList title:aString. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3843 |
box list:listToSelectFrom. |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3844 |
]. |
2685 | 3845 |
initial notNil ifTrue:[ box initialText:initial printString ]. |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3846 |
anInterval notNil ifTrue:[ |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3847 |
box selectFrom:anInterval start to:anInterval stop. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
3848 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
3849 |
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
|
3850 |
okLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3851 |
box okText:okLabel. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3852 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3853 |
cancelLabel notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3854 |
box abortText:cancelLabel |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3855 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3856 |
resultAction isNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3857 |
box action:[:val | box destroy. ^ val] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3858 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3859 |
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
|
3860 |
]. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3861 |
titleString notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3862 |
box label:titleString |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3863 |
]. |
2444 | 3864 |
entryCompletionBlock notNil ifTrue:[ |
2517 | 3865 |
"/ box entryCompletionBlock:[:text | box |
3866 |
"/ initialText:(entryCompletionBlock value:text) |
|
3867 |
"/ selected:false]. |
|
3868 |
box entryCompletionBlock:entryCompletionBlock. |
|
2444 | 3869 |
]. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3870 |
|
2444 | 3871 |
centered := centeredOrNil ? (ForceModalBoxesToOpenAtCenter ? false). |
3872 |
||
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3873 |
aPoint notNil ifTrue:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3874 |
box showAt:aPoint center:centered |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3875 |
] ifFalse:[ |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3876 |
centered ifTrue:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3877 |
box showAtCenter |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3878 |
] ifFalse:[ |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3879 |
box showAtPointer |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3880 |
] |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3881 |
]. |
719
574be1981be0
destroy boxes from standard dialogs
Claus Gittinger <cg@exept.de>
parents:
718
diff
changeset
|
3882 |
box destroy. |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3883 |
^ cancelValue value. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3884 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3885 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3886 |
centered around 200@200: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3887 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3888 |
Dialog |
2548 | 3889 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3890 |
displayAt:200@200 |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3891 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3892 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3893 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3894 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3895 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3896 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3897 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3898 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3899 |
under mouse pointer: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3900 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3901 |
Dialog |
2548 | 3902 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3903 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3904 |
centered:false |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3905 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3906 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3907 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3908 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3909 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3910 |
onCancel:#foo |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3911 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3912 |
centered on the screen: |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3913 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3914 |
Dialog |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3915 |
request:'enter a string:' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3916 |
displayAt:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3917 |
centered:true |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3918 |
action:[:result | result printNewline] |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3919 |
initialAnswer:'the default' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3920 |
okLabel:'yes' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3921 |
cancelLabel:'no' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3922 |
title:'foo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
3923 |
onCancel:#foo |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3924 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3925 |
with a list: |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3926 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3927 |
Dialog |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3928 |
request:'enter a string:' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3929 |
displayAt:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3930 |
centered:true |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3931 |
action:[:result | result printNewline] |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3932 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3933 |
okLabel:'yes' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3934 |
cancelLabel:'no' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3935 |
title:'foo' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3936 |
onCancel:#foo |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3937 |
list:#(foo bar baz) |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3938 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3939 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3940 |
"Created: / 29.5.1996 / 14:35:04 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
3941 |
"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
|
3942 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3943 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3944 |
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
|
3945 |
"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
|
3946 |
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
|
3947 |
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
|
3948 |
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
|
3949 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
3950 |
^ self |
2444 | 3951 |
request:aString |
3952 |
displayAt:aPoint |
|
3953 |
centered:centered |
|
3954 |
action:resultAction |
|
3955 |
initialAnswer:initial |
|
3956 |
okLabel:nil |
|
3957 |
cancelLabel:nil |
|
3958 |
title:nil |
|
3959 |
onCancel:cancelValue |
|
3960 |
list:nil |
|
3961 |
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
|
3962 |
|
100 | 3963 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3964 |
at topLeft (centering is suppressed, to make the box fully visible) |
2444 | 3965 |
Dialog |
3966 |
request:'enter a string:' |
|
3967 |
displayAt:0@0 |
|
3968 |
centered:true |
|
3969 |
action:[:result | result printNewline] |
|
3970 |
initialAnswer:'the default' |
|
3971 |
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
|
3972 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3973 |
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
|
3974 |
|
2444 | 3975 |
Dialog |
3976 |
request:'enter a string:' |
|
3977 |
displayAt:200@200 |
|
3978 |
centered:true |
|
3979 |
action:[:result | result printNewline] |
|
3980 |
initialAnswer:'the default' |
|
3981 |
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
|
3982 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3983 |
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
|
3984 |
|
2444 | 3985 |
Dialog |
3986 |
request:'enter a string:' |
|
3987 |
displayAt:200@200 |
|
3988 |
centered:false |
|
3989 |
action:[:result | result printNewline] |
|
3990 |
initialAnswer:'the default' |
|
3991 |
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
|
3992 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
3993 |
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
|
3994 |
|
2444 | 3995 |
Dialog |
3996 |
request:'enter a string:' |
|
3997 |
displayAt:nil |
|
3998 |
centered:false |
|
3999 |
action:[:result | result printNewline] |
|
4000 |
initialAnswer:'the default' |
|
4001 |
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
|
4002 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4003 |
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
|
4004 |
|
2444 | 4005 |
Dialog |
4006 |
request:'enter a string:' |
|
4007 |
displayAt:nil |
|
4008 |
centered:true |
|
4009 |
action:[:result | result printNewline] |
|
4010 |
initialAnswer:'the default' |
|
4011 |
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
|
4012 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4013 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4014 |
"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
|
4015 |
"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
|
4016 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4017 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4018 |
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
|
4019 |
"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
|
4020 |
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
|
4021 |
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
|
4022 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4023 |
^ self |
2439 | 4024 |
request:aString |
4025 |
displayAt:aPoint |
|
4026 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4027 |
action:nil |
|
4028 |
initialAnswer:initial |
|
4093 | 4029 |
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
|
4030 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4031 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4032 |
Dialog |
2439 | 4033 |
request:'enter a string:' |
4034 |
displayAt:(250 @ 250) |
|
4035 |
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
|
4036 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4037 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4038 |
"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
|
4039 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4040 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4041 |
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
|
4042 |
"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
|
4043 |
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
|
4044 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4045 |
^ self |
2439 | 4046 |
request:aString |
4047 |
displayAt:nil |
|
4048 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4049 |
action:nil |
|
2444 | 4050 |
initialAnswer:initial |
4051 |
okLabel:nil |
|
4052 |
cancelLabel:nil |
|
4053 |
title:nil |
|
4093 | 4054 |
onCancel:nil |
2444 | 4055 |
list:nil |
4056 |
initialSelection:nil |
|
4057 |
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
|
4058 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4059 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4060 |
Dialog |
2439 | 4061 |
request:'enter a string:' |
4062 |
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
|
4063 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4064 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4065 |
"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
|
4066 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4067 |
|
2444 | 4068 |
request:aString initialAnswer:initial entryCompletionBlock:entryCompletionBlock |
4069 |
"launch a Dialog, which allows user to enter something. |
|
4070 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4071 |
||
4072 |
^ self |
|
4073 |
request:aString |
|
4074 |
displayAt:nil |
|
4075 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4076 |
action:nil |
|
4077 |
initialAnswer:initial |
|
4078 |
okLabel:nil |
|
4079 |
cancelLabel:nil |
|
4080 |
title:nil |
|
4093 | 4081 |
onCancel:nil |
2444 | 4082 |
list:nil |
4083 |
initialSelection:nil |
|
4084 |
entryCompletionBlock:entryCompletionBlock |
|
4085 |
||
4086 |
" |
|
4087 |
Dialog |
|
4088 |
request:'enter a selector:' |
|
4089 |
initialAnswer:'at:p' |
|
4090 |
entryCompletionBlock:[:s | |completion| |
|
4091 |
||
4092 |
completion := Smalltalk selectorCompletion:s. |
|
4093 |
completion second size > 1 ifTrue:[ Screen current beep]. |
|
4094 |
completion first |
|
4095 |
]. |
|
4096 |
" |
|
4097 |
||
4098 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4099 |
! |
|
4100 |
||
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4101 |
request:aString initialAnswer:initial initialSelection:anInterval |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4102 |
"launch a Dialog, which allows user to enter something. |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4103 |
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
|
4104 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4105 |
^ self |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4106 |
request:aString |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4107 |
displayAt:nil |
2439 | 4108 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4109 |
action:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4110 |
initialAnswer:initial |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4111 |
okLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4112 |
cancelLabel:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4113 |
title:nil |
4093 | 4114 |
onCancel:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4115 |
list:nil |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4116 |
initialSelection:anInterval |
2444 | 4117 |
entryCompletionBlock:nil |
2080
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4118 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4119 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4120 |
Dialog |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4121 |
request:'enter a string:' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4122 |
initialAnswer:'the default' |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4123 |
initialSelection:(1 to:3) |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4124 |
" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4125 |
|
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4126 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4127 |
! |
620d5ac7dee5
added #request:initialAnswer:initialSelection:
Claus Gittinger <cg@exept.de>
parents:
2079
diff
changeset
|
4128 |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4129 |
request:aString initialAnswer:initial list:aList |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4130 |
"launch a Dialog, which allows user to enter something, |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4131 |
or select from a list of values. |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4132 |
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
|
4133 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4134 |
^ self |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4135 |
request:aString |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4136 |
displayAt:nil |
2439 | 4137 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4138 |
action:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4139 |
initialAnswer:initial |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4140 |
okLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4141 |
cancelLabel:nil |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4142 |
title:nil |
4093 | 4143 |
onCancel:nil |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4144 |
list:aList |
2444 | 4145 |
initialSelection:nil |
4146 |
entryCompletionBlock:nil |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4147 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4148 |
" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4149 |
Dialog |
2548 | 4150 |
request:'Enter a string:' |
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4151 |
initialAnswer:'the default' |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4152 |
list:#('foo' 'bar' 'baz') |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4153 |
" |
2110 | 4154 |
" |
4155 |
Dialog |
|
4156 |
request:'enter a string:' |
|
4157 |
initialAnswer:'the default' |
|
4158 |
list:((1 to:30) collect:[:i | i printString]) |
|
4159 |
" |
|
1898
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4160 |
|
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4161 |
"Modified: / 5.5.1999 / 10:53:45 / cg" |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4162 |
! |
fe4300f57e1a
convenient entry: #request:initialAnswer:list
Claus Gittinger <cg@exept.de>
parents:
1877
diff
changeset
|
4163 |
|
2550 | 4164 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString |
4165 |
"launch a Dialog, which allows user to enter something. |
|
4166 |
Return the entered string (may be empty string) |
|
4167 |
or cancelValue (if cancel was pressed)" |
|
4168 |
||
4169 |
^ self |
|
4170 |
request:aString |
|
4171 |
displayAt:nil |
|
4172 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4173 |
action:nil |
|
4174 |
initialAnswer:initial |
|
4175 |
okLabel:okLabel |
|
4176 |
cancelLabel:nil |
|
4177 |
title:titleString |
|
4178 |
onCancel:nil |
|
4179 |
list:nil |
|
4180 |
initialSelection:nil |
|
4181 |
entryCompletionBlock:nil |
|
4182 |
||
4183 |
" |
|
4184 |
Dialog |
|
4185 |
request:'Enter a string:' |
|
4186 |
initialAnswer:'the default' |
|
4187 |
okLabel:'Yes' |
|
4188 |
title:'Only a Test' |
|
4189 |
" |
|
4190 |
||
4191 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4192 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4193 |
! |
|
4194 |
||
2551 | 4195 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString list:list |
4196 |
"launch a Dialog, which allows user to enter something. |
|
4197 |
Return the entered string (may be empty string) |
|
4198 |
or cancelValue (if cancel was pressed)" |
|
4199 |
||
4200 |
^ self |
|
4201 |
request:aString |
|
4202 |
displayAt:nil |
|
4203 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4204 |
action:nil |
|
4205 |
initialAnswer:initial |
|
4206 |
okLabel:okLabel |
|
4207 |
cancelLabel:nil |
|
4208 |
title:titleString |
|
4209 |
onCancel:nil |
|
4210 |
list:list |
|
4211 |
initialSelection:nil |
|
4212 |
entryCompletionBlock:nil |
|
4213 |
||
4214 |
" |
|
4215 |
Dialog |
|
4216 |
request:'Enter or select a string:' |
|
4217 |
initialAnswer:'the default' |
|
4218 |
okLabel:'Yes' |
|
4219 |
title:'Only a Test' |
|
4220 |
list:#('a' 'b' 'c') |
|
4221 |
" |
|
4222 |
||
4223 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4224 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4225 |
! |
|
4226 |
||
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4227 |
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
|
4228 |
"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
|
4229 |
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
|
4230 |
or cancelValue (if cancel was pressed)" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4231 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4232 |
^ self |
2439 | 4233 |
request:aString |
4234 |
displayAt:nil |
|
4235 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4236 |
action:nil |
|
4237 |
initialAnswer:initial |
|
4238 |
okLabel:okLabel |
|
4239 |
cancelLabel:nil |
|
4240 |
title:titleString |
|
4241 |
onCancel:cancelAction |
|
2444 | 4242 |
list:nil |
4243 |
initialSelection:nil |
|
4244 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4245 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4246 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4247 |
Dialog |
2548 | 4248 |
request:'Enter a string:' |
2439 | 4249 |
initialAnswer:'the default' |
4250 |
onCancel:['foooo'] |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4251 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4252 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4253 |
"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
|
4254 |
"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
|
4255 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4256 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4257 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices |
2548 | 4258 |
"launch a Dialog, which allows user to enter something |
4259 |
(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
|
4260 |
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
|
4261 |
or cancelValue (if cancel was pressed)" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4262 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4263 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4264 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4265 |
displayAt:nil |
2439 | 4266 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4267 |
action:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4268 |
initialAnswer:initial |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4269 |
okLabel:okLabel |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4270 |
cancelLabel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4271 |
title:titleString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4272 |
onCancel:cancelAction |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4273 |
list:listOfChoices |
2444 | 4274 |
initialSelection:nil |
4275 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4276 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4277 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4278 |
Dialog |
2548 | 4279 |
request:'Enter a String:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4280 |
initialAnswer:'the default' |
2548 | 4281 |
okLabel:'OK' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4282 |
title:'demo' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4283 |
onCancel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4284 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4285 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4286 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4287 |
"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
|
4288 |
"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
|
4289 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4290 |
|
2517 | 4291 |
request:aString initialAnswer:initial okLabel:okLabel title:titleString onCancel:cancelAction list:listOfChoices entryCompletionBlock:entryCompletionBlock |
2548 | 4292 |
"launch a Dialog, which allows user to enter something |
4293 |
(with a list of choices for fast input). |
|
2517 | 4294 |
Return the entered string (may be empty string) |
4295 |
or cancelValue (if cancel was pressed)" |
|
4296 |
||
4297 |
^ self |
|
4298 |
request:aString |
|
4299 |
displayAt:nil |
|
4300 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4301 |
action:nil |
|
4302 |
initialAnswer:initial |
|
4303 |
okLabel:okLabel |
|
4304 |
cancelLabel:nil |
|
4305 |
title:titleString |
|
4306 |
onCancel:cancelAction |
|
4307 |
list:listOfChoices |
|
4308 |
initialSelection:nil |
|
4309 |
entryCompletionBlock:entryCompletionBlock |
|
4310 |
||
4311 |
" |
|
4312 |
Dialog |
|
2548 | 4313 |
request:'Enter a String:' |
2517 | 4314 |
initialAnswer:'the default' |
2548 | 4315 |
okLabel:'OK' |
2517 | 4316 |
title:'demo' |
4317 |
onCancel:nil |
|
4318 |
list:#('foo' 'bar' 'baz') |
|
4319 |
" |
|
4320 |
||
4321 |
"Modified: 29.5.1996 / 14:28:24 / cg" |
|
4322 |
"Created: 29.5.1996 / 14:59:57 / cg" |
|
4323 |
! |
|
4324 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4325 |
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
|
4326 |
"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
|
4327 |
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
|
4328 |
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
|
4329 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4330 |
^ self |
2439 | 4331 |
request:aString |
4332 |
displayAt:nil |
|
4333 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4334 |
action:nil |
|
4335 |
initialAnswer:initial |
|
2444 | 4336 |
okLabel:nil |
4337 |
cancelLabel:nil |
|
4338 |
title:nil |
|
2439 | 4339 |
onCancel:cancelAction |
2444 | 4340 |
list:nil |
4341 |
initialSelection:nil |
|
4342 |
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
|
4343 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4344 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4345 |
Dialog |
2439 | 4346 |
request:'enter a string:' |
4347 |
initialAnswer:'the default' |
|
4348 |
onCancel:['foooo'] |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4349 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4350 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4351 |
"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
|
4352 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4353 |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4354 |
request:aString list:listOfChoices |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4355 |
"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
|
4356 |
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
|
4357 |
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
|
4358 |
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
|
4359 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4360 |
^ self |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4361 |
request:aString |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4362 |
displayAt:nil |
2439 | 4363 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4364 |
action:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4365 |
initialAnswer:'' |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4366 |
okLabel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4367 |
cancelLabel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4368 |
title:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4369 |
onCancel:nil |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4370 |
list:listOfChoices |
2444 | 4371 |
initialSelection:nil |
4372 |
entryCompletionBlock:nil |
|
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4373 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4374 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4375 |
Dialog |
2548 | 4376 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4377 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4378 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4379 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4380 |
"Modified: 29.5.1996 / 14:26:25 / cg" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4381 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4382 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4383 |
request:aString okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4384 |
"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
|
4385 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4386 |
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
|
4387 |
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
|
4388 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4389 |
^ self |
2439 | 4390 |
request:aString |
4391 |
displayAt:nil |
|
4392 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4393 |
action:nil |
|
4394 |
initialAnswer:'' |
|
4395 |
okLabel:okLabel |
|
4396 |
cancelLabel:nil |
|
2444 | 4397 |
title:nil |
4398 |
onCancel:nil |
|
4399 |
list:nil |
|
4400 |
initialSelection:nil |
|
4401 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4402 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4403 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4404 |
Dialog |
2548 | 4405 |
request:'Enter a string:' |
4406 |
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
|
4407 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4408 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4409 |
"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
|
4410 |
"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
|
4411 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4412 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4413 |
request:aString okLabel:okLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4414 |
"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
|
4415 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4416 |
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
|
4417 |
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
|
4418 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4419 |
^ self |
2439 | 4420 |
request:aString |
4421 |
displayAt:nil |
|
4422 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4423 |
action:nil |
|
4424 |
initialAnswer:'' |
|
4425 |
okLabel:okLabel |
|
4426 |
cancelLabel:nil |
|
2444 | 4427 |
title:nil |
2439 | 4428 |
onCancel:cancelValue |
2444 | 4429 |
list:nil |
4430 |
initialSelection:nil |
|
4431 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4432 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4433 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4434 |
Dialog |
2548 | 4435 |
request:'Enter a string:' |
4436 |
okLabel:'Yes' |
|
2439 | 4437 |
onCancel:nil |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4438 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4439 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4440 |
"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
|
4441 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4442 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4443 |
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
|
4444 |
"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
|
4445 |
The okButton is labelled as okLabel. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4446 |
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
|
4447 |
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
|
4448 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4449 |
^ self |
2439 | 4450 |
request:aString |
4451 |
displayAt:nil |
|
4452 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4453 |
action:nil |
|
4454 |
initialAnswer:'' |
|
4455 |
okLabel:okLabel |
|
4456 |
cancelLabel:nil |
|
4457 |
title:titleString |
|
4458 |
onCancel:cancelValue |
|
2444 | 4459 |
list:nil |
4460 |
initialSelection:nil |
|
4461 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4462 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4463 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4464 |
Dialog |
2548 | 4465 |
request:'Enter a String:' |
4466 |
okLabel:'Yes' |
|
2439 | 4467 |
title:'foo' |
4468 |
onCancel:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4469 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4470 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4471 |
"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
|
4472 |
"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
|
4473 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4474 |
|
2360 | 4475 |
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
|
4476 |
"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
|
4477 |
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
|
4478 |
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
|
4479 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4480 |
^ self |
2360 | 4481 |
request:aString |
4482 |
displayAt:nil |
|
2439 | 4483 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2360 | 4484 |
action:nil |
4485 |
initialAnswer:'' |
|
2444 | 4486 |
okLabel:nil |
4487 |
cancelLabel:nil |
|
4488 |
title:nil |
|
2360 | 4489 |
onCancel:cancelActionOrValue |
2444 | 4490 |
list:nil |
4491 |
initialSelection:nil |
|
4492 |
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
|
4493 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4494 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4495 |
Dialog |
2548 | 4496 |
request:'Enter a String:' |
2360 | 4497 |
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
|
4498 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4499 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4500 |
"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
|
4501 |
"Modified: 29.5.1996 / 14:28:59 / cg" |
100 | 4502 |
! |
4503 |
||
2718 | 4504 |
request:aString title:titleString initialAnswer:initial |
4505 |
"launch a Dialog, which allows user to enter something. |
|
4506 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4507 |
||
4508 |
^ self |
|
4509 |
request:aString |
|
4510 |
displayAt:nil |
|
4511 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4512 |
action:nil |
|
4513 |
initialAnswer:initial |
|
4514 |
okLabel:nil |
|
4515 |
cancelLabel:nil |
|
4516 |
title:titleString |
|
4093 | 4517 |
onCancel:nil |
2718 | 4518 |
list:nil |
4519 |
initialSelection:nil |
|
4520 |
entryCompletionBlock:nil |
|
4521 |
||
4522 |
" |
|
4523 |
Dialog |
|
4524 |
request:'enter a string:' |
|
4525 |
initialAnswer:'the default' |
|
4526 |
" |
|
4527 |
||
4528 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4529 |
! |
|
4530 |
||
3152 | 4531 |
requestNumber:aString |
4532 |
"launch a Dialog, which allows user to enter a number. |
|
4533 |
Return the numeric value or nil |
|
4534 |
(for an invalid number or if cancel was pressed)" |
|
4535 |
||
4536 |
|string| |
|
4537 |
||
4538 |
string := self request:aString. |
|
4539 |
^ Number readFrom:string onError:nil. |
|
4540 |
||
4541 |
" |
|
4542 |
Dialog requestNumber:'Enter your Age:' |
|
4543 |
" |
|
4544 |
||
4545 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
4546 |
! |
|
4547 |
||
3321 | 4548 |
requestNumber:aString initialAnswer: aNumber |
4549 |
"launch a Dialog, which allows user to enter a number. |
|
4550 |
Return the numeric value or nil |
|
4551 |
(for an invalid number or if cancel was pressed)" |
|
4552 |
||
4553 |
|string| |
|
4554 |
||
4555 |
string := self request:aString initialAnswer: aNumber. |
|
4556 |
^ Number readFrom:string onError:nil. |
|
4557 |
||
4558 |
" |
|
4559 |
Dialog requestNumber:'Enter your Age:' initialAnswer: 25 |
|
4560 |
" |
|
4561 |
||
4562 |
"Created: / 26-07-2006 / 12:22:23 / fm" |
|
4563 |
"Modified: / 07-08-2006 / 15:31:30 / fm" |
|
4564 |
! |
|
4565 |
||
197 | 4566 |
requestPassword:aString |
4567 |
"launch a Dialog, which allows user to enter something invisibly. |
|
4568 |
Return the entered string (may be empty string) |
|
4569 |
or nil (if cancel was pressed)" |
|
100 | 4570 |
|
197 | 4571 |
^ EnterBox requestPassword:aString |
133 | 4572 |
|
4573 |
" |
|
4574 |
Dialog |
|
2548 | 4575 |
requestPassword:'Enter Secret:' |
133 | 4576 |
" |
197 | 4577 |
|
4578 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
2014 | 4579 |
! |
4580 |
||
4139 | 4581 |
requestText:title |
4582 |
"open a dialog asking for multiline text. |
|
4583 |
Return a stringCollection or nil if cancelled." |
|
4584 |
||
4585 |
^ self |
|
4586 |
requestText:title lines:10 columns:40 initialAnswer:'' |
|
4587 |
||
4588 |
" |
|
4589 |
Dialog requestText:'Bla' |
|
4590 |
" |
|
4591 |
! |
|
4592 |
||
4593 |
requestText:title initialAnswer:initialAnswer |
|
4594 |
"open a dialog asking for multiline text. |
|
4595 |
Return a stringCollection or nil if cancelled." |
|
4596 |
||
4597 |
^ self |
|
4598 |
requestText:title lines:10 columns:40 initialAnswer:initialAnswer |
|
4599 |
||
4600 |
" |
|
4601 |
Dialog requestText:'Bla' initialAnswer:'Hello world' |
|
4602 |
" |
|
4603 |
! |
|
4604 |
||
2014 | 4605 |
requestText:title lines:numLines columns:numCols initialAnswer:initialText |
4606 |
"open a dialog asking for multiline text. |
|
4607 |
Return a stringCollection or nil if cancelled." |
|
4608 |
||
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4609 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4610 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4611 |
textHolder := ValueHolder new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4612 |
dialog := Dialog forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textHolder. |
2014 | 4613 |
dialog open. |
4614 |
dialog accepted ifTrue:[ |
|
2675 | 4615 |
^ textHolder value |
2014 | 4616 |
]. |
4617 |
^ nil |
|
4618 |
||
2675 | 4619 |
" |
4620 |
Dialog requestText:'Bla' lines:8 columns:40 initialAnswer:'hello world' |
|
4621 |
" |
|
4622 |
||
4623 |
"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
|
4624 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4625 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
4626 |
!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
|
4627 |
|
3234 | 4628 |
choose:aString fromList:list lines:maxLines |
4629 |
"launch a Dialog showing the message and list. |
|
4630 |
The user can select an item and click ok; in this case, the corresponding value |
|
4631 |
from listValues is returned (doubleclick works as well). |
|
4632 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4633 |
Pressing ok without a selection is treated like cancel." |
|
4634 |
||
4635 |
^ self |
|
4636 |
choose:aString |
|
3455 | 4637 |
fromList:(list collect:[:each| each printString]) values:list |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4638 |
initialSelection:nil |
3455 | 4639 |
buttons:nil values:nil |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4640 |
default:nil |
3234 | 4641 |
lines:maxLines |
4642 |
cancel:nil |
|
4643 |
multiple:false |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4644 |
title:nil |
3234 | 4645 |
postBuildBlock:nil |
4646 |
||
4647 |
" |
|
4648 |
Transcript showCR:( |
|
4649 |
Dialog |
|
4650 |
choose:'choose any' |
|
4651 |
fromList:#(1 2 3 4 5 6 7) |
|
4652 |
lines:4 |
|
4653 |
) |
|
4654 |
" |
|
4655 |
||
3455 | 4656 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
3234 | 4657 |
! |
4658 |
||
3307 | 4659 |
choose:aString fromList:list lines:maxLines initialSelection:initialSelection |
4660 |
"launch a Dialog showing the message and list. |
|
4661 |
The user can select an item and click ok; in this case, the corresponding value |
|
4662 |
from listValues is returned (doubleclick works as well). |
|
4663 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4664 |
Pressing ok without a selection is treated like cancel." |
|
4665 |
||
4666 |
^ self |
|
4667 |
choose:aString |
|
4668 |
fromList:list values:list initialSelection:initialSelection |
|
4669 |
buttons:nil values:nil |
|
4670 |
lines:maxLines |
|
4671 |
cancel:nil |
|
4672 |
multiple:false |
|
4673 |
postBuildBlock:nil |
|
4674 |
||
4675 |
" |
|
4676 |
Transcript showCR:( |
|
4677 |
Dialog |
|
4678 |
choose:'choose any' |
|
4679 |
fromList:#(1 2 3 4 5 6 7) |
|
4680 |
lines:4 |
|
4681 |
initialSelection:4 |
|
4682 |
) |
|
4683 |
" |
|
4684 |
||
4685 |
"Modified: 27.1.1996 / 14:17:07 / cg" |
|
4686 |
! |
|
4687 |
||
3455 | 4688 |
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
|
4689 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4690 |
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
|
4691 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4692 |
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
|
4693 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4694 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4695 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4696 |
choose:aString |
3455 | 4697 |
fromList:(list collect:[:each| each printString]) values:list |
4698 |
initialSelection:initialSelection |
|
4699 |
buttons:nil values:nil |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4700 |
default:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4701 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4702 |
cancel:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4703 |
multiple:false |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4704 |
title:windowTitle |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4705 |
postBuildBlock:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4706 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4707 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4708 |
Transcript showCR:( |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4709 |
Dialog |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4710 |
choose:'choose any' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4711 |
fromList:#(1 2 3 4 5 6 7) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4712 |
lines:4 |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4713 |
title:'Choose' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4714 |
) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4715 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4716 |
|
3455 | 4717 |
"Created: / 02-03-2007 / 12:06:39 / cg" |
4718 |
! |
|
4719 |
||
4720 |
choose:aString fromList:list lines:maxLines title:windowTitle |
|
4721 |
"launch a Dialog showing the message and list. |
|
4722 |
The user can select an item and click ok; in this case, the corresponding value |
|
4723 |
from listValues is returned (doubleclick works as well). |
|
4724 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4725 |
Pressing ok without a selection is treated like cancel." |
|
4726 |
||
4727 |
^ self |
|
4728 |
choose:aString |
|
4729 |
fromList:(list collect:[:each| each printString]) values:list |
|
4730 |
initialSelection:nil |
|
4731 |
buttons:nil values:nil |
|
4732 |
default:nil |
|
4733 |
lines:maxLines |
|
4734 |
cancel:nil |
|
4735 |
multiple:false |
|
4736 |
title:windowTitle |
|
4737 |
postBuildBlock:nil |
|
4738 |
||
4739 |
" |
|
4740 |
Transcript showCR:( |
|
4741 |
Dialog |
|
4742 |
choose:'choose any' |
|
4743 |
fromList:#(1 2 3 4 5 6 7) |
|
4744 |
lines:4 |
|
4745 |
title:'Choose' |
|
4746 |
) |
|
4747 |
" |
|
4748 |
||
4749 |
"Modified: / 02-03-2007 / 12:08:20 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4750 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4751 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4752 |
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
|
4753 |
"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
|
4754 |
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
|
4755 |
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
|
4756 |
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
|
4757 |
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
|
4758 |
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
|
4759 |
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
|
4760 |
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
|
4761 |
|
2111 | 4762 |
^ self |
4763 |
choose:aString |
|
3455 | 4764 |
fromList:list values:listValues |
4765 |
buttons:buttonLabels values:buttonValues |
|
2111 | 4766 |
lines:maxLines |
4767 |
cancel:cancelBlock |
|
4768 |
multiple:false |
|
4769 |
||
4770 |
" |
|
4771 |
full example: |
|
4772 |
||
4773 |
Transcript showCR:( |
|
4774 |
Dialog |
|
4775 |
choose:'choose any' |
|
4776 |
fromList:#('one' 'two' 'three' 'four') |
|
4777 |
values:#(1 2 3 4) |
|
4778 |
buttons:#('five' 'six' 'seven') |
|
4779 |
values:#(5 6 7) |
|
4780 |
lines:10 |
|
4781 |
cancel:nil |
|
4782 |
) |
|
4783 |
||
4784 |
||
4785 |
no buttons: |
|
4786 |
||
4787 |
Transcript showCR:( |
|
4788 |
Dialog |
|
4789 |
choose:'choose any' |
|
4790 |
fromList:#('one' 'two' 'three' 'four') |
|
4791 |
values:#(1 2 3 4) |
|
4792 |
buttons:nil |
|
4793 |
values:nil |
|
4794 |
lines:4 |
|
4795 |
cancel:nil |
|
4796 |
) |
|
4797 |
||
4798 |
||
4799 |
no list (lines argument is ignored): |
|
4800 |
||
4801 |
Transcript showCR:( |
|
4802 |
Dialog |
|
4803 |
choose:'choose any' |
|
4804 |
fromList:nil |
|
4805 |
values:nil |
|
4806 |
buttons:#('one' 'two' 'three' 'four') |
|
4807 |
values:#(1 2 3 4) |
|
4808 |
lines:nil |
|
4809 |
cancel:nil |
|
4810 |
) |
|
4811 |
||
4812 |
||
4813 |
full including cancel value: |
|
4814 |
||
4815 |
Transcript showCR:( |
|
4816 |
Dialog |
|
4817 |
choose:'choose example' |
|
4818 |
fromList:#('one' 'two' 'three' 'four') |
|
4819 |
values:#(1 2 3 4) |
|
4820 |
buttons:#('five' 'six' 'seven') |
|
4821 |
values:#(5 6 7) |
|
4822 |
lines:4 |
|
4823 |
cancel:[Transcript flash. #aborted] |
|
4824 |
) |
|
4825 |
||
4826 |
||
4827 |
degenerated: |
|
4828 |
||
4829 |
Transcript showCR:( |
|
4830 |
Dialog |
|
4831 |
choose:'choose any' |
|
4832 |
fromList:nil |
|
4833 |
values:nil |
|
4834 |
buttons:nil |
|
4835 |
values:nil |
|
4836 |
lines:nil |
|
4837 |
cancel:nil |
|
4838 |
) |
|
4839 |
||
4840 |
||
4841 |
" |
|
4842 |
||
3455 | 4843 |
"Modified: / 02-03-2007 / 12:08:12 / cg" |
2111 | 4844 |
! |
4845 |
||
4846 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple |
|
4847 |
"launch a Dialog showing the message and list. |
|
4848 |
The user can select an item and click ok; in this case, the corresponding value |
|
4849 |
from listValues is returned (doubleclick works as well). |
|
4850 |
The list may be suppressed (if the list arg is nil). |
|
4851 |
If a list is present, multiple controls if multiple selections are allowed. |
|
4852 |
Below the list, an optional row of buttons is shown, which can also be |
|
4853 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
4854 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4855 |
Pressing ok without a selection is treated like cancel." |
|
4856 |
||
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4857 |
^ self |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4858 |
choose:aString |
3455 | 4859 |
fromList:list values:listValues |
4860 |
buttons:buttonLabels values:buttonValues |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4861 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4862 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4863 |
multiple:multiple |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4864 |
postBuildBlock:nil |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4865 |
|
3455 | 4866 |
"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
|
4867 |
! |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4868 |
|
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4869 |
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
|
4870 |
"launch a Dialog showing the message and list. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4871 |
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
|
4872 |
from listValues is returned (doubleclick works as well). |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4873 |
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
|
4874 |
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
|
4875 |
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
|
4876 |
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
|
4877 |
If cancel is pressed, the value of cancelBlock is returned. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4878 |
Pressing ok without a selection is treated like cancel." |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4879 |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4880 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4881 |
choose:aString |
3455 | 4882 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4883 |
initialSelection:nil |
3455 | 4884 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4885 |
default:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4886 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4887 |
cancel:cancelBlock |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4888 |
multiple:multiple |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4889 |
title:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4890 |
postBuildBlock:aBlockOrNil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4891 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4892 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4893 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4894 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4895 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4896 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4897 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4898 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4899 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4900 |
buttons:#('five' 'six' 'seven') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4901 |
values:#(5 6 7) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4902 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4903 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4904 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4905 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4906 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4907 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4908 |
no buttons: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4909 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4910 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4911 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4912 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4913 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4914 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4915 |
buttons:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4916 |
values:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4917 |
lines:4 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4918 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4919 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4920 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4921 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4922 |
|
3455 | 4923 |
"Modified: / 02-03-2007 / 12:08:02 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4924 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4925 |
|
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4926 |
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
|
4927 |
"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
|
4928 |
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
|
4929 |
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
|
4930 |
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
|
4931 |
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
|
4932 |
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
|
4933 |
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
|
4934 |
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
|
4935 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4936 |
^ self |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4937 |
choose:aString |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4938 |
fromList:list values:listValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4939 |
buttons:buttonLabels values:buttonValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4940 |
lines:maxLines |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4941 |
cancel:cancelBlock |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4942 |
multiple:false |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4943 |
postBuildBlock:postBuildBlock. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4944 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4945 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4946 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4947 |
full example: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4948 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4949 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4950 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4951 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4952 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4953 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4954 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4955 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4956 |
lines:10 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4957 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4958 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4959 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4960 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4961 |
no buttons: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4962 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4963 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4964 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4965 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4966 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4967 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4968 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4969 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4970 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4971 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4972 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4973 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4974 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4975 |
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
|
4976 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4977 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4978 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4979 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4980 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4981 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4982 |
buttons:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4983 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4984 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4985 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4986 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4987 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4988 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4989 |
full including cancel value: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4990 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4991 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4992 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4993 |
choose:'choose example' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4994 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4995 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4996 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4997 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4998 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4999 |
cancel:[Transcript flash. #aborted] |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5000 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5001 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5002 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5003 |
degenerated: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5004 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5005 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5006 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5007 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5008 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5009 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5010 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5011 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5012 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5013 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5014 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5015 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5016 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5017 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5018 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5019 |
"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
|
5020 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5021 |
|
3340 | 5022 |
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
|
5023 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5024 |
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
|
5025 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5026 |
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
|
5027 |
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
|
5028 |
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
|
5029 |
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
|
5030 |
If cancel is pressed, the value of cancelBlock is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5031 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5032 |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5033 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5034 |
choose:aString |
3455 | 5035 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5036 |
initialSelection:initialListSelectionOrNil |
3455 | 5037 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5038 |
default:defaultValue |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5039 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5040 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5041 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5042 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5043 |
postBuildBlock:aBlockOrNil |
3455 | 5044 |
|
5045 |
"Modified: / 02-03-2007 / 12:07:57 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5046 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5047 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5048 |
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
|
5049 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5050 |
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
|
5051 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5052 |
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
|
5053 |
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
|
5054 |
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
|
5055 |
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
|
5056 |
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
|
5057 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5058 |
|
3469 | 5059 |
|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
|
5060 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5061 |
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
|
5062 |
(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
|
5063 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5064 |
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
|
5065 |
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
|
5066 |
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
|
5067 |
"/ 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
|
5068 |
"/ 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
|
5069 |
"/ ] ifFalse:[ |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5070 |
"/ 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
|
5071 |
"/ 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
|
5072 |
"/ ]. |
2111 | 5073 |
listView list:list. |
2116 | 5074 |
listView doubleClickAction:[:selectionIndex | |
2111 | 5075 |
|val| |
5076 |
||
2116 | 5077 |
multiple ifTrue:[ |
5078 |
val := selectionIndex collect:[:idx | listValues at:idx]. |
|
5079 |
] ifFalse:[ |
|
5080 |
val := listValues at:selectionIndex. |
|
5081 |
]. |
|
2111 | 5082 |
box destroy. |
5083 |
^ val |
|
5084 |
]. |
|
5085 |
listView multipleSelectOk:multiple. |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5086 |
initialListSelectionOrNil notNil ifTrue:[ |
3005 | 5087 |
multiple ifTrue:[ |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5088 |
listView selection:(initialListSelectionOrNil collect:[:each| listValues indexOf:each]) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5089 |
] ifFalse:[ |
3005 | 5090 |
listView selection:(listValues indexOf:initialListSelectionOrNil) |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5091 |
] |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5092 |
]. |
2111 | 5093 |
box addComponent:listView indent:(ViewSpacing // 2) withHeight:(listView heightForLines:maxLines). |
5094 |
box makeTabable:listView. |
|
3340 | 5095 |
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
|
5096 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5097 |
|
2112 | 5098 |
buttonLabels size > 0 ifTrue:[ |
2111 | 5099 |
panel := HorizontalPanelView new. |
5100 |
panel horizontalLayout:#fitSpace. |
|
3340 | 5101 |
haveDefault := false. |
2111 | 5102 |
buttonLabels keysAndValuesDo:[:index :label | |
5103 |
|b| |
|
5104 |
||
5105 |
b := Button label:label. |
|
5106 |
b action:[ |
|
5107 |
|val| |
|
5108 |
val := buttonValues at:index. |
|
3340 | 5109 |
val isBlock ifTrue:[ val := val valueWithOptionalArgument:listView selection and:box]. |
2111 | 5110 |
box destroy. |
5111 |
multiple ifTrue:[ |
|
5112 |
^ Array with:val |
|
5113 |
]. |
|
5114 |
^ val |
|
5115 |
]. |
|
3340 | 5116 |
haveDefault ifFalse:[ |
5117 |
defaultValue notNil ifTrue:[ |
|
5118 |
(buttonValues at:index) = defaultValue ifTrue:[ |
|
5119 |
b isReturnButton:true. |
|
5120 |
haveDefault := true. |
|
5121 |
]. |
|
5122 |
]. |
|
5123 |
]. |
|
2111 | 5124 |
panel add:b. |
5125 |
box makeTabable:b. |
|
5126 |
]. |
|
5127 |
box addComponent:panel indent:0. "/ panel has its own idea of indenting |
|
3340 | 5128 |
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
|
5129 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5130 |
box addAbortButton. |
3340 | 5131 |
list notNil ifTrue:[ |
5132 |
haveDefault ifTrue:[ |
|
5133 |
(box addOkButton) isReturnButton:false. |
|
5134 |
] ifFalse:[ |
|
5135 |
box addOkButton. |
|
5136 |
]. |
|
5137 |
]. |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5138 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5139 |
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
|
5140 |
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
|
5141 |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5142 |
aBlockOrNil notNil ifTrue:[ |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5143 |
aBlockOrNil value:box |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5144 |
]. |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5145 |
windowTitle notNil ifTrue:[ |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5146 |
box label:windowTitle. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5147 |
]. |
4104
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5148 |
box width < 250 ifTrue:[ |
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5149 |
box width:250. |
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5150 |
]. |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5151 |
|
2439 | 5152 |
self showBox:box. |
2111 | 5153 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5154 |
box accepted ifTrue:[ |
2111 | 5155 |
(sel := listView selection) notNil ifTrue:[ |
5156 |
box destroy. |
|
5157 |
sel isInteger ifTrue:[ |
|
5158 |
^ listValues at:sel |
|
3340 | 5159 |
]. |
5160 |
^ sel collect:[:idx | listValues at:idx] |
|
5161 |
]. |
|
5162 |
box destroy. |
|
3536
76d3579362e4
choose:fromList.... returned true if OK was pressed without
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
5163 |
^ nil "/ ^ true. |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5164 |
]. |
2111 | 5165 |
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
|
5166 |
^ cancelBlock value |
197 | 5167 |
|
5168 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5169 |
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
|
5170 |
|
2111 | 5171 |
Transcript showCR:( |
5172 |
Dialog |
|
5173 |
choose:'choose any' |
|
3340 | 5174 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
5175 |
initialSelection: nil |
|
5176 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
|
5177 |
default:6 |
|
2111 | 5178 |
lines:10 |
5179 |
cancel:nil |
|
5180 |
multiple:true |
|
3340 | 5181 |
postBuildBlock:nil |
2111 | 5182 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5183 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5184 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5185 |
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
|
5186 |
|
2111 | 5187 |
Transcript showCR:( |
5188 |
Dialog |
|
5189 |
choose:'choose any' |
|
5190 |
fromList:#('one' 'two' 'three' 'four') |
|
5191 |
values:#(1 2 3 4) |
|
5192 |
buttons:nil |
|
5193 |
values:nil |
|
5194 |
lines:4 |
|
5195 |
cancel:nil |
|
5196 |
multiple:true |
|
5197 |
) |
|
133 | 5198 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5199 |
|
3340 | 5200 |
"Created: / 22-08-2006 / 16:10:19 / cg" |
5201 |
! |
|
5202 |
||
5203 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
|
5204 |
"launch a Dialog showing the message and list. |
|
5205 |
The user can select an item and click ok; in this case, the corresponding value |
|
5206 |
from listValues is returned (doubleclick works as well). |
|
5207 |
The list may be suppressed (if the list arg is nil). |
|
5208 |
If a list is present, multiple controls if multiple selections are allowed. |
|
5209 |
Below the list, an optional row of buttons is shown, which can also be |
|
5210 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5211 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5212 |
Pressing ok without a selection is treated like cancel." |
|
5213 |
||
5214 |
^ self |
|
5215 |
choose:aString |
|
3455 | 5216 |
fromList:list values:listValues |
3340 | 5217 |
initialSelection:initialListSelectionOrNil |
3455 | 5218 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5219 |
default:nil |
3340 | 5220 |
lines:maxLines |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5221 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5222 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5223 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5224 |
postBuildBlock:aBlockOrNil |
3340 | 5225 |
|
3455 | 5226 |
"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
|
5227 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5228 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5229 |
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
|
5230 |
"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
|
5231 |
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
|
5232 |
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
|
5233 |
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
|
5234 |
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
|
5235 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5236 |
^ self |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5237 |
choose:aString |
3455 | 5238 |
fromList:list values:listValues |
5239 |
buttons:nil values:nil |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5240 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5241 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5242 |
multiple:false |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5243 |
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
|
5244 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5245 |
" |
655 | 5246 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5247 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5248 |
choose:'choose any' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5249 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5250 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5251 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5252 |
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
|
5253 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5254 |
|
655 | 5255 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5256 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5257 |
choose:'choose example' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5258 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5259 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5260 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5261 |
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
|
5262 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5263 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5264 |
|
3455 | 5265 |
"Modified: / 02-03-2007 / 12:07:42 / cg" |
5266 |
! |
|
5267 |
||
3630 | 5268 |
choose:aString fromList:list values:values lines:maxLines cancel:cancelBlock title:windowTitle |
5269 |
"launch a Dialog showing the message and list. |
|
5270 |
The user can select an item and click ok; in this case, the corresponding value |
|
5271 |
from listValues is returned (doubleclick works as well). |
|
5272 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5273 |
Pressing ok without a selection is treated like cancel." |
|
5274 |
||
5275 |
^ self |
|
5276 |
choose:aString |
|
5277 |
fromList:list values:values |
|
5278 |
initialSelection:nil |
|
5279 |
buttons:nil values:nil |
|
5280 |
default:nil |
|
5281 |
lines:maxLines |
|
5282 |
cancel:cancelBlock |
|
5283 |
multiple:false |
|
5284 |
title:windowTitle |
|
5285 |
postBuildBlock:nil |
|
5286 |
||
5287 |
" |
|
5288 |
Transcript showCR:( |
|
5289 |
Dialog |
|
5290 |
choose:'choose any' |
|
5291 |
fromList:#(1 2 3 4 5 6 7) |
|
5292 |
lines:4 |
|
5293 |
title:'Choose' |
|
5294 |
) |
|
5295 |
" |
|
5296 |
||
5297 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5298 |
! |
|
5299 |
||
3455 | 5300 |
choose:aString fromList:list values:values lines:maxLines initialSelection:initialSelection title:windowTitle |
5301 |
"launch a Dialog showing the message and list. |
|
5302 |
The user can select an item and click ok; in this case, the corresponding value |
|
5303 |
from listValues is returned (doubleclick works as well). |
|
5304 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5305 |
Pressing ok without a selection is treated like cancel." |
|
5306 |
||
5307 |
^ self |
|
5308 |
choose:aString |
|
5309 |
fromList:list values:values |
|
5310 |
initialSelection:initialSelection |
|
5311 |
buttons:nil values:nil |
|
5312 |
default:nil |
|
5313 |
lines:maxLines |
|
5314 |
cancel:nil |
|
5315 |
multiple:false |
|
5316 |
title:windowTitle |
|
5317 |
postBuildBlock:nil |
|
5318 |
||
5319 |
" |
|
5320 |
Transcript showCR:( |
|
5321 |
Dialog |
|
5322 |
choose:'choose any' |
|
5323 |
fromList:#(1 2 3 4 5 6 7) |
|
5324 |
lines:4 |
|
5325 |
title:'Choose' |
|
5326 |
) |
|
5327 |
" |
|
5328 |
||
5329 |
"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
|
5330 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5331 |
|
3630 | 5332 |
choose:aString fromList:list values:values lines:maxLines title:windowTitle |
5333 |
"launch a Dialog showing the message and list. |
|
5334 |
The user can select an item and click ok; in this case, the corresponding value |
|
5335 |
from listValues is returned (doubleclick works as well). |
|
5336 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5337 |
Pressing ok without a selection is treated like cancel." |
|
5338 |
||
5339 |
^ self |
|
5340 |
choose:aString |
|
5341 |
fromList:list values:values |
|
5342 |
initialSelection:nil |
|
5343 |
buttons:nil values:nil |
|
5344 |
default:nil |
|
5345 |
lines:maxLines |
|
5346 |
cancel:nil |
|
5347 |
multiple:false |
|
5348 |
title:windowTitle |
|
5349 |
postBuildBlock:nil |
|
5350 |
||
5351 |
" |
|
5352 |
Transcript showCR:( |
|
5353 |
Dialog |
|
5354 |
choose:'choose any' |
|
5355 |
fromList:#(1 2 3 4 5 6 7) |
|
5356 |
lines:4 |
|
5357 |
title:'Choose' |
|
5358 |
) |
|
5359 |
" |
|
5360 |
||
5361 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5362 |
! |
|
5363 |
||
2473 | 5364 |
choose:aString label:windowLabel image:imageOrNil labels:buttonLabels values:values default:default onCancel:cancelValue |
2472 | 5365 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
5366 |
Returning a corresponding value from the values-array. |
|
5367 |
The default entries button is marked as a return button and entering |
|
5368 |
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
|
5369 |
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
|
5370 |
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
|
5371 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5372 |
|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
|
5373 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5374 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
803 | 5375 |
windowLabel notNil ifTrue:[ |
2439 | 5376 |
box label:windowLabel |
803 | 5377 |
]. |
2473 | 5378 |
imageOrNil notNil ifTrue:[ |
5379 |
box image:imageOrNil |
|
5380 |
]. |
|
5381 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5382 |
box buttonTitles:(self classResources array:buttonLabels) |
2439 | 5383 |
actions:(values collect:[:val | [answer := val]]). |
2472 | 5384 |
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
|
5385 |
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
|
5386 |
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
|
5387 |
idx ~~ 0 ifTrue:[box defaultButtonIndex:idx]. |
2439 | 5388 |
|
5389 |
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
|
5390 |
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
|
5391 |
^ 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
|
5392 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5393 |
"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
|
5394 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5395 |
Dialog |
2439 | 5396 |
choose:'choose any' |
2472 | 5397 |
label:'Foo Bar Baz' |
2439 | 5398 |
labels:#('one' 'two' 'three' 'four') |
5399 |
values:#(1 2 3 4) |
|
2472 | 5400 |
default:2 |
5401 |
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
|
5402 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5403 |
Dialog |
2439 | 5404 |
choose:'choose any' |
5405 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5406 |
values:#(nil foo bar baz) |
|
5407 |
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
|
5408 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5409 |
Dialog |
2439 | 5410 |
choose:'choose any' |
5411 |
labels:#('one' 'two' 'three' 'four') |
|
5412 |
values:#(1 2 3 4) |
|
5413 |
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
|
5414 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5415 |
|
2473 | 5416 |
"Modified: / 16.11.2001 / 14:55:33 / cg" |
5417 |
"Created: / 16.11.2001 / 15:04:16 / cg" |
|
5418 |
! |
|
5419 |
||
5420 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default |
|
5421 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5422 |
Returning a corresponding value from the values-array. |
|
5423 |
The default entries button is marked as a return button and entering |
|
5424 |
return will choose that value; hitting escape returns nil. |
|
5425 |
For a good userInterface style, we recommend this being the last |
|
5426 |
entry (to make the right-most button the default button)." |
|
5427 |
||
5428 |
^ self |
|
5429 |
choose:aString |
|
3455 | 5430 |
label:windowLabel image:nil |
5431 |
labels:buttonLabels values:values |
|
2473 | 5432 |
default:default |
5433 |
onCancel:nil |
|
5434 |
||
5435 |
"no good style (default button is not the rightmost one) |
|
5436 |
||
5437 |
Dialog |
|
5438 |
choose:'choose any' |
|
5439 |
labels:#('one' 'two' 'three' 'four') |
|
5440 |
values:#(1 2 3 4) |
|
5441 |
default:2 |
|
5442 |
||
5443 |
Dialog |
|
5444 |
choose:'choose any' |
|
5445 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5446 |
values:#(nil foo bar baz) |
|
5447 |
default:#baz |
|
5448 |
||
5449 |
Dialog |
|
5450 |
choose:'choose any' |
|
5451 |
labels:#('one' 'two' 'three' 'four') |
|
5452 |
values:#(1 2 3 4) |
|
5453 |
default:nil |
|
5454 |
" |
|
5455 |
||
3455 | 5456 |
"Created: / 22-07-1996 / 11:44:27 / cg" |
5457 |
"Modified: / 02-03-2007 / 12:09:01 / cg" |
|
2473 | 5458 |
! |
5459 |
||
5460 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default onCancel:cancelValue |
|
5461 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5462 |
Returning a corresponding value from the values-array. |
|
5463 |
The default entries button is marked as a return button and entering |
|
5464 |
return will choose that value; hitting escape returns cancelValue. |
|
5465 |
For a good userInterface style, we recommend this being the last |
|
5466 |
entry (to make the right-most button the default button)." |
|
5467 |
||
5468 |
^ self |
|
3455 | 5469 |
choose:aString |
5470 |
label:windowLabel image:nil |
|
2473 | 5471 |
labels:buttonLabels values:values |
5472 |
default:default onCancel:cancelValue |
|
5473 |
||
5474 |
"no good style (default button is not the rightmost one) |
|
5475 |
||
5476 |
Dialog |
|
5477 |
choose:'choose any' |
|
5478 |
label:'Foo Bar Baz' |
|
5479 |
labels:#('one' 'two' 'three' 'four') |
|
5480 |
values:#(1 2 3 4) |
|
5481 |
default:2 |
|
5482 |
onCancel:1 |
|
5483 |
||
5484 |
Dialog |
|
5485 |
choose:'choose any' |
|
5486 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5487 |
values:#(nil foo bar baz) |
|
5488 |
default:#baz |
|
5489 |
||
5490 |
Dialog |
|
5491 |
choose:'choose any' |
|
5492 |
labels:#('one' 'two' 'three' 'four') |
|
5493 |
values:#(1 2 3 4) |
|
5494 |
default:nil |
|
5495 |
" |
|
5496 |
||
3455 | 5497 |
"Created: / 16-11-2001 / 14:53:55 / cg" |
5498 |
"Modified: / 02-03-2007 / 12:08:44 / cg" |
|
803 | 5499 |
! |
5500 |
||
5501 |
choose:aString labels:buttonLabels values:values default:default |
|
5502 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5503 |
Returning a corresponding value from the values-array. |
|
5504 |
The default entries button is marked as a return button and entering |
|
5505 |
return will choose that value. |
|
5506 |
For a good userInterface style, we recommend this being the last |
|
5507 |
entry (to make the right-most button the default button)." |
|
5508 |
||
5509 |
^ self |
|
2473 | 5510 |
choose:aString |
3455 | 5511 |
label:nil image:nil |
5512 |
labels:buttonLabels values:values |
|
2473 | 5513 |
default:default |
5514 |
onCancel:nil |
|
803 | 5515 |
|
5516 |
||
5517 |
"no good style (default button is not the rightmost one) |
|
5518 |
||
5519 |
Dialog |
|
2473 | 5520 |
choose:'choose any' |
5521 |
labels:#('one' 'two' 'three' 'four') |
|
5522 |
values:#(1 2 3 4) |
|
5523 |
default:2 |
|
803 | 5524 |
|
5525 |
Dialog |
|
2473 | 5526 |
choose:'choose any' |
5527 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5528 |
values:#(nil foo bar baz) |
|
5529 |
default:#baz |
|
803 | 5530 |
|
5531 |
Dialog |
|
2473 | 5532 |
choose:'choose any' |
5533 |
labels:#('one' 'two' 'three' 'four') |
|
5534 |
values:#(1 2 3 4) |
|
5535 |
default:nil |
|
5536 |
" |
|
5537 |
||
3455 | 5538 |
"Modified: / 02-03-2007 / 12:08:55 / cg" |
2111 | 5539 |
! |
5540 |
||
5541 |
chooseMultiple:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock |
|
5542 |
"launch a Dialog showing the message and list. |
|
5543 |
The user can select an item and click ok; in this case, the corresponding value |
|
5544 |
from listValues is returned (doubleclick works as well). |
|
5545 |
The list may be suppressed (if the list arg is nil). |
|
5546 |
Below the list, an optional row of buttons is shown, which can also be |
|
5547 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5548 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5549 |
Pressing ok without a selection is treated like cancel." |
|
5550 |
||
5551 |
^ self |
|
5552 |
choose:aString |
|
3455 | 5553 |
fromList:list values:listValues |
5554 |
buttons:buttonLabels values:buttonValues |
|
2111 | 5555 |
lines:maxLines |
5556 |
cancel:cancelBlock |
|
5557 |
multiple:true |
|
5558 |
||
5559 |
" |
|
5560 |
full example: |
|
5561 |
||
5562 |
Transcript showCR:( |
|
5563 |
Dialog |
|
2112 | 5564 |
chooseMultiple:'choose selected' |
2111 | 5565 |
fromList:#('one' 'two' 'three' 'four') |
5566 |
values:#(1 2 3 4) |
|
5567 |
buttons:nil |
|
5568 |
values:nil |
|
5569 |
lines:10 |
|
5570 |
cancel:nil |
|
5571 |
) |
|
2112 | 5572 |
|
5573 |
Transcript showCR:( |
|
5574 |
Dialog |
|
5575 |
chooseMultiple:'choose selected' |
|
5576 |
fromList:#('one' 'two' 'three' 'four') |
|
5577 |
values:#(1 2 3 4) |
|
5578 |
buttons:#() |
|
5579 |
values:#() |
|
5580 |
lines:10 |
|
5581 |
cancel:nil |
|
5582 |
) |
|
2111 | 5583 |
" |
5584 |
||
3455 | 5585 |
"Modified: / 02-03-2007 / 12:09:10 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5586 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5587 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5588 |
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
|
5589 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5590 |
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
|
5591 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5592 |
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
|
5593 |
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
|
5594 |
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
|
5595 |
If cancel is pressed, the value of cancelBlock is returned. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5596 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5597 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5598 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5599 |
choose:aString |
3455 | 5600 |
fromList:list values:listValues |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5601 |
initialSelection:initialListSelectionOrNil |
3455 | 5602 |
buttons:nil values:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5603 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5604 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5605 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5606 |
postBuildBlock:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5607 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5608 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5609 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5610 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5611 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5612 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5613 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5614 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5615 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5616 |
initialSelection:#(2 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5617 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5618 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5619 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5620 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5621 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5622 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5623 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5624 |
values:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5625 |
initialSelection:#( 'two' 'three') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5626 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5627 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5628 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5629 |
|
3455 | 5630 |
"Created: / 18-08-2000 / 22:38:13 / cg" |
5631 |
"Modified: / 02-03-2007 / 12:09:15 / cg" |
|
100 | 5632 |
! ! |
5633 |
||
2439 | 5634 |
!DialogBox class methodsFor:'private'! |
5635 |
||
5636 |
showAndThenDestroyBox:aBox |
|
5637 |
self showBox:aBox. |
|
5638 |
aBox destroy |
|
5639 |
! |
|
5640 |
||
5641 |
showBox:aBox |
|
2666
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5642 |
|wg v| |
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5643 |
|
2439 | 5644 |
ForceModalBoxesToOpenAtCenter == true ifTrue:[ |
5645 |
aBox showAtCenter. |
|
3888 | 5646 |
^ self. |
5647 |
]. |
|
5648 |
ForceModalBoxesToOpenAtPointer == true ifTrue:[ |
|
5649 |
aBox showAtPointer. |
|
5650 |
^ self. |
|
5651 |
]. |
|
5652 |
||
5653 |
wg := WindowGroup activeGroup. |
|
5654 |
wg isNil ifTrue:[ |
|
5655 |
aBox showAtCenter. |
|
5656 |
^ self. |
|
5657 |
]. |
|
5658 |
wg isModal ifTrue:[ |
|
5659 |
v := wg mainView. |
|
5660 |
v notNil ifTrue:[ |
|
5661 |
aBox showCenteredIn:v. |
|
5662 |
^ self. |
|
5663 |
]. |
|
5664 |
]. |
|
5665 |
||
5666 |
v := wg mainGroup mainView. |
|
5667 |
v isNil ifTrue:[ |
|
5668 |
aBox showAtCenter. |
|
5669 |
^ self. |
|
5670 |
]. |
|
5671 |
||
5672 |
aBox showCenteredIn:v. |
|
2439 | 5673 |
! ! |
5674 |
||
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5675 |
!DialogBox class methodsFor:'queries'! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5676 |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5677 |
defaultOKButtonAtLeft |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5678 |
"somewhat of a kludge: |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5679 |
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
|
5680 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5681 |
^ (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
|
5682 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5683 |
" |
2694 | 5684 |
DialogBox defaultOKButtonAtLeft |
5685 |
" |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5686 |
! |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5687 |
|
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5688 |
defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5689 |
"return a default parent (top-) window for the dialog. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5690 |
Here, the currently active view is returned, if there |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5691 |
is one; otherwise, the first encountered topView is |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5692 |
returned." |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5693 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5694 |
|activeGroup| |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5695 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5696 |
activeGroup := WindowGroup activeGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5697 |
activeGroup isNil ifTrue:[ |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5698 |
"/ mhmh - looks like I am a background process ... |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5699 |
activeGroup := Transcript windowGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5700 |
activeGroup isNil ifTrue:[^ nil]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5701 |
]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5702 |
^ activeGroup topViews first. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5703 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5704 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5705 |
self defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5706 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5707 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5708 |
"Modified: / 16.6.1998 / 12:36:15 / cg" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5709 |
! ! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5710 |
|
2486 | 5711 |
!DialogBox class methodsFor:'smalltalk dialogs'! |
5712 |
||
3276 | 5713 |
requestClass:aString |
5714 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5715 |
Return the entered class or nil (if cancel was pressed). |
|
5716 |
The entryField does classNameCompletion on TAB." |
|
5717 |
||
5718 |
^ self requestClass:aString okLabel:'OK' initialAnswer:nil. |
|
5719 |
||
5720 |
" |
|
5721 |
Dialog |
|
5722 |
requestClass:'Enter a class:' |
|
5723 |
" |
|
5724 |
! |
|
5725 |
||
3282 | 5726 |
requestClass:aString initialAnswer:initialAnswer |
5727 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5728 |
Return the entered class or nil (if cancel was pressed). |
|
5729 |
The entryField does classNameCompletion on TAB." |
|
5730 |
||
5731 |
^ self requestClass:aString okLabel:'OK' initialAnswer:initialAnswer. |
|
5732 |
||
5733 |
" |
|
5734 |
Dialog |
|
5735 |
requestClass:'Enter a class:' |
|
5736 |
initialAnswer:'Array' |
|
5737 |
" |
|
5738 |
! |
|
5739 |
||
3532 | 5740 |
requestClass:aString list:list okLabel:okLabel initialAnswer:initial |
3276 | 5741 |
"launch a Dialog, which allows user to enter an existing classes name. |
5742 |
Return the entered class or nil (if cancel was pressed). |
|
3181 | 5743 |
The entryField does classNameCompletion on TAB." |
5744 |
||
5745 |
|className| |
|
5746 |
||
3532 | 5747 |
className := self requestClassName:aString list:list okLabel:okLabel initialAnswer:initial. |
3276 | 5748 |
className isEmptyOrNil ifTrue:[^ nil]. |
3181 | 5749 |
^ Smalltalk classNamed:className |
5750 |
||
5751 |
" |
|
5752 |
Dialog |
|
3276 | 5753 |
requestClass:'Enter a class:' |
3181 | 5754 |
okLabel:'OK' |
5755 |
initialAnswer:'Arr' |
|
5756 |
" |
|
3532 | 5757 |
|
5758 |
"Created: / 12-01-2008 / 23:02:28 / cg" |
|
5759 |
! |
|
5760 |
||
5761 |
requestClass:aString okLabel:okLabel initialAnswer:initial |
|
5762 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5763 |
Return the entered class or nil (if cancel was pressed). |
|
5764 |
The entryField does classNameCompletion on TAB." |
|
5765 |
||
5766 |
^ self requestClass:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5767 |
||
5768 |
" |
|
5769 |
Dialog |
|
5770 |
requestClass:'Enter a class:' |
|
5771 |
okLabel:'OK' |
|
5772 |
initialAnswer:'Arr' |
|
5773 |
" |
|
5774 |
||
5775 |
"Modified: / 12-01-2008 / 23:02:42 / cg" |
|
5776 |
! |
|
5777 |
||
5778 |
requestClassName:aString list:list okLabel:okLabel initialAnswer:initial |
|
3181 | 5779 |
"launch a Dialog, which allows user to enter a class name. |
5780 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5781 |
The entryField does classNameCompletion on TAB." |
|
5782 |
||
5783 |
^ self |
|
5784 |
request:aString |
|
5785 |
displayAt:nil |
|
5786 |
centered:nil |
|
5787 |
action:nil |
|
5788 |
initialAnswer:initial |
|
5789 |
okLabel:okLabel |
|
5790 |
cancelLabel:nil |
|
5791 |
title:nil |
|
5792 |
onCancel:nil |
|
3532 | 5793 |
list:list |
3181 | 5794 |
initialSelection:nil |
3182 | 5795 |
entryCompletionBlock:DoWhatIMeanSupport classNameEntryCompletionBlock |
3181 | 5796 |
|
5797 |
" |
|
5798 |
Dialog |
|
3532 | 5799 |
requestClassName:'Enter a class:' |
5800 |
list:(Array with:Array with:String with:Point) |
|
5801 |
okLabel:'OK' |
|
5802 |
initialAnswer:'Arr' |
|
5803 |
" |
|
5804 |
||
5805 |
"Created: / 12-01-2008 / 22:58:01 / cg" |
|
5806 |
! |
|
5807 |
||
5808 |
requestClassName:aString okLabel:okLabel initialAnswer:initial |
|
5809 |
"launch a Dialog, which allows user to enter a class name. |
|
5810 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5811 |
The entryField does classNameCompletion on TAB." |
|
5812 |
||
5813 |
^ self requestClassName:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5814 |
||
5815 |
" |
|
5816 |
Dialog |
|
3181 | 5817 |
requestClassName:'enter a class:' |
5818 |
okLabel:'OK' |
|
5819 |
initialAnswer:'Arr' |
|
5820 |
" |
|
3532 | 5821 |
|
5822 |
"Modified: / 12-01-2008 / 22:58:13 / cg" |
|
3181 | 5823 |
! |
5824 |
||
3538 | 5825 |
requestName:title fromList:nameList title:boxTitle initialAnswer:initialTextOrNil |
5826 |
"Ask for a name from a list (used for namespaces and sharedPools)" |
|
5827 |
||
5828 |
|newName box| |
|
5829 |
||
5830 |
box := ListSelectionBox new. |
|
5831 |
box title:title. |
|
5832 |
box list:nameList. |
|
5833 |
box okAction:[:sel | newName := sel]. |
|
5834 |
box initialText:initialTextOrNil. |
|
5835 |
boxTitle notNil ifTrue:[ box label:boxTitle ]. |
|
5836 |
box showAtPointer. |
|
5837 |
||
5838 |
newName notNil ifTrue:[ |
|
5839 |
newName := newName withoutSeparators. |
|
5840 |
]. |
|
5841 |
^ newName |
|
5842 |
||
5843 |
" |
|
5844 |
Dialog |
|
5845 |
requestName:'Select a Name' |
|
5846 |
fromList:#('foo' 'bar' 'baz') |
|
5847 |
title:'blabla' |
|
5848 |
initialAnswer:nil |
|
5849 |
" |
|
5850 |
! |
|
5851 |
||
2486 | 5852 |
requestNameSpace:title initialAnswer:initialTextOrNil |
5853 |
"Ask for a namespaces name" |
|
5854 |
||
2996 | 5855 |
^ self |
5856 |
requestNameSpace:title |
|
3538 | 5857 |
title:title |
2996 | 5858 |
initialAnswer:initialTextOrNil |
5859 |
||
5860 |
" |
|
3538 | 5861 |
Dialog |
5862 |
requestNameSpace:'Select a NameSpace' |
|
5863 |
initialAnswer:nil |
|
2996 | 5864 |
" |
5865 |
! |
|
5866 |
||
5867 |
requestNameSpace:title title:boxTitle initialAnswer:initialTextOrNil |
|
5868 |
"Ask for a namespaces name" |
|
5869 |
||
3538 | 5870 |
|allNameSpaces| |
2486 | 5871 |
|
3282 | 5872 |
allNameSpaces := NameSpace allNameSpaces collect:[:each | each name]. |
2486 | 5873 |
allNameSpaces := allNameSpaces asOrderedCollection sort. |
5874 |
||
3538 | 5875 |
^ self |
5876 |
requestName:title |
|
5877 |
fromList:allNameSpaces |
|
5878 |
title:boxTitle |
|
5879 |
initialAnswer:initialTextOrNil |
|
5880 |
||
5881 |
" |
|
5882 |
Dialog |
|
5883 |
requestNameSpace:'Select a NameSpace' |
|
5884 |
initialAnswer:nil |
|
2486 | 5885 |
" |
5886 |
! |
|
5887 |
||
3736 | 5888 |
requestProject:title from:listOfProjects initialAnswer:initialTextOrNil suggestions:suggestions |
3384 | 5889 |
"Ask for a project (package-id)" |
5890 |
||
3736 | 5891 |
|newProject box| |
3384 | 5892 |
|
5893 |
box := ListSelectionBox new. |
|
5894 |
box useComboBoxWithList:suggestions. |
|
5895 |
box title:title. |
|
3736 | 5896 |
box list:listOfProjects. |
3384 | 5897 |
box okAction:[:sel | newProject := sel]. |
5898 |
box initialText:initialTextOrNil. |
|
5899 |
box entryCompletionBlock:(DoWhatIMeanSupport packageNameEntryCompletionBlock). |
|
5900 |
box label:'Enter Project'. |
|
5901 |
box showAtPointer. |
|
5902 |
||
5903 |
newProject notNil ifTrue:[ |
|
5904 |
newProject := newProject withoutSeparators asSymbol. |
|
5905 |
]. |
|
5906 |
^ newProject |
|
5907 |
||
5908 |
" |
|
5909 |
Dialog |
|
5910 |
requestProject:'enter a project' |
|
5911 |
initialAnswer:'stx:libbasic' |
|
5912 |
suggestions:#('foo' 'bar' 'baz') |
|
5913 |
" |
|
5914 |
||
5915 |
"Created: / 07-09-2006 / 11:40:17 / cg" |
|
5916 |
! |
|
5917 |
||
3736 | 5918 |
requestProject:title initialAnswer:initialTextOrNil suggestions:suggestions |
5919 |
"Ask for a project (package-id)" |
|
5920 |
||
5921 |
|allProjects| |
|
5922 |
||
5923 |
allProjects := Smalltalk allProjectIDs. |
|
5924 |
^ self |
|
5925 |
requestProject:title |
|
5926 |
from:allProjects |
|
5927 |
initialAnswer:initialTextOrNil |
|
5928 |
suggestions:suggestions |
|
5929 |
! |
|
5930 |
||
2486 | 5931 |
requestSelector:aString initialAnswer:initial |
5932 |
"launch a Dialog, which allows user to enter a method selector. |
|
5933 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5934 |
The entryField does selectorCompletion on TAB." |
|
5935 |
||
5936 |
^ self requestSelector:aString okLabel:nil initialAnswer:initial |
|
5937 |
||
5938 |
" |
|
5939 |
Dialog |
|
5940 |
requestSelector:'enter a selector:' |
|
5941 |
initialAnswer:'at:p' |
|
5942 |
" |
|
5943 |
! |
|
5944 |
||
5945 |
requestSelector:aString okLabel:okLabel initialAnswer:initial |
|
5946 |
"launch a Dialog, which allows user to enter a method selector. |
|
5947 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5948 |
The entryField does selectorCompletion on TAB." |
|
5949 |
||
5950 |
^ self |
|
5951 |
request:aString |
|
5952 |
displayAt:nil |
|
5953 |
centered:nil |
|
5954 |
action:nil |
|
5955 |
initialAnswer:initial |
|
5956 |
okLabel:okLabel |
|
5957 |
cancelLabel:nil |
|
5958 |
title:nil |
|
5959 |
onCancel:nil |
|
5960 |
list:nil |
|
5961 |
initialSelection:nil |
|
2629 | 5962 |
entryCompletionBlock:[:s :field| |
5963 |
|completion| |
|
2486 | 5964 |
|
5965 |
completion := Smalltalk selectorCompletion:s. |
|
3881 | 5966 |
completion second size > 1 ifTrue:[ |
5967 |
UserPreferences current beepInEditor ifTrue:[ |
|
5968 |
Screen current beep |
|
5969 |
]. |
|
5970 |
]. |
|
2629 | 5971 |
field contents:(completion first) |
2486 | 5972 |
] |
5973 |
||
5974 |
" |
|
5975 |
Dialog |
|
5976 |
requestSelector:'enter a selector:' |
|
5977 |
initialAnswer:'at:p' |
|
5978 |
" |
|
3538 | 5979 |
! |
5980 |
||
5981 |
requestSharedPool:title title:boxTitle initialAnswer:initialTextOrNil |
|
5982 |
"Ask for a sharedPools name" |
|
5983 |
||
5984 |
|allPools| |
|
5985 |
||
5986 |
allPools := SharedPool allSubclasses collect:[:each | each name]. |
|
5987 |
allPools := allPools asOrderedCollection sort. |
|
5988 |
||
5989 |
^ self |
|
5990 |
requestName:title |
|
5991 |
fromList:allPools |
|
5992 |
title:boxTitle |
|
5993 |
initialAnswer:initialTextOrNil |
|
5994 |
||
5995 |
" |
|
5996 |
Dialog |
|
5997 |
requestSharedPool:'Select a SharedPool' |
|
5998 |
title:nil |
|
5999 |
initialAnswer:nil |
|
6000 |
" |
|
2486 | 6001 |
! ! |
6002 |
||
197 | 6003 |
!DialogBox methodsFor:'accessing-behavior'! |
6004 |
||
6005 |
abortAction:aBlock |
|
6006 |
"define the action to be performed when abort is pressed" |
|
6007 |
||
6008 |
abortAction := aBlock |
|
125 | 6009 |
! |
6010 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6011 |
acceptCheck:aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6012 |
"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
|
6013 |
accepted (ok-button or Return-key). If it returns true, the box is closed, |
2106 | 6014 |
otherwise not. Of course, you may also use a valueHolder instead of a block |
6015 |
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
|
6016 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6017 |
acceptCheck := aBlock |
2106 | 6018 |
|
6019 |
"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
|
6020 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6021 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6022 |
acceptOnLeave:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6023 |
"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
|
6024 |
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
|
6025 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6026 |
acceptOnLeave := aBoolean. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6027 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6028 |
"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
|
6029 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6030 |
|
197 | 6031 |
acceptReturnAsOK:aBoolean |
6032 |
"turn on/off interpretation of return-key as ok. |
|
6033 |
Default is on" |
|
6034 |
||
6035 |
acceptReturnAsOK := aBoolean. |
|
6036 |
okButton notNil ifTrue:[ |
|
6037 |
okButton isReturnButton:aBoolean. |
|
6038 |
] |
|
6039 |
! |
|
6040 |
||
6041 |
action:aBlock |
|
6042 |
"set the action to be performed when user presses ok-button; |
|
6043 |
aBlock must be nil or a block. This method simply |
|
6044 |
reuses okAction: and has been added for a consistent action-setting |
|
6045 |
protocol." |
|
76 | 6046 |
|
197 | 6047 |
self okAction:aBlock |
6048 |
! |
|
6049 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6050 |
focusOnField:anInputField |
1646 | 6051 |
"arrange for the argument to get the focus (initially)" |
6052 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6053 |
inputFieldGroup makeActive:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6054 |
|
1646 | 6055 |
"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
|
6056 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6057 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6058 |
focusToOKOnLeave:aBoolean |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6059 |
"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
|
6060 |
or cursor key. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6061 |
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
|
6062 |
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
|
6063 |
the dialog is accepted & closed." |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6064 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6065 |
focusToOKOnLeave := aBoolean. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6066 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6067 |
"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
|
6068 |
"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
|
6069 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6070 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6071 |
hideOnAccept:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6072 |
"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
|
6073 |
The default is true" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6074 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6075 |
hideOnAccept := aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6076 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6077 |
|
593 | 6078 |
makeTabable:aComponentOrSubcomponent |
6079 |
"add a component (usually a subcomponent, of which the dialog |
|
6080 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6081 |
stepped through via FocusNext/FocusPrevious). |
|
6082 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6083 |
||
3467 | 6084 |
aComponentOrSubcomponent canTab:true. |
6085 |
||
6086 |
"/ tabableElements isNil ifTrue:[ |
|
6087 |
"/ tabableElements := OrderedCollection new |
|
6088 |
"/ ]. |
|
6089 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6090 |
"/ tabableElements add:aComponentOrSubcomponent. |
|
6091 |
"/ ]. |
|
6092 |
||
6093 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6094 |
self addToInputFieldGroup:aComponentOrSubcomponent |
|
593 | 6095 |
]. |
6096 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
6097 |
"Modified: 31.5.1996 / 21:22:13 / cg" |
593 | 6098 |
! |
6099 |
||
1843 | 6100 |
makeTabable:aComponentOrSubcomponent after:anotherComponent |
6101 |
"add a component (usually a subcomponent, of which the dialog |
|
6102 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6103 |
stepped through via FocusNext/FocusPrevious). |
|
6104 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6105 |
||
3467 | 6106 |
<resource: #obsolete> |
6107 |
self obsoleteMethodWarning. "/ focusSequence has been eliminated |
|
6108 |
||
6109 |
aComponentOrSubcomponent canTab:true. |
|
6110 |
||
6111 |
"/ tabableElements isNil ifTrue:[ |
|
6112 |
"/ tabableElements := OrderedCollection new |
|
6113 |
"/ ]. |
|
6114 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent ifAbsent:nil. |
|
6115 |
"/ |
|
6116 |
"/ anotherComponent isNil ifTrue:[ |
|
6117 |
"/ tabableElements addLast:aComponentOrSubcomponent |
|
6118 |
"/ ] ifFalse:[ |
|
6119 |
"/ tabableElements add:aComponentOrSubcomponent after:anotherComponent. |
|
6120 |
"/ ]. |
|
6121 |
"/ |
|
1843 | 6122 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
6123 |
self addToInputFieldGroup:aComponentOrSubcomponent after:anotherComponent |
|
6124 |
]. |
|
6125 |
||
6126 |
"Modified: 18.10.1997 / 03:08:20 / cg" |
|
6127 |
! |
|
6128 |
||
1355 | 6129 |
makeUntabable:aComponentOrSubcomponent |
3467 | 6130 |
aComponentOrSubcomponent canTab:false. |
6131 |
||
6132 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6133 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent. |
|
6134 |
"/ ]. |
|
6135 |
||
6136 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6137 |
self removeFromInputFieldGroup:aComponentOrSubcomponent |
|
1355 | 6138 |
]. |
6139 |
||
6140 |
"Modified: 18.10.1997 / 02:50:05 / cg" |
|
593 | 6141 |
! |
6142 |
||
2361 | 6143 |
noAction:aBlock |
6144 |
"define the action to be performed when 'no' is pressed" |
|
6145 |
||
6146 |
abortAction := aBlock |
|
6147 |
||
6148 |
"Modified: 16.1.1997 / 11:29:18 / cg" |
|
6149 |
! |
|
6150 |
||
197 | 6151 |
okAction:aBlock |
6152 |
"define the action to be performed when ok is pressed" |
|
133 | 6153 |
|
197 | 6154 |
okAction := aBlock |
2361 | 6155 |
! |
6156 |
||
6157 |
title:aString yesAction:yesBlock noAction:noBlock |
|
6158 |
"define title and actions" |
|
6159 |
||
6160 |
self title:aString. |
|
6161 |
okAction := yesBlock. |
|
6162 |
abortAction := noBlock |
|
6163 |
! |
|
6164 |
||
6165 |
yesAction:aBlock |
|
6166 |
"define the action to be performed when 'yes' is pressed" |
|
6167 |
||
6168 |
okAction := aBlock |
|
6169 |
||
6170 |
"Modified: 16.1.1997 / 11:31:21 / cg" |
|
6171 |
! |
|
6172 |
||
6173 |
yesAction:yesBlock noAction:noBlock |
|
6174 |
"define both actions" |
|
6175 |
||
6176 |
okAction := yesBlock. |
|
6177 |
abortAction := noBlock |
|
197 | 6178 |
! ! |
6179 |
||
6180 |
!DialogBox methodsFor:'accessing-components'! |
|
6181 |
||
6182 |
abortButton |
|
6183 |
"return the abortButton - this access is provided to allow |
|
6184 |
setting the buttons look (for example: colors or font)" |
|
6185 |
||
6186 |
^ abortButton |
|
76 | 6187 |
! |
6188 |
||
2327 | 6189 |
buttonPanel |
6190 |
"return the buttonPanel - this access is provided to allow |
|
6191 |
setting the buttons look (for example: colors or font)" |
|
6192 |
||
6193 |
^ buttonPanel |
|
6194 |
! |
|
6195 |
||
2147
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6196 |
cancelButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6197 |
"same as #abortButton; |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6198 |
return the abortButton - this access is provided to allow |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6199 |
setting the buttons look (for example: colors or font)" |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6200 |
|
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6201 |
^ self abortButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6202 |
! |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6203 |
|
2361 | 6204 |
noButton |
6205 |
"return the no-button" |
|
6206 |
||
6207 |
^ abortButton |
|
6208 |
! |
|
6209 |
||
197 | 6210 |
okButton |
6211 |
"return the okButton - this access is provided to allow |
|
6212 |
setting the buttons look (for example: colors or font)" |
|
76 | 6213 |
|
197 | 6214 |
^ okButton |
2361 | 6215 |
! |
6216 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6217 |
verticalPanel |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6218 |
"if there is none yet, create and add a vertical panel. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6219 |
This can be used to additional components in an aboutToOpen hook callback." |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6220 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6221 |
|savedY| |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6222 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6223 |
verticalPanel isNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6224 |
savedY := yPosition. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6225 |
self addComponent:(verticalPanel := VerticalPanelView new). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6226 |
verticalPanel horizontalLayout:#fit. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6227 |
verticalPanel verticalLayout:#top. |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6228 |
verticalPanel height:25. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6229 |
yPosition := savedY. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6230 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6231 |
^ verticalPanel |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6232 |
! |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6233 |
|
2361 | 6234 |
yesButton |
6235 |
"return the 'yes'-button" |
|
6236 |
||
6237 |
^ okButton |
|
6238 |
||
6239 |
"Modified: 16.1.1997 / 11:31:27 / cg" |
|
197 | 6240 |
! ! |
155 | 6241 |
|
197 | 6242 |
!DialogBox methodsFor:'accessing-elements'! |
6243 |
||
6244 |
componentAt:name |
|
680 | 6245 |
"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
|
6246 |
named previously with #name:as:" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6247 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6248 |
namedComponents isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6249 |
^ namedComponents at:name ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6250 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6251 |
"Modified: 16.1.1997 / 11:40:50 / cg" |
76 | 6252 |
! |
6253 |
||
197 | 6254 |
name:element as:name |
680 | 6255 |
"assign a name to a component. This can be done during construction, |
6256 |
to allow later access to the components (i.e. without a need to |
|
6257 |
remember them in some instVars)" |
|
6258 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6259 |
namedComponents isNil ifTrue:[ |
1401 | 6260 |
namedComponents := Dictionary new. |
197 | 6261 |
]. |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6262 |
namedComponents at:name put:element |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6263 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6264 |
"Modified: 16.1.1997 / 11:41:03 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6265 |
! ! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6266 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6267 |
!DialogBox methodsFor:'accessing-look'! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6268 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6269 |
abortText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6270 |
"define the label in the abort-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6271 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6272 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6273 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6274 |
aString ~= abortButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6275 |
oldSize := abortButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6276 |
abortButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6277 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6278 |
abortButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6279 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6280 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6281 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6282 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6283 |
|
1702 | 6284 |
hideButtons |
6285 |
"hides the buttonPanel (i.e. the ok and cancel buttons if any)" |
|
6286 |
||
6287 |
buttonPanel notNil ifTrue:[buttonPanel beInvisible] |
|
6288 |
! |
|
6289 |
||
2361 | 6290 |
noLabel:aString |
6291 |
"define the label of the 'no'-button. |
|
6292 |
And alias for #noText: - for backward compatibility" |
|
6293 |
||
6294 |
self noText:aString. |
|
6295 |
||
6296 |
"Created: 13.12.1995 / 16:21:57 / cg" |
|
6297 |
"Modified: 16.1.1997 / 11:30:25 / cg" |
|
6298 |
! |
|
6299 |
||
6300 |
noText:aString |
|
6301 |
"define the label of the no-button. |
|
6302 |
If not set, it defaults to the resource-string for 'no'." |
|
6303 |
||
6304 |
aString ~= abortButton label ifTrue:[ |
|
6305 |
abortButton label:aString. |
|
6306 |
abortButton resize. |
|
6307 |
shown ifTrue:[self resize] |
|
6308 |
] |
|
6309 |
! |
|
6310 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6311 |
okText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6312 |
"define the text in the ok-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6313 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6314 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6315 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6316 |
aString ~= okButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6317 |
oldSize := okButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6318 |
okButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6319 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6320 |
okButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6321 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6322 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6323 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6324 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6325 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6326 |
okText:okString abortText:abortString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6327 |
"set both texts displayed in the buttons" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6328 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6329 |
(abortString ~= abortButton label |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6330 |
or:[okString ~= okButton label]) ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6331 |
okButton label:okString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6332 |
abortButton label:abortString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6333 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6334 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6335 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6336 |
] |
2361 | 6337 |
! |
6338 |
||
6339 |
okText:yesString noText:noString |
|
6340 |
"define the labels of both buttons. |
|
6341 |
Alias for yesText:noText: for backward compatibility." |
|
6342 |
||
6343 |
^ self yesText:yesString noText:noString |
|
6344 |
||
6345 |
"Modified: 16.1.1997 / 11:30:58 / cg" |
|
6346 |
! |
|
6347 |
||
6348 |
title:aString yesText:yesString noText:noString |
|
6349 |
"define title and button labels" |
|
6350 |
||
6351 |
self title:aString. |
|
6352 |
self yesText:yesString noText:noString |
|
6353 |
! |
|
6354 |
||
6355 |
yesLabel:aString |
|
6356 |
"define the label of the 'yes'-button. |
|
6357 |
An alias for #yesText: for backward compatibility." |
|
6358 |
||
6359 |
self yesText:aString. |
|
6360 |
||
6361 |
"Created: 13.12.1995 / 16:22:05 / cg" |
|
6362 |
"Modified: 16.1.1997 / 11:31:58 / cg" |
|
6363 |
! |
|
6364 |
||
6365 |
yesText:aString |
|
6366 |
"define the label of the 'yes'-button" |
|
6367 |
||
6368 |
self okText:aString |
|
6369 |
||
6370 |
"Modified: 16.1.1997 / 11:31:39 / cg" |
|
6371 |
! |
|
6372 |
||
6373 |
yesText:yesString noText:noString |
|
6374 |
"define the labels of both buttons" |
|
6375 |
||
6376 |
((yesString ~= okButton label) or:[noString ~= abortButton label]) ifTrue:[ |
|
6377 |
okButton label:yesString. |
|
6378 |
abortButton label:noString. |
|
6379 |
okButton resize. |
|
6380 |
abortButton resize. |
|
6381 |
shown ifTrue:[self resize] |
|
6382 |
] |
|
6383 |
||
6384 |
"Modified: 21.2.1996 / 00:58:38 / cg" |
|
197 | 6385 |
! ! |
6386 |
||
6387 |
!DialogBox methodsFor:'accessing-models'! |
|
76 | 6388 |
|
197 | 6389 |
accept |
6390 |
"return the valueHolder holding true when the box |
|
6391 |
is accepted, false if closed via the windowManager or |
|
6392 |
the cancel button. |
|
6393 |
This is confusing: this method was originally called #acceptValue, |
|
6394 |
but renamed for compatibility with ST-80. |
|
6395 |
This looks like a bad name to me, since in most other situations, #accept |
|
6396 |
is used to force an accept, not to return some valueHolder ...)." |
|
6397 |
||
6398 |
^ acceptValue |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6399 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6400 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6401 |
acceptChannel |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6402 |
"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
|
6403 |
is accepted" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6404 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6405 |
^ acceptValue |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6406 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6407 |
"Created: / 18.8.2000 / 21:44:24 / cg" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6408 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6409 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6410 |
acceptChannel:aValueHolder |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6411 |
"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
|
6412 |
is accepted" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6413 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6414 |
acceptValue := aValueHolder |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6415 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6416 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6417 |
aspectAt:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6418 |
"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
|
6419 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6420 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6421 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6422 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6423 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6424 |
bindings isNil ifTrue:[bindings := IdentityDictionary new]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6425 |
bindings at:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6426 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6427 |
"Created: 16.1.1997 / 11:38:46 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6428 |
"Modified: 16.1.1997 / 11:41:28 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6429 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6430 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6431 |
aspectFor:anAspectSymbol |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6432 |
"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
|
6433 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6434 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6435 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6436 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6437 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6438 |
"/ subclasses may redefine some aspects... |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6439 |
(self respondsTo:anAspectSymbol) ifTrue:[ |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6440 |
^ self perform:anAspectSymbol |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6441 |
]. |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6442 |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6443 |
bindings isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6444 |
^ bindings at:anAspectSymbol ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6445 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6446 |
"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
|
6447 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6448 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6449 |
cancel |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6450 |
^ BlockValue forLogicalNot:(acceptValue) |
76 | 6451 |
! ! |
6452 |
||
120 | 6453 |
!DialogBox methodsFor:'construction-adding'! |
6454 |
||
593 | 6455 |
addComponent:aComponent |
6456 |
"add any component with its preferred height and full width. |
|
6457 |
Returns the component." |
|
6458 |
||
6459 |
^ self addComponent:aComponent indent:nil tabable:false |
|
6460 |
||
6461 |
"Modified: 9.2.1996 / 22:22:41 / cg" |
|
6462 |
! |
|
6463 |
||
6464 |
addComponent:aComponent indent:indent |
|
6465 |
"add any component with its preferred height and full width. |
|
6466 |
The indent is temporarily changed to indent. |
|
6467 |
Returns the component." |
|
6468 |
||
6469 |
^ self addComponent:aComponent indent:indent tabable:false |
|
6470 |
||
6471 |
"Modified: 9.2.1996 / 22:22:44 / cg" |
|
6472 |
! |
|
6473 |
||
6474 |
addComponent:aComponent indent:indent tabable:tabable |
|
6475 |
"add any component with its preferred height and full width. |
|
6476 |
The indent is temporarily changed to indent. |
|
6477 |
Returns the component." |
|
6478 |
||
6479 |
|oldLeft oldRight result| |
|
6480 |
||
6481 |
oldLeft := leftIndent. |
|
6482 |
oldRight := rightIndent. |
|
6483 |
indent notNil ifTrue:[ |
|
1401 | 6484 |
leftIndent := rightIndent := indent. |
593 | 6485 |
]. |
6486 |
result := self addComponent:aComponent tabable:tabable tabbedComponent:aComponent. |
|
6487 |
leftIndent := oldLeft. |
|
6488 |
rightIndent := oldRight. |
|
6489 |
^ result |
|
6490 |
||
6491 |
"Modified: 9.2.1996 / 22:22:50 / cg" |
|
6492 |
! |
|
6493 |
||
6494 |
addComponent:aComponent indent:indent withExtent:ext |
|
6495 |
"add any component with some given extent. |
|
6496 |
Returns the component." |
|
6497 |
||
6498 |
|fullSize lI rI| |
|
6499 |
||
6500 |
indent isNil ifTrue:[ |
|
2801 | 6501 |
lI := leftIndent. |
6502 |
rI := rightIndent. |
|
593 | 6503 |
] ifFalse:[ |
2801 | 6504 |
lI := rI := indent |
593 | 6505 |
]. |
6506 |
||
6507 |
self basicAddComponent:aComponent. |
|
4155
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6508 |
(ext x isInteger) ifTrue:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6509 |
fullSize := ext + (lI + rI @ 0). |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6510 |
width := fullSize x max:width. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6511 |
] ifFalse:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6512 |
fullSize := ext. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6513 |
]. |
593 | 6514 |
aComponent extent:fullSize. |
2801 | 6515 |
aComponent origin:(0.0 @ yPosition); |
6516 |
leftInset:lI; |
|
6517 |
rightInset:rI. |
|
593 | 6518 |
yPosition := yPosition + aComponent height + ViewSpacing. |
6519 |
needResize := true. |
|
6520 |
^ aComponent |
|
6521 |
||
4155
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6522 |
"Modified: / 07-07-2010 / 16:43:58 / cg" |
593 | 6523 |
! |
6524 |
||
6525 |
addComponent:aComponent indent:indent withHeight:height |
|
6526 |
"add any component with some given height and full width. |
|
6527 |
Returns the component." |
|
6528 |
||
6529 |
|lI rI| |
|
6530 |
||
6531 |
indent isNil ifTrue:[ |
|
2801 | 6532 |
lI := leftIndent. |
6533 |
rI := rightIndent. |
|
593 | 6534 |
] ifFalse:[ |
2801 | 6535 |
lI := rI := indent |
593 | 6536 |
]. |
6537 |
self basicAddComponent:aComponent. |
|
3283 | 6538 |
aComponent |
6539 |
height:height; |
|
6540 |
origin:0.0@yPosition; |
|
6541 |
width:1.0; |
|
6542 |
leftInset:lI; |
|
6543 |
rightInset:rI. |
|
2801 | 6544 |
yPosition := yPosition + height + ViewSpacing. |
593 | 6545 |
^ aComponent |
6546 |
||
6547 |
"Modified: 9.2.1996 / 22:22:58 / cg" |
|
6548 |
! |
|
6549 |
||
6550 |
addComponent:aComponent tabable:tabable |
|
6551 |
"add any component with its preferred height and full width. |
|
6552 |
Returns the component." |
|
6553 |
||
6554 |
^ self addComponent:aComponent tabable:tabable tabbedComponent:aComponent |
|
6555 |
||
6556 |
"Modified: 9.2.1996 / 22:23:04 / cg" |
|
6557 |
! |
|
6558 |
||
6559 |
addComponent:aComponent tabable:tabable tabbedComponent:subComponent |
|
6560 |
"add any component with its preferred height and full width. |
|
6561 |
Returns the component." |
|
6562 |
||
6563 |
tabable ifTrue:[ |
|
3467 | 6564 |
aComponent canTab:true. |
6565 |
||
6566 |
"/ tabableElements isNil ifTrue:[ |
|
6567 |
"/ tabableElements := OrderedCollection new |
|
6568 |
"/ ]. |
|
6569 |
"/ tabableElements add:subComponent |
|
593 | 6570 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6571 |
^ self addComponent:aComponent withHeight:(aComponent preferredHeight). |
593 | 6572 |
|
6573 |
"Modified: 9.2.1996 / 22:23:07 / cg" |
|
6574 |
! |
|
6575 |
||
6576 |
addComponent:aComponent withExtent:ext |
|
6577 |
"add any component with some given extent. |
|
6578 |
Returns the component." |
|
6579 |
||
6580 |
^ self addComponent:aComponent indent:nil withExtent:ext |
|
6581 |
||
6582 |
"Modified: 9.2.1996 / 22:23:11 / cg" |
|
6583 |
! |
|
6584 |
||
6585 |
addComponent:aComponent withHeight:height |
|
6586 |
"add any component with some given height and full width. |
|
6587 |
Returns the component." |
|
6588 |
||
6589 |
^ self addComponent:aComponent indent:nil withHeight:height |
|
6590 |
||
6591 |
"Modified: 9.2.1996 / 22:23:15 / cg" |
|
6592 |
! |
|
6593 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6594 |
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
|
6595 |
"add a label and some view side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6596 |
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
|
6597 |
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
|
6598 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6599 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6600 |
|
795 | 6601 |
^ self |
1401 | 6602 |
addLabelledField:aView |
6603 |
label:labelString |
|
6604 |
adjust:labelAdjust |
|
6605 |
tabable:tabable |
|
6606 |
from:leftX to:rightX separateAtX:relativeX |
|
6607 |
nameAs:nil |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6608 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6609 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6610 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6611 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6612 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6613 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6614 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6615 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6616 |
field := dialog |
1401 | 6617 |
addLabelledField:(EditField on:model) label:'input here:' |
6618 |
adjust:#left |
|
6619 |
tabable:true |
|
6620 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6621 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6622 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6623 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6624 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6625 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6626 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6627 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6628 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6629 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6630 |
model := SelectionInList new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6631 |
model list:#('foo' 'bar' 'baz'). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6632 |
model selectionIndex:2. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6633 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6634 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6635 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6636 |
field := dialog |
1401 | 6637 |
addLabelledField:(PopUpList on:model) label:'select here:' |
6638 |
adjust:#left |
|
6639 |
tabable:true |
|
6640 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6641 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6642 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6643 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6644 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6645 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6646 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6647 |
"Created: 3.6.1996 / 11:03:24 / cg" |
795 | 6648 |
"Modified: 17.7.1996 / 15:04:07 / cg" |
6649 |
! |
|
6650 |
||
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6651 |
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
|
6652 |
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
|
6653 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6654 |
"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
|
6655 |
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
|
6656 |
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
|
6657 |
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
|
6658 |
Return the inputField." |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6659 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6660 |
^ self |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6661 |
addLabelledField:aView |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6662 |
label:labelString |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6663 |
adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6664 |
tabable:tabable |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6665 |
from:leftX to:rightX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6666 |
separateAtX:relativeX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6667 |
nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6668 |
foregroundColor:nil |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6669 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6670 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6671 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6672 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6673 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6674 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6675 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6676 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6677 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6678 |
addLabelledField:(EditField on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6679 |
label:'input here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6680 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6681 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6682 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6683 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6684 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6685 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6686 |
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
|
6687 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6688 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6689 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6690 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6691 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6692 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6693 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6694 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6695 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6696 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6697 |
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
|
6698 |
label:'select foo:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6699 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6700 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6701 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6702 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6703 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6704 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6705 |
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
|
6706 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6707 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6708 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6709 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6710 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6711 |
model := SelectionInList new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6712 |
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
|
6713 |
model selectionIndex:2. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6714 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6715 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6716 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6717 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6718 |
addLabelledField:(PopUpList on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6719 |
label:'select here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6720 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6721 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6722 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6723 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6724 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6725 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6726 |
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
|
6727 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6728 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6729 |
"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
|
6730 |
"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
|
6731 |
! |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6732 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6733 |
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
|
6734 |
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
|
6735 |
foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6736 |
|
795 | 6737 |
"add a label and some view side-by-side. |
6738 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
6739 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
6740 |
The inputField gets model as its model. |
|
6741 |
Return the inputField." |
|
6742 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6743 |
|y lbl max relW wLabel| |
795 | 6744 |
|
6745 |
y := self yPosition. |
|
6746 |
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
|
6747 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6748 |
max := lbl preferredHeight max:(aView preferredHeight max:aView height). |
795 | 6749 |
|
6750 |
relW := rightX - leftX. |
|
6751 |
||
6752 |
self addComponent:lbl indent:leftIndent withHeight:max. |
|
6753 |
lbl rightInset:0. |
|
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6754 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6755 |
wLabel := relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6756 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6757 |
wLabel := relW*relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6758 |
]. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6759 |
|
795 | 6760 |
lbl |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6761 |
width:wLabel; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6762 |
left:leftX; |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6763 |
adjust:labelAdjust; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6764 |
borderWidth:0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6765 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6766 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6767 |
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
|
6768 |
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
|
6769 |
lbl sizeFixed:true. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6770 |
]. |
795 | 6771 |
|
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6772 |
fgColor notNil ifTrue:[ |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6773 |
lbl foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6774 |
]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6775 |
|
795 | 6776 |
self yPosition:y. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6777 |
|
4217
9453a5aa3fcf
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4216
diff
changeset
|
6778 |
"/ 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
|
6779 |
"/ aView height:max. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6780 |
|
795 | 6781 |
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
|
6782 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6783 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6784 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6785 |
leftInset:(ViewSpacing + relativeX); |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6786 |
left:0.0; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6787 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6788 |
right:1.0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6789 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6790 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6791 |
leftInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6792 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6793 |
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
|
6794 |
left:leftX+(relW*relativeX). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6795 |
]. |
4218
7b0e5dd511e9
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4217
diff
changeset
|
6796 |
|
4219
c83b708345f7
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4218
diff
changeset
|
6797 |
"/ 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
|
6798 |
aView setHeight:max. |
795 | 6799 |
|
6800 |
aView isInputField ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6801 |
self addToInputFieldGroup:aView |
795 | 6802 |
]. |
6803 |
||
6804 |
aName notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6805 |
self name:lbl as:(aName , '.label'). |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6806 |
self name:aView as:aName |
795 | 6807 |
]. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6808 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6809 |
^ aView |
795 | 6810 |
|
6811 |
" |
|
6812 |
|dialog model field| |
|
6813 |
||
6814 |
model := '' asValue. |
|
6815 |
||
6816 |
dialog := DialogBox new. |
|
6817 |
||
6818 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6819 |
addLabelledField:(EditField on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6820 |
label:'input here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6821 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6822 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6823 |
separateAtX:0.3. |
807 | 6824 |
|
6825 |
dialog addAbortButton; addOkButton. |
|
6826 |
dialog open. |
|
6827 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6828 |
" |
|
6829 |
||
6830 |
" |
|
6831 |
|dialog model field| |
|
6832 |
||
6833 |
model := '' asValue. |
|
6834 |
||
6835 |
dialog := DialogBox new. |
|
6836 |
||
6837 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6838 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6839 |
label:'select foo:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6840 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6841 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6842 |
separateAtX:0.3. |
795 | 6843 |
|
6844 |
dialog addAbortButton; addOkButton. |
|
6845 |
dialog open. |
|
6846 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6847 |
" |
|
6848 |
||
6849 |
" |
|
6850 |
|dialog model field| |
|
6851 |
||
6852 |
model := SelectionInList new. |
|
6853 |
model list:#('foo' 'bar' 'baz'). |
|
6854 |
model selectionIndex:2. |
|
6855 |
||
6856 |
dialog := DialogBox new. |
|
6857 |
||
6858 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6859 |
addLabelledField:(PopUpList on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6860 |
label:'select here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6861 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6862 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6863 |
separateAtX:0.3. |
795 | 6864 |
|
6865 |
dialog addAbortButton; addOkButton. |
|
6866 |
dialog open. |
|
6867 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6868 |
" |
|
6869 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6870 |
"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
|
6871 |
"Modified: / 02-02-2011 / 12:17:55 / cg" |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6872 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6873 |
|
593 | 6874 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX |
6875 |
"add a label and some view side-by-side. |
|
6876 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
6877 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
6878 |
The inputField gets model as its model. |
|
6879 |
Return the inputField." |
|
6880 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6881 |
^ self |
1401 | 6882 |
addLabelledField:aView |
6883 |
label:labelString |
|
6884 |
adjust:labelAdjust |
|
6885 |
tabable:tabable |
|
6886 |
from:0.0 to:1.0 |
|
6887 |
separateAtX:relativeX |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6888 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6889 |
"/ |y lbl max| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6890 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6891 |
"/ y := self yPosition. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6892 |
"/ lbl := Label label:labelString. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6893 |
"/ max := lbl preferredExtent y max:(aView preferredExtent y). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6894 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6895 |
"/ self addComponent:lbl indent:leftIndent withHeight:max. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6896 |
"/ lbl rightInset:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6897 |
"/ lbl width:relativeX; adjust:labelAdjust; borderWidth:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6898 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6899 |
"/ self yPosition:y. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6900 |
"/ self addComponent:aView tabable:tabable. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6901 |
"/ aView leftInset:ViewSpacing; rightInset:ViewSpacing. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6902 |
"/ aView width:(1.0 - relativeX); left:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6903 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6904 |
"/ aView isInputField ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6905 |
"/ self addToInputFieldGroup:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6906 |
"/ ]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6907 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6908 |
"/ ^ aView |
593 | 6909 |
|
6910 |
" |
|
6911 |
|dialog model field| |
|
6912 |
||
6913 |
model := '' asValue. |
|
6914 |
||
6915 |
dialog := DialogBox new. |
|
6916 |
||
6917 |
field := dialog |
|
1401 | 6918 |
addLabelledField:(EditField on:model) label:'input here:' |
6919 |
adjust:#left |
|
6920 |
tabable:true |
|
6921 |
separateAtX:0.3. |
|
593 | 6922 |
|
6923 |
dialog addAbortButton; addOkButton. |
|
6924 |
dialog open. |
|
655 | 6925 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 6926 |
" |
6927 |
||
6928 |
" |
|
6929 |
|dialog model field| |
|
6930 |
||
6931 |
model := SelectionInList new. |
|
6932 |
model list:#('foo' 'bar' 'baz'). |
|
6933 |
model selectionIndex:2. |
|
6934 |
||
6935 |
dialog := DialogBox new. |
|
6936 |
||
6937 |
field := dialog |
|
1401 | 6938 |
addLabelledField:(PopUpList on:model) label:'select here:' |
6939 |
adjust:#left |
|
6940 |
tabable:true |
|
6941 |
separateAtX:0.3. |
|
593 | 6942 |
|
6943 |
dialog addAbortButton; addOkButton. |
|
6944 |
dialog open. |
|
655 | 6945 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 6946 |
" |
6947 |
||
6948 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6949 |
"Modified: 3.6.1996 / 18:48:49 / cg" |
593 | 6950 |
! |
6951 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6952 |
addMessage:labelString centered:centered |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6953 |
^ self addTextLabel:labelString |
2116 | 6954 |
|
6955 |
"Created: / 4.2.2000 / 00:03:24 / cg" |
|
6956 |
! |
|
6957 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6958 |
addMessage:labelString textLine:valueHolder boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6959 |
^ self |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6960 |
addMessage:labelString |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6961 |
textLine:valueHolder |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6962 |
type:nil |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6963 |
boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6964 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6965 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6966 |
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
|
6967 |
|pos lbl field| |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6968 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6969 |
pos := self yPosition. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6970 |
lbl := self addTextLabel:labelString. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6971 |
lbl width:fraction. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6972 |
self yPosition:pos. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6973 |
field := self addInputFieldOn:valueHolder tabable:true. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6974 |
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
|
6975 |
typeSymbolOrNil == #password ifTrue:[ |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6976 |
field bePassword |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6977 |
]. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6978 |
^ field |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6979 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6980 |
|
593 | 6981 |
addTextLabel:aString |
6982 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
6983 |
however, ST/X labels allow image labels too. |
|
6984 |
Returns the label." |
|
6985 |
||
6986 |
|l| |
|
6987 |
||
6988 |
l := Label new label:aString. |
|
6989 |
l borderWidth:0. |
|
6990 |
self addComponent:l. |
|
6991 |
^ l |
|
6992 |
||
6993 |
" |
|
6994 |
|b| |
|
6995 |
||
6996 |
b := DialogBox new. |
|
6997 |
b addTextLabel:'hello'. |
|
6998 |
b showAtPointer |
|
6999 |
" |
|
7000 |
" |
|
7001 |
|b| |
|
7002 |
||
7003 |
b := DialogBox new. |
|
7004 |
b leftIndent:100. |
|
7005 |
b addTextLabel:'hello'. |
|
7006 |
b leftIndent:0. |
|
7007 |
b addTextLabel:'world'. |
|
7008 |
b showAtPointer |
|
7009 |
" |
|
7010 |
" |
|
7011 |
|b| |
|
7012 |
||
7013 |
b := DialogBox new. |
|
7014 |
b addTextLabel:'hello'. |
|
7015 |
b addTextLabel:'world'. |
|
7016 |
b addOkButton. |
|
7017 |
b showAtPointer |
|
7018 |
" |
|
7019 |
" |
|
7020 |
|b| |
|
7021 |
||
7022 |
b := DialogBox new. |
|
7023 |
b addTextLabel:'hello'. |
|
7024 |
(b addTextLabel:'world') foregroundColor:Color red. |
|
7025 |
b addOkButton. |
|
7026 |
b showAtPointer |
|
7027 |
" |
|
7028 |
" |
|
7029 |
|b| |
|
7030 |
||
7031 |
b := DialogBox new. |
|
7032 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7033 |
b addOkButton. |
|
7034 |
b showAtPointer |
|
7035 |
" |
|
7036 |
" |
|
7037 |
|b| |
|
7038 |
||
7039 |
b := DialogBox new. |
|
7040 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7041 |
b addTextLabel:'not bad'. |
|
7042 |
b addAbortButton. |
|
7043 |
b addOkButton. |
|
7044 |
b showAtPointer |
|
7045 |
" |
|
7046 |
! |
|
7047 |
||
3908 | 7048 |
addTextLabelOn:aValueHolder |
7049 |
"create a text label showing the contents of a valueHolder. |
|
7050 |
Returns the label." |
|
7051 |
||
7052 |
|l| |
|
7053 |
||
7054 |
l := Label new labelChannel:aValueHolder. |
|
7055 |
l borderWidth:0. |
|
7056 |
self addComponent:l. |
|
7057 |
^ l |
|
7058 |
||
7059 |
" |
|
7060 |
|b| |
|
7061 |
||
7062 |
b := DialogBox new. |
|
7063 |
b addTextLabelOn:'hello' asValue. |
|
7064 |
b showAtPointer |
|
7065 |
" |
|
7066 |
" |
|
7067 |
|b| |
|
7068 |
||
7069 |
b := DialogBox new. |
|
7070 |
b leftIndent:100. |
|
7071 |
b addTextLabelOn:'hello' asValue. |
|
7072 |
b leftIndent:0. |
|
7073 |
b addTextLabelOn:'world' asValue. |
|
7074 |
b showAtPointer |
|
7075 |
" |
|
7076 |
! |
|
7077 |
||
593 | 7078 |
addToInputFieldGroup:aComponentOrSubcomponent |
7079 |
"add a component to the input group. |
|
7080 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7081 |
a topLevel component." |
|
7082 |
||
1355 | 7083 |
self |
1401 | 7084 |
addToInputFieldGroup:aComponentOrSubcomponent before:nil |
1355 | 7085 |
|
7086 |
"Modified: 18.10.1997 / 03:09:17 / cg" |
|
7087 |
! |
|
7088 |
||
7089 |
addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
|
7090 |
"add a component to the input group. |
|
7091 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7092 |
a topLevel component." |
|
7093 |
||
593 | 7094 |
inputFieldGroup isNil ifTrue:[ |
1759 | 7095 |
inputFieldGroup := EnterFieldGroup new. |
7096 |
inputFieldGroup leaveAction:[self lastFieldLeft]. |
|
7097 |
"/ |
|
7098 |
"/ the first inputField gets the focus initially |
|
7099 |
"/ |
|
7100 |
aComponentOrSubcomponent hasKeyboardFocus:true. |
|
593 | 7101 |
]. |
1355 | 7102 |
inputFieldGroup add:aComponentOrSubcomponent before:anotherComponent. |
593 | 7103 |
self delegate:(KeyboardForwarder to:inputFieldGroup condition:#noFocus). |
7104 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7105 |
"/ inputFields isNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7106 |
"/ inputFields := OrderedCollection new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7107 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7108 |
"/ "/ 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
|
7109 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7110 |
"/ aComponentOrSubcomponent showCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7111 |
"/ aComponentOrSubcomponent hasKeyboardFocus:true. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7112 |
"/ ] ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7113 |
"/ aComponentOrSubcomponent hideCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7114 |
"/ aComponentOrSubcomponent hasKeyboardFocus:false. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7115 |
"/ ]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7116 |
"/ inputFields add:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7117 |
|
1355 | 7118 |
"Modified: 18.10.1997 / 02:47:20 / cg" |
7119 |
"Created: 18.10.1997 / 03:08:51 / cg" |
|
7120 |
! |
|
7121 |
||
7122 |
removeFromInputFieldGroup:aComponentOrSubcomponent |
|
7123 |
"remove a component from the input group. |
|
7124 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7125 |
a topLevel component." |
|
7126 |
||
7127 |
inputFieldGroup isNil ifTrue:[^ self]. |
|
7128 |
inputFieldGroup remove:aComponentOrSubcomponent. |
|
7129 |
||
7130 |
"Created: 18.10.1997 / 02:51:30 / cg" |
|
593 | 7131 |
! ! |
7132 |
||
7133 |
!DialogBox methodsFor:'construction-buttons'! |
|
7134 |
||
1763 | 7135 |
addAbortAndOkButtons |
7136 |
"create both abort- and Ok Buttons" |
|
7137 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7138 |
self |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7139 |
addAbortButtonLabelled:nil; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7140 |
addOkButtonLabelled:nil |
1763 | 7141 |
! |
7142 |
||
197 | 7143 |
addAbortButton |
7144 |
"create an abortButton - to be sent from redefined initialize |
|
162 | 7145 |
methods in subclasses or when creating a box programmatically. |
7146 |
Returns the button." |
|
7147 |
||
197 | 7148 |
^ self addAbortButtonLabelled:nil |
122 | 7149 |
! |
120 | 7150 |
|
162 | 7151 |
addAbortButton:aButton |
7152 |
"add an already created abortButton - to be sent from redefined initialize |
|
7153 |
methods in subclasses or when creating a box programmatically. |
|
7154 |
Returns the button." |
|
7155 |
||
7156 |
abortButton := aButton. |
|
7157 |
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
|
7158 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7159 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7160 |
"/ 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
|
7161 |
|
2698 | 7162 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7163 |
"/ 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
|
7164 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7165 |
"/ 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
|
7166 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7167 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7168 |
self addButton:aButton before:nil. |
1763 | 7169 |
^ aButton. |
162 | 7170 |
|
7171 |
"Created: 17.9.1995 / 20:17:26 / claus" |
|
7172 |
! |
|
7173 |
||
122 | 7174 |
addAbortButtonLabelled:buttonLabel |
7175 |
"create an abortButton with a label - to be sent from redefined initialize |
|
7176 |
methods in subclasses or when creating a box programmatically. |
|
7177 |
A nil argument creates one with the default label. |
|
7178 |
Returns the button." |
|
7179 |
||
162 | 7180 |
|aButton| |
7181 |
||
7182 |
aButton := Button abortButton. |
|
7183 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7184 |
^ self addAbortButton:aButton |
|
7185 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7186 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7187 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7188 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7189 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7190 |
dialog addAbortButtonLabelled:'get out of here'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7191 |
dialog addOkButtonLabelled:'yes thats ok'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7192 |
dialog open. |
655 | 7193 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7194 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7195 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7196 |
"Modified: 9.2.1996 / 22:09:40 / cg" |
120 | 7197 |
! |
76 | 7198 |
|
197 | 7199 |
addButton:aButton |
7200 |
"add a button into the buttonPanel. |
|
122 | 7201 |
Returns the button." |
120 | 7202 |
|
3050 | 7203 |
"/ ^ self addButton:aButton after:nil |
7204 |
(self class defaultOKButtonAtLeft) ifFalse:[ |
|
7205 |
^ self addButton:aButton before:nil |
|
7206 |
] ifTrue:[ |
|
7207 |
^ self addButton:aButton after:nil |
|
7208 |
]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7209 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7210 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7211 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7212 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7213 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7214 |
dialog addAbortButton. |
655 | 7215 |
dialog addButton:(Button label:'foo' action:[Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7216 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7217 |
dialog open. |
655 | 7218 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7219 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7220 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7221 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7222 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7223 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7224 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7225 |
dialog addAbortButton. |
655 | 7226 |
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
|
7227 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7228 |
dialog open. |
655 | 7229 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7230 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7231 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7232 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7233 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7234 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7235 |
dialog := DialogBox new. |
655 | 7236 |
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
|
7237 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7238 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7239 |
dialog open. |
655 | 7240 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7241 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7242 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7243 |
"Modified: 9.2.1996 / 22:14:17 / cg" |
197 | 7244 |
! |
7245 |
||
7246 |
addButton:aButton after:someOtherButtonOrNil |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7247 |
"add a button into the buttonPanel. |
197 | 7248 |
If the argument someOtherButtonOrNil is nil, the button is |
7249 |
added at the end." |
|
7250 |
||
7251 |
|h| |
|
7252 |
||
7253 |
buttonPanel addSubView:aButton after:someOtherButtonOrNil. |
|
7254 |
buttonPanel subViews size > 1 ifTrue:[ |
|
1843 | 7255 |
buttonPanel horizontalLayout:#fitSpace. |
197 | 7256 |
]. |
7257 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
|
1843 | 7258 |
buttonPanel topInset:h negated |
197 | 7259 |
]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7260 |
needResize := true. |
197 | 7261 |
^ aButton |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7262 |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7263 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7264 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7265 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7266 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7267 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7268 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7269 |
dialog addButton:(Button |
1843 | 7270 |
label:'foo' |
7271 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7272 |
after:(dialog okButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7273 |
dialog open. |
655 | 7274 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7275 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7276 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7277 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7278 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7279 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7280 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7281 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7282 |
dialog addButton:(Button |
1843 | 7283 |
label:'foo' |
7284 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7285 |
after:(dialog abortButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7286 |
dialog open. |
655 | 7287 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7288 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7289 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7290 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7291 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7292 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7293 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7294 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7295 |
dialog addButton:(Button |
1843 | 7296 |
label:'foo' |
7297 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7298 |
after:nil. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7299 |
dialog open. |
655 | 7300 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7301 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7302 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7303 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
197 | 7304 |
! |
7305 |
||
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7306 |
addButton:aButton before:someOtherButtonOrNil |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7307 |
"add a button into the buttonPanel. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7308 |
If the argument someOtherButtonOrNil is nil, the button is |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7309 |
added upFront." |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7310 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7311 |
|h| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7312 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7313 |
buttonPanel addSubView:aButton before:someOtherButtonOrNil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7314 |
buttonPanel subViews size > 1 ifTrue:[ |
1843 | 7315 |
buttonPanel horizontalLayout:#fitSpace. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7316 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7317 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
1843 | 7318 |
buttonPanel topInset:h negated |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7319 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7320 |
preferredExtent := nil. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7321 |
needResize := true. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7322 |
^ aButton |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7323 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7324 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7325 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7326 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7327 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7328 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7329 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7330 |
dialog addButton:(Button |
1843 | 7331 |
label:'foo' |
7332 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7333 |
before:(dialog okButton). |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7334 |
dialog open. |
655 | 7335 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7336 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7337 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7338 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7339 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7340 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7341 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7342 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7343 |
dialog addButton:(Button |
1843 | 7344 |
label:'foo' |
7345 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7346 |
before:nil. |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7347 |
dialog open. |
655 | 7348 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7349 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7350 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7351 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7352 |
"Created: 10.2.1996 / 16:04:35 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7353 |
! |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7354 |
|
593 | 7355 |
addHelpButtonFor:pathToHelpText |
7356 |
"add a help button to the buttonPanel. |
|
7357 |
The argument, pathToHelpText should specify the path to the help |
|
7358 |
text under either the doc/online/<language> or the help/<language> |
|
7359 |
directory." |
|
7360 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7361 |
^ self addHelpButtonWithAction:[HTMLDocumentView openFullOnHelpFile:pathToHelpText]. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7362 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7363 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7364 |
|box| |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7365 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7366 |
box := DialogBox new. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7367 |
box |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7368 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7369 |
addAbortButton; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7370 |
addOkButton. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7371 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7372 |
box open |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7373 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7374 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7375 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7376 |
"Modified: / 26-01-2011 / 18:04:53 / cg" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7377 |
! |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7378 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7379 |
addHelpButtonWithAction:helpAction |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7380 |
"add a help button to the buttonPanel. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7381 |
The argument, helpAction is avaluated when clicked" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7382 |
|
593 | 7383 |
|helpButton| |
7384 |
||
2478 | 7385 |
helpButton := Button label:(resources string:'Help'). |
593 | 7386 |
helpButton action:[ |
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7387 |
self withWaitCursorDo:helpAction |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7388 |
]. |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7389 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7390 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7391 |
"/ 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
|
7392 |
|
2698 | 7393 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7394 |
"/ 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
|
7395 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7396 |
"/ 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
|
7397 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7398 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7399 |
self addButton:helpButton before:nil. |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7400 |
^ helpButton |
593 | 7401 |
|
7402 |
" |
|
7403 |
|box| |
|
7404 |
||
7405 |
box := DialogBox new. |
|
7406 |
box |
|
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7407 |
addHelpButtonWithAction:[ Transcript flash ]; |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7408 |
addAbortButton; |
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7409 |
addOkButton. |
593 | 7410 |
|
7411 |
box open |
|
7412 |
" |
|
7413 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7414 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7415 |
"Created: / 26-01-2011 / 18:04:16 / cg" |
593 | 7416 |
! |
7417 |
||
2116 | 7418 |
addOK:checkBlock |
7419 |
|butt| |
|
7420 |
||
7421 |
butt := self addOkButton. |
|
7422 |
"/ what is checkBlock ? |
|
7423 |
^ butt |
|
7424 |
||
7425 |
"Modified: / 4.2.2000 / 00:09:15 / cg" |
|
7426 |
! |
|
7427 |
||
593 | 7428 |
addOkButton |
7429 |
"create an okButton - to be sent from redefined initialize |
|
7430 |
methods in subclasses or when creating a box programmatically. |
|
7431 |
Returns the button." |
|
7432 |
||
7433 |
^ self addOkButtonLabelled:nil |
|
7434 |
||
7435 |
" |
|
7436 |
|dialog| |
|
7437 |
||
7438 |
dialog := DialogBox new. |
|
7439 |
dialog addOkButton. |
|
7440 |
dialog open. |
|
655 | 7441 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7442 |
" |
7443 |
||
7444 |
"Modified: 9.2.1996 / 21:37:02 / cg" |
|
7445 |
! |
|
7446 |
||
7447 |
addOkButton:aButton |
|
7448 |
"add an already created okButton - to be sent from redefined initialize |
|
7449 |
methods in subclasses or when creating a box programmatically. |
|
7450 |
Returns the button." |
|
7451 |
||
1764 | 7452 |
"/ okButton isNil ifTrue:[ |
7453 |
okButton := aButton. |
|
7454 |
"/ ]. |
|
593 | 7455 |
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
|
7456 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7457 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7458 |
"/ 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
|
7459 |
|
2698 | 7460 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7461 |
"/ 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
|
7462 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7463 |
"/ 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
|
7464 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7465 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7466 |
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
|
7467 |
|
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7468 |
^ aButton. |
593 | 7469 |
|
7470 |
" |
|
7471 |
|dialog b| |
|
7472 |
||
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
7473 |
b := Button label:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedBy:0.5). |
593 | 7474 |
|
7475 |
dialog := DialogBox new. |
|
7476 |
dialog addOkButton:b. |
|
7477 |
dialog open. |
|
655 | 7478 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7479 |
" |
7480 |
||
7481 |
"Modified: 17.9.1995 / 20:20:41 / claus" |
|
7482 |
"Modified: 9.2.1996 / 21:38:48 / cg" |
|
7483 |
! |
|
7484 |
||
7485 |
addOkButtonLabelled:buttonLabel |
|
7486 |
"create an okButton with a label - to be sent from redefined initialize |
|
7487 |
methods in subclasses or when creating a box programmatically. |
|
7488 |
A nil argument creates one with the default text. |
|
7489 |
Returns the button." |
|
7490 |
||
7491 |
|aButton| |
|
7492 |
||
7493 |
aButton := Button okButton. |
|
7494 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7495 |
aButton isReturnButton:acceptReturnAsOK. |
|
7496 |
^ self addOkButton:aButton. |
|
7497 |
||
7498 |
" |
|
7499 |
|dialog| |
|
7500 |
||
7501 |
dialog := DialogBox new. |
|
7502 |
dialog addOkButtonLabelled:'get out of here'. |
|
7503 |
dialog open. |
|
655 | 7504 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7505 |
" |
7506 |
||
7507 |
"Modified: 9.2.1996 / 21:39:34 / cg" |
|
7508 |
! ! |
|
7509 |
||
7510 |
!DialogBox methodsFor:'construction-check & comboboxes'! |
|
7511 |
||
197 | 7512 |
addCheckBox:label on:aModel |
7513 |
"create a checkBox with label on aModel and add it. |
|
7514 |
Returns the box." |
|
7515 |
||
7516 |
^ self addCheckBox:label on:aModel tabable:true |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7517 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7518 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7519 |
|dialog check| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7520 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7521 |
check := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7522 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7523 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7524 |
dialog addCheckBox:'on or off' on:check. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7525 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7526 |
dialog open. |
655 | 7527 |
dialog accepted ifTrue:[Transcript showCR:check value]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7528 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7529 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7530 |
"Modified: 9.2.1996 / 22:15:38 / cg" |
197 | 7531 |
! |
7532 |
||
600 | 7533 |
addCheckBox:label on:aModel tabable:tabable |
7534 |
"create a checkBox with label on aModel and add it. |
|
7535 |
Returns the box." |
|
7536 |
||
7537 |
|b| |
|
7538 |
||
7539 |
b := CheckBox on:aModel. |
|
7540 |
b label:label. |
|
7541 |
self addComponent:b tabable:tabable. |
|
7542 |
^ b |
|
7543 |
||
7544 |
" |
|
7545 |
|dialog check1 check2 check3| |
|
7546 |
||
7547 |
check1 := true asValue. |
|
7548 |
check2 := false asValue. |
|
7549 |
check3 := true asValue. |
|
7550 |
||
7551 |
dialog := DialogBox new. |
|
7552 |
dialog addCheckBox:'on or off' on:check1 tabable:false. |
|
7553 |
dialog addHorizontalLine. |
|
7554 |
||
7555 |
dialog addCheckBox:'on or off' on:check2 tabable:true. |
|
7556 |
dialog addCheckBox:'on or off' on:check3 tabable:true. |
|
7557 |
dialog addOkButton. |
|
7558 |
dialog open. |
|
7559 |
" |
|
7560 |
||
7561 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
7562 |
! |
|
7563 |
||
593 | 7564 |
addComboBoxOn:aModel |
7565 |
"create a comboBoxView on aModel and add it. |
|
7566 |
Returns the comboBoxView." |
|
7567 |
||
7568 |
^ self addComboBoxOn:aModel tabable:true |
|
7569 |
||
7570 |
" |
|
7571 |
without a list, the comboBox is disabled: |
|
7572 |
||
7573 |
|box val| |
|
7574 |
||
7575 |
val := 'some input' asValue. |
|
7576 |
||
7577 |
box := Dialog new. |
|
7578 |
||
7579 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7580 |
box addVerticalSpace. |
|
7581 |
(box addComboBoxOn:val). |
|
7582 |
box addOkButton. |
|
7583 |
box open. |
|
7584 |
box accepted ifTrue:[ |
|
1401 | 7585 |
Transcript showCR:val value |
593 | 7586 |
]. |
7587 |
" |
|
7588 |
||
7589 |
"with a list, it can be pulled: |
|
7590 |
||
7591 |
|box val| |
|
7592 |
||
7593 |
val := '' asValue. |
|
7594 |
||
7595 |
box := Dialog new. |
|
7596 |
||
7597 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7598 |
box addVerticalSpace. |
|
7599 |
(box addComboBoxOn:val) list:#('one' 'two' 'three' 'four'). |
|
7600 |
box addOkButton. |
|
7601 |
box open. |
|
7602 |
box accepted ifTrue:[ |
|
1401 | 7603 |
Transcript showCR:val value |
593 | 7604 |
]. |
7605 |
" |
|
7606 |
||
7607 |
"Modified: 28.2.1996 / 15:17:39 / cg" |
|
7608 |
"Created: 4.3.1996 / 17:21:45 / cg" |
|
7609 |
! |
|
7610 |
||
7611 |
addComboBoxOn:aModel tabable:tabable |
|
7612 |
"create a comboBoxView on aModel and add it. |
|
7613 |
Returns the comboBoxView." |
|
7614 |
||
7615 |
|f| |
|
7616 |
||
7617 |
f := ComboBoxView new. |
|
7618 |
f model:aModel. |
|
7619 |
self addComponent:f tabable:tabable. |
|
7620 |
tabable ifTrue:[ |
|
1401 | 7621 |
self addToInputFieldGroup:f editor. |
593 | 7622 |
]. |
7623 |
^ f |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7624 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7625 |
" |
593 | 7626 |
without a list, the comboBox is disabled: |
7627 |
||
7628 |
|box val| |
|
7629 |
||
7630 |
val := 'some input' asValue. |
|
7631 |
||
7632 |
box := Dialog new. |
|
7633 |
||
7634 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7635 |
box addVerticalSpace. |
|
7636 |
(box addComboBoxOn:val tabable:true). |
|
7637 |
box addOkButton. |
|
7638 |
box open. |
|
7639 |
box accepted ifTrue:[ |
|
1401 | 7640 |
Transcript showCR:val value |
593 | 7641 |
]. |
7642 |
" |
|
7643 |
||
7644 |
"with a list, it can be pulled: |
|
7645 |
||
7646 |
|box val| |
|
7647 |
||
7648 |
val := '' asValue. |
|
7649 |
||
7650 |
box := Dialog new. |
|
7651 |
||
7652 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7653 |
box addVerticalSpace. |
|
7654 |
(box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7655 |
box addOkButton. |
|
7656 |
box open. |
|
7657 |
box accepted ifTrue:[ |
|
1401 | 7658 |
Transcript showCR:val value |
593 | 7659 |
]. |
7660 |
" |
|
7661 |
||
7662 |
"Modified: 4.3.1996 / 17:21:57 / cg" |
|
7663 |
! |
|
7664 |
||
7665 |
addComboListOn:aModel |
|
7666 |
"create a comboListView on aModel and add it. |
|
7667 |
Returns the comboListView." |
|
7668 |
||
7669 |
^ self addComboListOn:aModel tabable:true |
|
7670 |
||
7671 |
"without a list, the comboList is disabled: |
|
7672 |
||
7673 |
|box val| |
|
7674 |
||
7675 |
val := 'some input' asValue. |
|
7676 |
||
7677 |
box := Dialog new. |
|
7678 |
||
7679 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7680 |
box addVerticalSpace. |
|
7681 |
(box addComboListOn:val). |
|
7682 |
box addOkButton. |
|
7683 |
box open. |
|
7684 |
box accepted ifTrue:[ |
|
1401 | 7685 |
Transcript showCR:val value |
593 | 7686 |
]. |
7687 |
" |
|
7688 |
||
7689 |
"with a list, it can be pulled: |
|
7690 |
||
7691 |
|box val| |
|
7692 |
||
7693 |
val := '' asValue. |
|
7694 |
||
7695 |
box := Dialog new. |
|
7696 |
||
7697 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7698 |
box addVerticalSpace. |
|
7699 |
(box addComboListOn:val) list:#('one' 'two' 'three' 'four'). |
|
7700 |
box addOkButton. |
|
7701 |
box open. |
|
7702 |
box accepted ifTrue:[ |
|
1401 | 7703 |
Transcript showCR:val value |
593 | 7704 |
]. |
7705 |
" |
|
7706 |
||
7707 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7708 |
"Modified: 4.3.1996 / 17:22:59 / cg" |
|
7709 |
! |
|
7710 |
||
7711 |
addComboListOn:aModel tabable:tabable |
|
7712 |
"create a comboListView on aModel and add it. |
|
7713 |
Returns the comboListView." |
|
7714 |
||
7715 |
|f| |
|
7716 |
||
7717 |
f := ComboListView new. |
|
7718 |
f model:aModel. |
|
7719 |
self addComponent:f tabable:tabable. |
|
7720 |
^ f |
|
7721 |
||
7722 |
"without a list, the comboList is disabled: |
|
7723 |
||
7724 |
|box val| |
|
7725 |
||
7726 |
val := 'some input' asValue. |
|
7727 |
||
7728 |
box := Dialog new. |
|
7729 |
||
7730 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7731 |
box addVerticalSpace. |
|
7732 |
(box addComboListOn:val tabable:true). |
|
7733 |
box addOkButton. |
|
7734 |
box open. |
|
7735 |
box accepted ifTrue:[ |
|
1401 | 7736 |
Transcript showCR:val value |
593 | 7737 |
]. |
7738 |
" |
|
7739 |
||
7740 |
"with a list, it can be pulled: |
|
7741 |
||
7742 |
|box val| |
|
7743 |
||
7744 |
val := '' asValue. |
|
7745 |
||
7746 |
box := Dialog new. |
|
7747 |
||
7748 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7749 |
box addVerticalSpace. |
|
7750 |
(box addComboListOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7751 |
box addOkButton. |
|
7752 |
box open. |
|
7753 |
box accepted ifTrue:[ |
|
1401 | 7754 |
Transcript showCR:val value |
593 | 7755 |
]. |
7756 |
" |
|
7757 |
||
7758 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7759 |
"Modified: 4.3.1996 / 17:23:38 / cg" |
|
7760 |
! ! |
|
7761 |
||
7762 |
!DialogBox methodsFor:'construction-inputfields'! |
|
7763 |
||
7764 |
addFilenameInputFieldOn:aModel in:aDirectory tabable:tabable |
|
7765 |
"create a fileName input field on aModel and add it. |
|
7766 |
Returns the field. This is much like a normal input field, |
|
7767 |
but supports filename completion." |
|
7768 |
||
7769 |
|f| |
|
7770 |
||
7771 |
f := FilenameEditField new. |
|
7772 |
aDirectory notNil ifTrue:[f directory:aDirectory]. |
|
7773 |
f model:aModel. |
|
7774 |
self addInputField:f tabable:tabable. |
|
7775 |
^ f |
|
7776 |
! |
|
7777 |
||
7778 |
addInputField:aField |
|
7779 |
"add an already created input field. |
|
7780 |
Returns the field." |
|
7781 |
||
7782 |
^ self addInputField:aField tabable:true |
|
7783 |
||
7784 |
"Modified: 9.2.1996 / 20:46:16 / cg" |
|
7785 |
! |
|
7786 |
||
7787 |
addInputField:aField tabable:tabable |
|
7788 |
"add an already created input field. |
|
7789 |
If tabable is true, the field is put into a group, to allow |
|
7790 |
stepping through the fields with #Cursor/#Return keys. |
|
7791 |
Returns the field." |
|
7792 |
||
7793 |
self addComponent:aField tabable:tabable. |
|
7794 |
tabable ifTrue:[ |
|
1401 | 7795 |
self addToInputFieldGroup:aField. |
593 | 7796 |
]. |
7797 |
^ aField |
|
7798 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7799 |
"Modified: 31.5.1996 / 21:22:29 / cg" |
593 | 7800 |
! |
7801 |
||
7802 |
addInputFieldOn:aModel |
|
7803 |
"create an input field on aModel and add it. |
|
7804 |
Returns the field." |
|
7805 |
||
7806 |
^ self addInputFieldOn:aModel tabable:true |
|
7807 |
||
7808 |
" |
|
7809 |
|dialog model field| |
|
7810 |
||
7811 |
model := '' asValue. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7812 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7813 |
dialog := DialogBox new. |
593 | 7814 |
(dialog addTextLabel:'enter a string') adjust:#left. |
7815 |
||
7816 |
field := dialog addInputFieldOn:model. |
|
7817 |
||
7818 |
dialog addAbortButton; addOkButton. |
|
7819 |
dialog open. |
|
655 | 7820 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7821 |
" |
7822 |
||
7823 |
"Modified: 9.2.1996 / 21:34:14 / cg" |
|
7824 |
! |
|
7825 |
||
7826 |
addInputFieldOn:aModel tabable:tabable |
|
7827 |
"create an input field on aModel and add it. |
|
7828 |
If tabable is false, the field cannot be tabbed into |
|
7829 |
and return does not close the box. |
|
7830 |
(pointer must be moved into it). |
|
7831 |
Returns the field." |
|
7832 |
||
7833 |
|f| |
|
7834 |
||
913 | 7835 |
f := EditField model:aModel. |
593 | 7836 |
self addInputField:f tabable:tabable. |
7837 |
^ f |
|
7838 |
||
7839 |
" a non-tabable field: |
|
7840 |
||
7841 |
|dialog model field| |
|
7842 |
||
7843 |
model := '' asValue. |
|
7844 |
||
7845 |
dialog := DialogBox new. |
|
7846 |
(dialog addTextLabel:'enter a string') adjust:#left. |
|
7847 |
||
7848 |
field := dialog addInputFieldOn:model tabable:false. |
|
7849 |
||
7850 |
dialog addAbortButton; addOkButton. |
|
7851 |
dialog open. |
|
655 | 7852 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7853 |
" |
7854 |
||
7855 |
"Modified: 9.2.1996 / 21:36:16 / cg" |
|
913 | 7856 |
"Modified: 3.1.1997 / 10:24:04 / stefan" |
593 | 7857 |
! |
7858 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7859 |
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
|
7860 |
"add a label and an inputField side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7861 |
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
|
7862 |
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
|
7863 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7864 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7865 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7866 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7867 |
^ self |
1401 | 7868 |
addLabelledField:(EditField on:model) label:labelString |
7869 |
adjust:labelAdjust |
|
7870 |
tabable:tabable |
|
7871 |
from:leftX to:rightX |
|
7872 |
separateAtX:relativeX. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7873 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7874 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7875 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7876 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7877 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7878 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7879 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7880 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7881 |
field := dialog |
1401 | 7882 |
addLabelledInputField:'enter a string' |
7883 |
adjust:#left |
|
7884 |
on:model |
|
7885 |
tabable:true |
|
7886 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7887 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7888 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7889 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7890 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7891 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7892 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7893 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7894 |
|dialog model1 model2 field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7895 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7896 |
model1 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7897 |
model2 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7898 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7899 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7900 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7901 |
dialog addTextLabel:'a two-input box'. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7902 |
dialog addHorizontalLine. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7903 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7904 |
field := dialog |
1401 | 7905 |
addLabelledInputField:'string1:' |
7906 |
adjust:#right |
|
7907 |
on:model1 |
|
7908 |
tabable:true |
|
7909 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7910 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7911 |
field := dialog |
1401 | 7912 |
addLabelledInputField:'string2:' |
7913 |
adjust:#right |
|
7914 |
on:model2 |
|
7915 |
tabable:true |
|
7916 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7917 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7918 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7919 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7920 |
dialog accepted ifTrue:[ |
1401 | 7921 |
Transcript showCR:model1 value. |
7922 |
Transcript showCR:model2 value. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7923 |
]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7924 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7925 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7926 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7927 |
"Created: 3.6.1996 / 11:04:23 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7928 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7929 |
|
593 | 7930 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable separateAtX:relativeX |
7931 |
"add a label and an inputField side-by-side. |
|
7932 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
7933 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
7934 |
The inputField gets model as its model. |
|
7935 |
Return the inputField." |
|
7936 |
||
7937 |
||
7938 |
^ self |
|
1401 | 7939 |
addLabelledField:(EditField on:model) label:labelString |
7940 |
adjust:labelAdjust |
|
7941 |
tabable:tabable |
|
7942 |
separateAtX:relativeX. |
|
593 | 7943 |
|
7944 |
" |
|
7945 |
|dialog model field| |
|
7946 |
||
7947 |
model := '' asValue. |
|
7948 |
||
7949 |
dialog := DialogBox new. |
|
7950 |
||
7951 |
field := dialog |
|
1401 | 7952 |
addLabelledInputField:'enter a string' |
7953 |
adjust:#left |
|
7954 |
on:model |
|
7955 |
tabable:true |
|
7956 |
separateAtX:0.3. |
|
593 | 7957 |
|
7958 |
dialog addAbortButton; addOkButton. |
|
7959 |
dialog open. |
|
655 | 7960 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7961 |
" |
7962 |
||
7963 |
" |
|
7964 |
|dialog model1 model2 field| |
|
7965 |
||
7966 |
model1 := '' asValue. |
|
7967 |
model2 := '' asValue. |
|
7968 |
||
7969 |
dialog := DialogBox new. |
|
7970 |
||
7971 |
dialog addTextLabel:'a two-input box'. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7972 |
dialog addHorizontalLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7973 |
|
593 | 7974 |
field := dialog |
1401 | 7975 |
addLabelledInputField:'string1:' |
7976 |
adjust:#right |
|
7977 |
on:model1 |
|
7978 |
tabable:true |
|
7979 |
separateAtX:0.4. |
|
593 | 7980 |
|
7981 |
field := dialog |
|
1401 | 7982 |
addLabelledInputField:'string2:' |
7983 |
adjust:#right |
|
7984 |
on:model2 |
|
7985 |
tabable:true |
|
7986 |
separateAtX:0.4. |
|
593 | 7987 |
|
7988 |
dialog addAbortButton; addOkButton. |
|
7989 |
dialog open. |
|
7990 |
dialog accepted ifTrue:[ |
|
1401 | 7991 |
Transcript showCR:model1 value. |
7992 |
Transcript showCR:model2 value. |
|
593 | 7993 |
]. |
7994 |
" |
|
7995 |
||
7996 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
7997 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
|
7998 |
! ! |
|
7999 |
||
8000 |
!DialogBox methodsFor:'construction-layout'! |
|
8001 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8002 |
addGap |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8003 |
"VW compatibility" |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8004 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8005 |
self addGap:4 |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8006 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8007 |
|
2116 | 8008 |
addGap:pixels |
8009 |
"VW compatibility" |
|
8010 |
||
8011 |
self addVerticalSpace:pixels |
|
8012 |
||
8013 |
"Created: / 4.2.2000 / 00:03:58 / cg" |
|
8014 |
"Modified: / 5.2.2000 / 15:30:26 / cg" |
|
8015 |
! |
|
8016 |
||
593 | 8017 |
addHorizontalLine |
8018 |
"add a horizontal line as separator" |
|
8019 |
||
8020 |
^ self addComponent:(Separator new extent:1.0 @ 5). |
|
8021 |
||
8022 |
" |
|
8023 |
|dialog| |
|
8024 |
||
8025 |
dialog := DialogBox new. |
|
8026 |
dialog |
|
1401 | 8027 |
addTextLabel:'some title string'; |
8028 |
addHorizontalLine; |
|
8029 |
addTextLabel:'more text'; |
|
8030 |
addOkButton; |
|
8031 |
open. |
|
593 | 8032 |
" |
8033 |
||
8034 |
" |
|
8035 |
|dialog| |
|
8036 |
||
8037 |
dialog := DialogBox new. |
|
8038 |
dialog |
|
1401 | 8039 |
addTextLabel:'some title string'; |
8040 |
addHorizontalLine; |
|
8041 |
addTextLabel:'more text'. |
|
593 | 8042 |
(dialog addHorizontalLine) width:20. |
8043 |
dialog addTextLabel:'more text'. |
|
8044 |
(dialog addHorizontalLine) width:20. |
|
8045 |
dialog |
|
1401 | 8046 |
addTextLabel:'more text'; |
8047 |
addHorizontalLine; |
|
8048 |
addOkButton; |
|
8049 |
open. |
|
593 | 8050 |
" |
8051 |
||
8052 |
"Modified: 19.4.1996 / 15:11:30 / cg" |
|
8053 |
! |
|
8054 |
||
8055 |
addVerticalSpace |
|
8056 |
"add a default vertical space (1 mm)" |
|
8057 |
||
8058 |
self addVerticalSpace:(ViewSpacing). |
|
8059 |
||
8060 |
" |
|
8061 |
|dialog| |
|
8062 |
||
8063 |
dialog := DialogBox new. |
|
8064 |
dialog addTextLabel:'some title string'. |
|
8065 |
dialog addVerticalSpace. |
|
8066 |
dialog addTextLabel:'more text'. |
|
8067 |
||
8068 |
dialog addOkButton. |
|
8069 |
dialog open. |
|
8070 |
" |
|
8071 |
||
8072 |
"Modified: 9.2.1996 / 21:41:10 / cg" |
|
8073 |
! |
|
8074 |
||
8075 |
addVerticalSpace:nPixel |
|
8076 |
"add some pixels of space to the next component" |
|
8077 |
||
8078 |
yPosition := yPosition + nPixel. |
|
8079 |
needResize := true. |
|
8080 |
||
8081 |
" |
|
8082 |
|dialog| |
|
8083 |
||
8084 |
dialog := DialogBox new. |
|
8085 |
dialog addTextLabel:'some title string'. |
|
8086 |
dialog addVerticalSpace:50. |
|
8087 |
dialog addTextLabel:'more text'. |
|
8088 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8089 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8090 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8091 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8092 |
|
593 | 8093 |
"Modified: 9.2.1996 / 21:41:23 / cg" |
8094 |
! |
|
8095 |
||
2116 | 8096 |
bottomAlign:widgets |
8097 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8098 |
||
2145 | 8099 |
'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR. |
8100 |
"/ self halt:'unimplemented VW functionality'. |
|
2116 | 8101 |
|
8102 |
"Created: / 4.2.2000 / 00:10:21 / cg" |
|
8103 |
"Modified: / 5.2.2000 / 15:31:23 / cg" |
|
8104 |
! |
|
8105 |
||
8106 |
bottomAlignLowerEdge:widget |
|
8107 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8108 |
||
2145 | 8109 |
"/ self halt:'unimplemented VW functionality'. |
8110 |
self stickAtBottomWithVariableHeight:widget |
|
2116 | 8111 |
|
8112 |
"Modified: / 5.2.2000 / 15:31:15 / cg" |
|
8113 |
! |
|
8114 |
||
593 | 8115 |
leftIndent |
8116 |
"return the current indent |
|
8117 |
(current x position - thats where the next component will be located)." |
|
8118 |
||
8119 |
^ leftIndent |
|
8120 |
||
8121 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8122 |
! |
|
8123 |
||
8124 |
leftIndent:aNumber |
|
4145 | 8125 |
"set the left indent |
8126 |
(current x position - that's where the next component(s) will be located). |
|
8127 |
Setting this before adding a component will place it indented" |
|
593 | 8128 |
|
8129 |
leftIndent := aNumber. |
|
8130 |
needResize := true. |
|
8131 |
||
8132 |
" |
|
8133 |
|dialog| |
|
8134 |
||
8135 |
dialog := DialogBox new. |
|
8136 |
(dialog addTextLabel:'label1') adjust:#left. |
|
8137 |
dialog leftIndent:20. |
|
8138 |
(dialog addTextLabel:'label2') adjust:#left. |
|
8139 |
dialog leftIndent:40. |
|
8140 |
(dialog addTextLabel:'label3') adjust:#left. |
|
8141 |
dialog leftIndent:60. |
|
8142 |
(dialog addTextLabel:'label4') adjust:#left. |
|
8143 |
||
8144 |
dialog addOkButton. |
|
8145 |
dialog open. |
|
8146 |
" |
|
8147 |
||
8148 |
"Modified: 9.2.1996 / 21:42:20 / cg" |
|
8149 |
! |
|
8150 |
||
8151 |
rightIndent |
|
8152 |
"return the current right indent." |
|
8153 |
||
8154 |
^ rightIndent |
|
8155 |
||
8156 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8157 |
! |
|
8158 |
||
8159 |
rightIndent:aNumber |
|
8160 |
"set the right indent" |
|
8161 |
||
8162 |
rightIndent := aNumber. |
|
8163 |
needResize := true. |
|
8164 |
||
8165 |
" |
|
8166 |
|dialog| |
|
8167 |
||
8168 |
dialog := DialogBox new. |
|
8169 |
(dialog addTextLabel:'label1') adjust:#right. |
|
8170 |
dialog rightIndent:20. |
|
8171 |
(dialog addTextLabel:'label2') adjust:#right. |
|
8172 |
dialog rightIndent:40. |
|
8173 |
(dialog addTextLabel:'label3') adjust:#right. |
|
8174 |
dialog rightIndent:60. |
|
8175 |
(dialog addTextLabel:'label4') adjust:#right. |
|
8176 |
||
8177 |
dialog addOkButton. |
|
8178 |
dialog open. |
|
8179 |
" |
|
8180 |
||
8181 |
"Modified: 9.2.1996 / 21:42:46 / cg" |
|
8182 |
! |
|
8183 |
||
2116 | 8184 |
setInitialGap |
8185 |
||
8186 |
"Created: / 4.2.2000 / 00:01:44 / cg" |
|
8187 |
! |
|
8188 |
||
593 | 8189 |
stickAtBottomWithFixHeight:aComponent |
8190 |
"arrange for a component to be positioned at a constant offset |
|
8191 |
from the bottom of the box and its height to remain the same. |
|
8192 |
This will keep the component at a constant distance from the bottom |
|
2220 | 8193 |
(without this setup, it would stay at a constant offset from the top). |
8194 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8195 |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8196 |
self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0 |
593 | 8197 |
|
8198 |
" |
|
8199 |
compare the resizing behavior of: |
|
8200 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8201 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8202 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8203 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8204 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8205 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8206 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8207 |
box show |
593 | 8208 |
|
8209 |
with: |
|
8210 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8211 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8212 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8213 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8214 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8215 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8216 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8217 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8218 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8219 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8220 |
|
2220 | 8221 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8222 |
"Modified: / 18.8.2000 / 21:38:21 / cg" |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8223 |
! |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8224 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8225 |
stickAtBottomWithFixHeight:aComponent left:left right:right |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8226 |
"arrange for a component to be positioned at a constant offset |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8227 |
from the bottom of the box and its height to remain the same. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8228 |
This will keep the component at a constant distance from the bottom |
2220 | 8229 |
(without this setup, it would stay at a constant offset from the top). |
8230 |
ATTENTION: use this as a last step, after all components have been added." |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8231 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8232 |
self resize. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8233 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8234 |
aComponent |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8235 |
topInset:(self height - aComponent top) negated; |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8236 |
bottomInset:(self height - aComponent bottom); |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8237 |
origin:left @ 1.0; corner:right @ 1.0. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8238 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8239 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8240 |
compare the resizing behavior of: |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8241 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8242 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8243 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8244 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8245 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8246 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8247 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8248 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8249 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8250 |
with: |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8251 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8252 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8253 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8254 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8255 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8256 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8257 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8258 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8259 |
box show |
593 | 8260 |
" |
8261 |
||
2220 | 8262 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8263 |
"Modified: / 18.8.2000 / 21:38:26 / cg" |
|
593 | 8264 |
! |
8265 |
||
8266 |
stickAtBottomWithVariableHeight:aComponent |
|
8267 |
"arrange for a component to be positioned at a constant offset |
|
8268 |
from the bottom of the box and its height to be adjusted. |
|
8269 |
This will resize the component for a constant distance from the top, |
|
8270 |
and the bottom. |
|
2220 | 8271 |
(without this setup, its height would remain constant). |
8272 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8273 |
|
8274 |
self resize. |
|
8275 |
||
8276 |
aComponent |
|
2220 | 8277 |
bottomInset:(self height - aComponent bottom); |
8278 |
corner:1.0@1.0. |
|
593 | 8279 |
|
8280 |
" |
|
8281 |
compare the resizing behavior of: |
|
8282 |
||
2220 | 8283 |
|box| |
8284 |
||
8285 |
box := Dialog new. |
|
8286 |
box addTextLabel:'hello'. |
|
8287 |
(box addComponent:(SelectionInListView new)) level:-1. |
|
8288 |
box addOkButton. |
|
8289 |
box show |
|
593 | 8290 |
|
8291 |
with: |
|
8292 |
||
2220 | 8293 |
|box list| |
8294 |
||
8295 |
box := Dialog new. |
|
8296 |
box addTextLabel:'hello'. |
|
8297 |
list := (box addComponent:(SelectionInListView new)) level:-1. |
|
8298 |
box addOkButton. |
|
8299 |
box stickAtBottomWithVariableHeight:list. |
|
8300 |
box show |
|
593 | 8301 |
" |
8302 |
||
2220 | 8303 |
"Modified: / 18.8.2000 / 21:38:35 / cg" |
593 | 8304 |
! |
8305 |
||
8306 |
yPosition |
|
8307 |
"return the current y position (thats where the next component |
|
8308 |
will be located)." |
|
8309 |
||
8310 |
^ yPosition |
|
120 | 8311 |
! |
8312 |
||
593 | 8313 |
yPosition:aNumber |
8314 |
"set the current y position (thats where the next component |
|
8315 |
will be located)." |
|
8316 |
||
8317 |
yPosition := aNumber. |
|
8318 |
needResize := true. |
|
8319 |
||
8320 |
" |
|
8321 |
|dialog pos| |
|
8322 |
||
8323 |
dialog := DialogBox new. |
|
8324 |
pos := dialog yPosition. |
|
8325 |
(dialog addTextLabel:'label1') width:0.5. |
|
8326 |
dialog yPosition:pos. |
|
8327 |
(dialog addTextLabel:'label2') width:0.5; left:0.5. |
|
8328 |
||
8329 |
dialog addOkButton. |
|
8330 |
dialog open. |
|
8331 |
" |
|
8332 |
||
8333 |
" |
|
8334 |
|dialog pos| |
|
8335 |
||
8336 |
dialog := DialogBox new. |
|
8337 |
pos := dialog yPosition. |
|
8338 |
#('one' 'two' 'three' 'four') |
|
8339 |
with:#(0.0 0.25 0.5 0.75) do:[:lbl :x | |
|
1401 | 8340 |
dialog yPosition:pos. |
8341 |
(dialog addComponent:(Button label:lbl) tabable:true) |
|
8342 |
width:0.25; left:x. |
|
593 | 8343 |
]. |
8344 |
||
8345 |
dialog addOkButton. |
|
8346 |
dialog open. |
|
8347 |
" |
|
8348 |
||
8349 |
"Modified: 9.2.1996 / 21:46:40 / cg" |
|
8350 |
! ! |
|
8351 |
||
8352 |
!DialogBox methodsFor:'construction-lists'! |
|
8353 |
||
2116 | 8354 |
addList:listHolder lines:nLines validation:validateionBlock |
8355 |
^ self |
|
8356 |
addListBoxOn:listHolder |
|
8357 |
withNumberOfLines:nLines |
|
8358 |
hScrollable:true |
|
8359 |
vScrollable:true |
|
8360 |
||
8361 |
"Created: / 4.2.2000 / 00:04:49 / cg" |
|
8362 |
"Modified: / 4.2.2000 / 00:06:06 / cg" |
|
8363 |
! |
|
8364 |
||
593 | 8365 |
addListBoxOn:aModel |
8366 |
"add a selectionInListView to the box. |
|
8367 |
The listViews ScrollWrapper is returned" |
|
8368 |
||
8369 |
^ self |
|
1401 | 8370 |
addListBoxOn:aModel |
8371 |
withNumberOfLines:nil |
|
8372 |
hScrollable:false |
|
8373 |
vScrollable:true. |
|
593 | 8374 |
|
8375 |
" |
|
8376 |
|dialog model listView| |
|
8377 |
||
8378 |
model := SelectionInList new. |
|
8379 |
model list:#('one' 'two' 'three' 'four'). |
|
8380 |
model selectionIndex:2. |
|
8381 |
||
8382 |
dialog := DialogBox new. |
|
8383 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8384 |
||
8385 |
listView := dialog addListBoxOn:model. |
|
8386 |
||
8387 |
dialog addAbortButton; addOkButton. |
|
8388 |
dialog open. |
|
8389 |
||
655 | 8390 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8391 |
" |
8392 |
||
8393 |
"Modified: 27.4.1996 / 18:27:58 / cg" |
|
8394 |
! |
|
8395 |
||
8396 |
addListBoxOn:aModel class:aListViewClass |
|
8397 |
"create & add an instance of aListViewClass to the box. |
|
8398 |
The listViews ScrollWrapper is returned" |
|
8399 |
||
8400 |
^ self |
|
1401 | 8401 |
addListBoxOn:aModel |
8402 |
class:aListViewClass |
|
8403 |
withNumberOfLines:nil |
|
8404 |
hScrollable:false |
|
8405 |
vScrollable:true. |
|
593 | 8406 |
|
8407 |
"Created: 19.4.1996 / 13:06:14 / cg" |
|
8408 |
"Modified: 27.4.1996 / 18:27:53 / cg" |
|
8409 |
! |
|
8410 |
||
8411 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines |
|
8412 |
"create and add an instance of aListViewClass to the box. |
|
8413 |
The list has numLines (if nonNil) number of lines shown. |
|
8414 |
The listViews ScrollWrapper is returned" |
|
8415 |
||
8416 |
^ self |
|
1401 | 8417 |
addListBoxOn:aModel |
8418 |
class:aListViewClass |
|
8419 |
withNumberOfLines:numLines |
|
8420 |
hScrollable:false |
|
8421 |
vScrollable:true. |
|
593 | 8422 |
|
8423 |
"Created: 19.4.1996 / 13:05:05 / cg" |
|
8424 |
"Modified: 27.4.1996 / 18:27:48 / cg" |
|
8425 |
! |
|
8426 |
||
8427 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
766 | 8428 |
"add an instance of aListViewClass (selectionInListView) to the box. |
593 | 8429 |
The list has numLines (if nonNil) number of lines shown. |
8430 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8431 |
||
766 | 8432 |
|l| |
8433 |
||
8434 |
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
|
8435 |
(aListViewClass canUnderstand:#doubleClickAction:) ifTrue:[ |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8436 |
l doubleClickAction:[:name | self okPressed]. |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8437 |
]. |
766 | 8438 |
^ l |
593 | 8439 |
|
8440 |
" |
|
8441 |
|dialog listView| |
|
8442 |
||
8443 |
dialog := DialogBox new. |
|
8444 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8445 |
||
8446 |
listView := dialog |
|
3812
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8447 |
addListBoxOn:nil |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8448 |
class:FileSelectionList |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8449 |
withNumberOfLines:10 |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8450 |
hScrollable:false |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8451 |
vScrollable:false. |
593 | 8452 |
|
8453 |
listView directory:'/etc'. |
|
8454 |
||
8455 |
dialog addAbortButton; addOkButton. |
|
8456 |
dialog open. |
|
8457 |
||
655 | 8458 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView selectionValue]. |
593 | 8459 |
" |
8460 |
||
8461 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8462 |
"Modified: 27.4.1996 / 18:26:15 / cg" |
|
766 | 8463 |
"Modified: 15.6.1996 / 00:31:20 / stefan" |
593 | 8464 |
! |
8465 |
||
8466 |
addListBoxOn:aModel withNumberOfLines:numLines |
|
8467 |
"add a selectionInListView to the box. |
|
8468 |
The list has numLines (if nonNil) number of lines shown. |
|
8469 |
The listViews ScrollWrapper is returned" |
|
8470 |
||
8471 |
^ self |
|
1401 | 8472 |
addListBoxOn:aModel |
8473 |
withNumberOfLines:numLines |
|
8474 |
hScrollable:false |
|
8475 |
vScrollable:true. |
|
593 | 8476 |
|
8477 |
" |
|
8478 |
|dialog model listView| |
|
8479 |
||
8480 |
model := SelectionInList new. |
|
8481 |
model list:#('one' 'two' 'three' 'four'). |
|
8482 |
model selectionIndex:2. |
|
8483 |
||
8484 |
dialog := DialogBox new. |
|
8485 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8486 |
||
8487 |
listView := dialog addListBoxOn:model withNumberOfLines:3. |
|
8488 |
||
8489 |
dialog addAbortButton; addOkButton. |
|
8490 |
dialog open. |
|
8491 |
||
655 | 8492 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8493 |
" |
8494 |
||
8495 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8496 |
"Modified: 27.4.1996 / 18:27:42 / cg" |
|
8497 |
! |
|
8498 |
||
8499 |
addListBoxOn:aModel withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
8500 |
"add a selectionInListView to the box. |
|
8501 |
The list has numLines (if nonNil) number of lines shown. |
|
8502 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8503 |
||
8504 |
^ self |
|
1401 | 8505 |
addListBoxOn:aModel |
8506 |
class:SelectionInListView |
|
8507 |
withNumberOfLines:numLines |
|
8508 |
hScrollable:hs |
|
8509 |
vScrollable:vs |
|
593 | 8510 |
|
8511 |
" |
|
8512 |
|dialog model listView| |
|
8513 |
||
8514 |
model := SelectionInList new. |
|
8515 |
model list:#('one' 'two' 'three' 'four'). |
|
8516 |
model selectionIndex:2. |
|
8517 |
||
8518 |
dialog := DialogBox new. |
|
8519 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8520 |
||
8521 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:true vScrollable:true. |
|
8522 |
||
8523 |
dialog addAbortButton; addOkButton. |
|
8524 |
dialog open. |
|
8525 |
||
655 | 8526 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8527 |
" |
8528 |
||
8529 |
" |
|
8530 |
|dialog model listView| |
|
8531 |
||
8532 |
model := SelectionInList new. |
|
8533 |
model list:#('one' 'two' 'three' 'four'). |
|
8534 |
model selectionIndex:2. |
|
8535 |
||
8536 |
dialog := DialogBox new. |
|
8537 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8538 |
||
8539 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:false vScrollable:false. |
|
8540 |
||
8541 |
dialog addAbortButton; addOkButton. |
|
8542 |
dialog open. |
|
8543 |
||
655 | 8544 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8545 |
" |
8546 |
||
8547 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8548 |
"Modified: 27.4.1996 / 18:26:36 / cg" |
|
8549 |
! |
|
8550 |
||
8551 |
addPopUpList:labelString on:aModel |
|
8552 |
"create a popUpList with a label on aModel and add it. |
|
8553 |
Returns the box." |
|
8554 |
||
8555 |
^ self addPopUpList:labelString on:aModel tabable:true |
|
8556 |
! |
|
8557 |
||
8558 |
addPopUpList:labelString on:aModel tabable:tabable |
|
8559 |
"create a popUpList on aModel and add it. |
|
8560 |
Returns the popUpList." |
|
8561 |
||
8562 |
|p box l| |
|
8563 |
||
8564 |
p := PopUpList on:aModel. |
|
8565 |
p resize; sizeFixed:true. |
|
8566 |
labelString notNil ifTrue:[ |
|
1401 | 8567 |
box := HorizontalPanelView new. |
8568 |
box borderWidth:0; horizontalLayout:#rightSpace. |
|
8569 |
box add:(l := Label label:labelString). |
|
8570 |
l borderWidth:0. |
|
8571 |
box add:p. |
|
593 | 8572 |
] ifFalse:[ |
1401 | 8573 |
box := p. |
593 | 8574 |
]. |
8575 |
self addComponent:box tabable:tabable tabbedComponent:p. |
|
8576 |
^ p |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
8577 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8578 |
"Modified: 31.5.1996 / 21:25:17 / cg" |
593 | 8579 |
! |
8580 |
||
8581 |
addPopUpListOn:aModel |
|
8582 |
"create a popUpList on aModel and add it. |
|
8583 |
Returns the box." |
|
8584 |
||
8585 |
^ self addPopUpList:nil on:aModel tabable:true |
|
8586 |
! |
|
8587 |
||
8588 |
addPopUpListOn:aModel tabable:tabable |
|
8589 |
"create a popUpList on aModel and add it. |
|
8590 |
Returns the popUpList." |
|
8591 |
||
8592 |
^ self addPopUpList:nil on:aModel tabable:tabable |
|
766 | 8593 |
! |
8594 |
||
8595 |
addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
8596 |
"add an instance of aListViewClass to the box. |
|
8597 |
The list has numLines (if nonNil) number of lines shown. |
|
8598 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8599 |
||
8600 |
|l scr h dH| |
|
8601 |
||
8602 |
l := aListViewClass new. |
|
8603 |
l model:aModel. |
|
8604 |
||
877 | 8605 |
(vs or:[hs]) ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8606 |
hs ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8607 |
scr := HVScrollableView forView:l miniScrollerH:true . |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8608 |
] ifFalse:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8609 |
scr := ScrollableView forView:l |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8610 |
]. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8611 |
scr resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8612 |
"/ Transcript show:scr height; show:' '; showCR:l height. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8613 |
dH := scr height - l height. |
766 | 8614 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8615 |
l level:-1. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8616 |
scr := l. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8617 |
dH := 0. |
766 | 8618 |
]. |
8619 |
||
8620 |
numLines notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8621 |
h := l heightForLines:numLines. |
766 | 8622 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8623 |
h := l preferredHeight |
766 | 8624 |
]. |
8625 |
self addComponent:scr withHeight:(h + dH). |
|
8626 |
^ scr |
|
8627 |
||
8628 |
" |
|
8629 |
|dialog listView| |
|
8630 |
||
8631 |
dialog := DialogBox new. |
|
8632 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8633 |
||
8634 |
listView := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8635 |
addTextBoxOn:nil |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8636 |
class:EditTextView |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8637 |
withNumberOfLines:10 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8638 |
hScrollable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8639 |
vScrollable:true. |
766 | 8640 |
|
8641 |
||
8642 |
dialog addAbortButton; addOkButton. |
|
8643 |
dialog open. |
|
8644 |
||
8645 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView contents]. |
|
8646 |
" |
|
8647 |
||
8648 |
"Created: 14.6.1996 / 23:33:47 / stefan" |
|
877 | 8649 |
"Modified: 8.11.1996 / 15:31:15 / cg" |
593 | 8650 |
! ! |
8651 |
||
8652 |
!DialogBox methodsFor:'construction-rows & columns'! |
|
8653 |
||
130 | 8654 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock |
8655 |
"add some elements in a vertical column. |
|
8656 |
Equally space elements as returned from aBlock." |
|
8657 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8658 |
self |
1401 | 8659 |
addColumn:aRow |
8660 |
fromX:leftX toX:rightX |
|
8661 |
collect:aBlock |
|
8662 |
tabable:false |
|
130 | 8663 |
|
8664 |
" |
|
8665 |
|dialog| |
|
8666 |
||
8667 |
dialog := Dialog new. |
|
8668 |
dialog |
|
1401 | 8669 |
addColumn:#('label1' 'label2' 'lbl3' 'l4' 'label5') |
8670 |
fromX:0.0 |
|
8671 |
toX:1.0 |
|
8672 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8673 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8674 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8675 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8676 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8677 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8678 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8679 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8680 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8681 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8682 |
dialog |
1401 | 8683 |
addColumn:#('label1' 'label2' 'label3' 'label4' 'label5') |
8684 |
fromX:0.25 |
|
8685 |
toX:0.75 |
|
8686 |
collect:[:label | (Label label:label) adjust:#left]. |
|
130 | 8687 |
|
8688 |
dialog addOkButton. |
|
8689 |
dialog open. |
|
8690 |
" |
|
8691 |
||
8692 |
" |
|
8693 |
|dialog y| |
|
8694 |
||
8695 |
dialog := Dialog new. |
|
8696 |
y := dialog yPosition. |
|
8697 |
dialog |
|
1401 | 8698 |
addColumn:#('a1' 'b1' 'c1' 'd1') |
8699 |
fromX:0 |
|
8700 |
toX:(1/3) |
|
8701 |
collect:[:label | Label label:label]. |
|
130 | 8702 |
|
8703 |
dialog yPosition:y. |
|
8704 |
dialog |
|
1401 | 8705 |
addColumn:#('a2' 'b2' 'c2' 'd2') |
8706 |
fromX:(1/3) |
|
8707 |
toX:(2/3) |
|
8708 |
collect:[:label | Label label:label]. |
|
130 | 8709 |
|
8710 |
dialog yPosition:y. |
|
8711 |
dialog |
|
1401 | 8712 |
addColumn:#('a3' 'b3' 'c3' 'd3') |
8713 |
fromX:(2/3) |
|
8714 |
toX:1 |
|
8715 |
collect:[:label | Label label:label]. |
|
130 | 8716 |
|
8717 |
dialog addOkButton. |
|
8718 |
dialog open. |
|
8719 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8720 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8721 |
"Modified: 9.2.1996 / 22:22:12 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8722 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8723 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8724 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8725 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8726 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8727 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8728 |
self |
1401 | 8729 |
addColumn:aRow |
8730 |
fromX:leftX toX:rightX |
|
8731 |
collect:aBlock |
|
8732 |
tabable:tabable |
|
8733 |
horizontalLayout:#fitSpace |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8734 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8735 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8736 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8737 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8738 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8739 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8740 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8741 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8742 |
dialog |
1401 | 8743 |
addColumn:#('one' 'two' 'three' 'four') |
8744 |
fromX:0 |
|
8745 |
toX:0.3 |
|
8746 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8747 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8748 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8749 |
dialog |
1401 | 8750 |
addColumn:values |
8751 |
fromX:0.3 |
|
8752 |
toX:1.0 |
|
8753 |
collect:[:value | EditField on:value] |
|
8754 |
tabable:true. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8755 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8756 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8757 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8758 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8759 |
dialog accepted ifTrue:[ |
1401 | 8760 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8761 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8762 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8763 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8764 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8765 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8766 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8767 |
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
|
8768 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8769 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8770 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8771 |
dialog |
1401 | 8772 |
addColumn:(1 to:4) |
8773 |
fromX:0 |
|
8774 |
toX:0.5 |
|
8775 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8776 |
tabable:true |
|
8777 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8778 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8779 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8780 |
dialog |
1401 | 8781 |
addColumn:(5 to:8) |
8782 |
fromX:0.5 |
|
8783 |
toX:1.0 |
|
8784 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8785 |
tabable:true |
|
8786 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8787 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8788 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8789 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8790 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8791 |
dialog accepted ifTrue:[ |
1401 | 8792 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8793 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8794 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8795 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8796 |
"Created: 9.2.1996 / 21:51:47 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8797 |
"Modified: 9.2.1996 / 22:22:02 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8798 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8799 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8800 |
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
|
8801 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8802 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8803 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8804 |
|helper component| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8805 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8806 |
helper := VerticalPanelView new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8807 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8808 |
aRow do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8809 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8810 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8811 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8812 |
tabable ifTrue:[self makeTabable:component]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8813 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8814 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8815 |
helper resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8816 |
self addComponent:helper. |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8817 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8818 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8819 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8820 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8821 |
helper horizontalLayout:hLayout. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8822 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8823 |
right:rightX asFloat; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8824 |
leftInset:leftIndent; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8825 |
rightInset:rightIndent. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8826 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8827 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8828 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8829 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8830 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8831 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8832 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8833 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8834 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8835 |
addColumn:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8836 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8837 |
toX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8838 |
collect:[:label | Label label:label]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8839 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8840 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8841 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8842 |
addColumn:values |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8843 |
fromX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8844 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8845 |
collect:[:value | EditField on:value] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8846 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8847 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8848 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8849 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8850 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8851 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8852 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8853 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8854 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8855 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8856 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8857 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8858 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8859 |
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
|
8860 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8861 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8862 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8863 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8864 |
addColumn:(1 to:4) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8865 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8866 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8867 |
collect:[:idx | CheckToggle on:(values at:idx)]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8868 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8869 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8870 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8871 |
addColumn:(5 to:8) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8872 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8873 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8874 |
collect:[:idx | CheckToggle on:(values at:idx)] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8875 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8876 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8877 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8878 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8879 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8880 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8881 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8882 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8883 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8884 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8885 |
"Modified: 9.2.1996 / 22:02:22 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8886 |
"Created: 9.2.1996 / 22:20:31 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8887 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8888 |
|
130 | 8889 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock |
8890 |
"add some elements in a horizontal row. |
|
8891 |
Equally space elements as returned from aBlock. |
|
8892 |
Advance y." |
|
8893 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8894 |
self |
1401 | 8895 |
addRow:aCol |
8896 |
fromX:leftX toX:rightX |
|
8897 |
collect:aBlock |
|
8898 |
tabable:true |
|
8899 |
horizontalLayout:#spread |
|
130 | 8900 |
|
8901 |
" |
|
8902 |
|dialog| |
|
8903 |
||
8904 |
dialog := Dialog new. |
|
8905 |
dialog |
|
1401 | 8906 |
addRow:#('a' 'b' 'c' 'd') |
8907 |
fromX:0 |
|
8908 |
toX:1 |
|
8909 |
collect:[:label | Label label:label]. |
|
130 | 8910 |
|
8911 |
dialog addOkButton. |
|
8912 |
dialog open. |
|
8913 |
" |
|
8914 |
||
8915 |
" |
|
8916 |
|dialog| |
|
8917 |
||
8918 |
dialog := Dialog new. |
|
8919 |
dialog |
|
1401 | 8920 |
addRow:#('a1' 'b1' 'c1' 'd1') |
8921 |
fromX:0 |
|
8922 |
toX:1 |
|
8923 |
collect:[:label | Label label:label]. |
|
130 | 8924 |
|
8925 |
dialog |
|
1401 | 8926 |
addRow:#('a2' 'b2' 'c2' 'd2') |
8927 |
fromX:0 |
|
8928 |
toX:0.5 |
|
8929 |
collect:[:label | Label label:label]. |
|
130 | 8930 |
|
8931 |
dialog |
|
1401 | 8932 |
addRow:#('a3' 'b3' 'c3' 'd3') |
8933 |
fromX:0.5 |
|
8934 |
toX:1 |
|
8935 |
collect:[:label | Label label:label]. |
|
130 | 8936 |
|
8937 |
dialog addOkButton. |
|
8938 |
dialog open. |
|
8939 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8940 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8941 |
"Modified: 9.2.1996 / 22:25:16 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8942 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8943 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8944 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8945 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8946 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8947 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8948 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8949 |
self |
1401 | 8950 |
addRow:aCol |
8951 |
fromX:leftX toX:rightX |
|
8952 |
collect:aBlock |
|
8953 |
tabable:tabable |
|
8954 |
horizontalLayout:#spread |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8955 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8956 |
"Created: 9.2.1996 / 22:25:35 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8957 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8958 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8959 |
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
|
8960 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8961 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8962 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8963 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8964 |
^ self |
1401 | 8965 |
addRow:aCol |
8966 |
fromX:leftX toX:rightX |
|
8967 |
collect:aBlock |
|
8968 |
tabable:tabable |
|
8969 |
horizontalLayout:hLayout |
|
8970 |
verticalLayout:#fit |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8971 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8972 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8973 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8974 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8975 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8976 |
dialog |
1401 | 8977 |
addRow:#('a' 'b' 'c' 'd') |
8978 |
fromX:0 |
|
8979 |
toX:1 |
|
8980 |
collect:[:label | Label label:label] |
|
8981 |
tabable:false |
|
8982 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8983 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8984 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8985 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8986 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8987 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8988 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8989 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8990 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8991 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8992 |
dialog |
1401 | 8993 |
addRow:#('one' 'two' 'three' 'four') |
8994 |
fromX:0 |
|
8995 |
toX:1 |
|
8996 |
collect:[:label | Button label:label] |
|
8997 |
tabable:false |
|
8998 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8999 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9000 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9001 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9002 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9003 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9004 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9005 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9006 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9007 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9008 |
dialog |
1401 | 9009 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9010 |
fromX:0 |
|
9011 |
toX:1 |
|
9012 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9013 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9014 |
dialog |
1401 | 9015 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9016 |
fromX:0 |
|
9017 |
toX:0.5 |
|
9018 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9019 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9020 |
dialog |
1401 | 9021 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9022 |
fromX:0.5 |
|
9023 |
toX:1 |
|
9024 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9025 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9026 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9027 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9028 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9029 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9030 |
"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
|
9031 |
"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
|
9032 |
! |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9033 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9034 |
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
|
9035 |
"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
|
9036 |
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
|
9037 |
Advance y." |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9038 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9039 |
|helper component| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9040 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9041 |
helper := HorizontalPanelView new. |
792 | 9042 |
helper borderWidth:0. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9043 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9044 |
aCol do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9045 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9046 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9047 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9048 |
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
|
9049 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9050 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9051 |
helper resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9052 |
self addComponent:helper. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9053 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9054 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9055 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9056 |
"/ 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
|
9057 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9058 |
hLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9059 |
helper horizontalLayout:hLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9060 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9061 |
vLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9062 |
helper verticalLayout:vLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9063 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9064 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9065 |
right:rightX asFloat. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9066 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9067 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9068 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9069 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9070 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9071 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9072 |
addRow:#('a' 'b' 'c' 'd') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9073 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9074 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9075 |
collect:[:label | Label label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9076 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9077 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9078 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9079 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9080 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9081 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9082 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9083 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9084 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9085 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9086 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9087 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9088 |
addRow:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9089 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9090 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9091 |
collect:[:label | Button label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9092 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9093 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9094 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9095 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9096 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9097 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9098 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9099 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9100 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9101 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9102 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9103 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9104 |
addRow:#('a1' 'b1' 'c1' 'd1') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9105 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9106 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9107 |
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
|
9108 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9109 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9110 |
addRow:#('a2' 'b2' 'c2' 'd2') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9111 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9112 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9113 |
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
|
9114 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9115 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9116 |
addRow:#('a3' 'b3' 'c3' 'd3') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9117 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9118 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9119 |
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
|
9120 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9121 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9122 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9123 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9124 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9125 |
"Created: 31.5.1996 / 20:45:31 / cg" |
792 | 9126 |
"Modified: 17.7.1996 / 12:06:08 / cg" |
76 | 9127 |
! ! |
9128 |
||
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9129 |
!DialogBox methodsFor:'explicit focus control'! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9130 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9131 |
focusOnOk |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9132 |
windowGroup focusView:okButton |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9133 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9134 |
"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
|
9135 |
! ! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9136 |
|
76 | 9137 |
!DialogBox methodsFor:'initialization'! |
9138 |
||
9139 |
initialize |
|
9140 |
super initialize. |
|
9141 |
||
573 | 9142 |
"/ label := 'Dialog'. |
948 | 9143 |
acceptValue := ValueHolder newBoolean. |
76 | 9144 |
|
9145 |
acceptReturnAsOK := true. |
|
125 | 9146 |
acceptOnLeave := true. |
1757 | 9147 |
focusToOKOnLeave := DefaultFocusToOKOnLeave. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9148 |
hideOnAccept := true. |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9149 |
autoAccept := true. |
76 | 9150 |
|
9151 |
buttonPanel := HorizontalPanelView in:self. |
|
118 | 9152 |
buttonPanel |
1757 | 9153 |
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
|
9154 |
bottomInset:ViewSpacing; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9155 |
topInset:((font height + ViewSpacing) * 2) negated; |
1757 | 9156 |
borderWidth:0; |
9157 |
horizontalLayout:#spread. |
|
118 | 9158 |
|
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9159 |
"/ 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
|
9160 |
buttonPanel reverseOrderIfOKAtLeft:true. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9161 |
|
122 | 9162 |
yPosition := ViewSpacing. |
312
008267b920d9
allow more control over the indent when adding components
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
9163 |
leftIndent := rightIndent := (ViewSpacing // 2). |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9164 |
needResize := true. |
76 | 9165 |
|
9166 |
" |
|
9167 |
|b| |
|
9168 |
b := DialogBox new. |
|
118 | 9169 |
b addAbortButton; |
9170 |
addOkButton; |
|
9171 |
showAtPointer |
|
76 | 9172 |
" |
9173 |
" |
|
9174 |
|b| |
|
9175 |
b := DialogBox new. |
|
118 | 9176 |
b addOkButton; |
9177 |
showAtPointer |
|
9178 |
" |
|
76 | 9179 |
" |
118 | 9180 |
|b| |
9181 |
b := DialogBox new. |
|
9182 |
b addTextLabel:'hello world'; |
|
9183 |
addOkButton; |
|
9184 |
showAtPointer |
|
9185 |
" |
|
9186 |
" |
|
9187 |
|b| |
|
9188 |
b := DialogBox new. |
|
9189 |
b addTextLabel:'hello world'; |
|
9190 |
addVerticalSpace:50; |
|
9191 |
addOkButton; |
|
9192 |
showAtPointer |
|
9193 |
" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9194 |
|
1614 | 9195 |
"Modified: / 23.12.1997 / 10:05:24 / md" |
9196 |
"Modified: / 27.7.1998 / 20:16:37 / cg" |
|
76 | 9197 |
! |
9198 |
||
9199 |
reAdjustGeometry |
|
9200 |
"sent late in snapin processing - gives me a chance |
|
9201 |
to resize for changed font dimensions." |
|
9202 |
||
9203 |
super reAdjustGeometry. |
|
9204 |
okButton notNil ifTrue:[okButton resize]. |
|
9205 |
abortButton notNil ifTrue:[abortButton resize]. |
|
9206 |
self resize |
|
9207 |
! ! |
|
9208 |
||
197 | 9209 |
!DialogBox methodsFor:'private'! |
9210 |
||
9211 |
basicAddComponent:aComponent |
|
9212 |
"add a component, dont change its size" |
|
9213 |
||
9214 |
addedComponents isNil ifTrue:[ |
|
2126 | 9215 |
addedComponents := OrderedCollection new. |
197 | 9216 |
]. |
9217 |
addedComponents add:aComponent. |
|
9218 |
self addSubView:aComponent. |
|
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9219 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9220 |
needResize := true. |
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9221 |
"/ 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
|
9222 |
preferredExtent := nil. |
197 | 9223 |
! |
9224 |
||
9225 |
hideAndEvaluate:aBlock |
|
9226 |
"if I am modal, make myself invisible and evaluate aBlock. |
|
9227 |
If nonModal, stay up, but also evaluate the block." |
|
9228 |
||
9229 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9230 |
self hide. |
197 | 9231 |
]. |
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9232 |
aBlock notNil ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9233 |
aBlock numArgs == 0 ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9234 |
aBlock value |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9235 |
] ifFalse:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9236 |
aBlock value:(self actionArgument) |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9237 |
] |
2673
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9238 |
]. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9239 |
|
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9240 |
(windowGroup isNil or:[windowGroup isModal not]) ifTrue:[ |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9241 |
self destroy. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9242 |
]. |
197 | 9243 |
|
9244 |
"Modified: 5.9.1995 / 19:06:33 / claus" |
|
9245 |
! |
|
9246 |
||
2116 | 9247 |
preOpen |
9248 |
||
9249 |
"Created: / 4.2.2000 / 00:10:48 / cg" |
|
9250 |
! |
|
9251 |
||
197 | 9252 |
realize |
9253 |
"if any inputFields where added, activate the first one" |
|
9254 |
||
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9255 |
verticalPanel notNil ifTrue:[ |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9256 |
verticalPanel extent:verticalPanel preferredExtent. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9257 |
preferredExtent := nil. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9258 |
self extent:(self preferredExtent). |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9259 |
]. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9260 |
|
1877
a46bf520f9c6
realize first, then assign focus
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9261 |
super realize. |
3467 | 9262 |
|
9263 |
buttonPanel notNil ifTrue:[ |
|
9264 |
buttonPanel subViews do:[:eachButton | |
|
9265 |
eachButton canTab:true. |
|
9266 |
] |
|
9267 |
]. |
|
9268 |
||
197 | 9269 |
inputFieldGroup notNil ifTrue:[ |
1646 | 9270 |
inputFieldGroup activateFirstIfNoCurrent |
197 | 9271 |
]. |
1646 | 9272 |
|
9273 |
"Modified: / 13.8.1998 / 21:22:40 / cg" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9274 |
! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9275 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9276 |
resize |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9277 |
needResize ifTrue:[ |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9278 |
"/ verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9279 |
"/ verticalPanel extent:verticalPanel preferredExtent. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9280 |
"/ preferredExtent := nil. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9281 |
"/ self extent:(self preferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9282 |
"/ ]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9283 |
needResize := false. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9284 |
super resize |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9285 |
] |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9286 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9287 |
"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
|
9288 |
"Modified: 27.1.1996 / 18:25:40 / cg" |
197 | 9289 |
! ! |
9290 |
||
120 | 9291 |
!DialogBox methodsFor:'queries'! |
118 | 9292 |
|
121 | 9293 |
accepted |
128 | 9294 |
"after the box has closed: |
9295 |
return true if accepted, false if canceled" |
|
125 | 9296 |
|
128 | 9297 |
^ acceptValue value |
121 | 9298 |
! |
9299 |
||
2116 | 9300 |
interfaceSpecFor:aSelector |
9301 |
"return an interface spec. |
|
9302 |
Notice - Dialog should be moved under AppModel so this becomes obsolete." |
|
9303 |
||
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9304 |
^ UISpecification from:(self specificationFor:aSelector) |
2116 | 9305 |
! |
9306 |
||
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9307 |
maxPreferredWidthOfAddedComponents |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9308 |
"helper for computing my preferred extent. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9309 |
That is the max component width" |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9310 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9311 |
^ (addedComponents ? #()) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9312 |
inject:0 |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9313 |
into:[:max :element | |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9314 |
|eExt prefWidth scale rel relX| |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9315 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9316 |
prefWidth := element preferredWidth. |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9317 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9318 |
"/ special (for your convenience) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9319 |
"/ 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
|
9320 |
"/ 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
|
9321 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9322 |
(rel := element relativeExtent) notNil ifTrue:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9323 |
relX := rel x. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9324 |
(relX isNil or:[relX isInteger]) ifFalse:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9325 |
prefWidth := (prefWidth * (1 / relX)) rounded |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9326 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9327 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9328 |
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
|
9329 |
max max:(eExt + element leftInset + element rightInset)]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9330 |
! |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9331 |
|
120 | 9332 |
positionOffset |
9333 |
"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
|
9334 |
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
|
9335 |
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
|
9336 |
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
|
9337 |
use my superclasses offset." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9338 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9339 |
|idx butt buttons| |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9340 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9341 |
buttonPanel notNil ifTrue:[ |
2332 | 9342 |
buttons := buttonPanel subViews. |
9343 |
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
|
9344 |
idx := buttons findFirst:[:b | b isDefault]. |
2332 | 9345 |
idx ~~ 0 ifTrue:[ |
9346 |
butt := buttons at:idx. |
|
9347 |
||
9348 |
"get our size (preferredExtent) and compute |
|
9349 |
origin and extent of buttonPanel and okButton. |
|
9350 |
This is normally done on view realization." |
|
9351 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9352 |
needResize ifTrue:[ self resize ]. |
2332 | 9353 |
buttonPanel |
9354 |
pixelOrigin:buttonPanel computeOrigin |
|
9355 |
extent:buttonPanel computeExtent. |
|
9356 |
buttonPanel setChildPositionsIfChanged. |
|
2732
9a96cfc123c0
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
2718
diff
changeset
|
9357 |
^ (butt originRelativeTo:self) + (butt extent // 2). |
2332 | 9358 |
] |
9359 |
] |
|
118 | 9360 |
]. |
913 | 9361 |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9362 |
^ super positionOffset |
912
310c4970e613
Fix #positionOffset to show 'senders' box with cursor on ok-button.
Stefan Vogel <sv@exept.de>
parents:
884
diff
changeset
|
9363 |
|
913 | 9364 |
"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
|
9365 |
"Modified: 16.1.1997 / 22:00:23 / cg" |
118 | 9366 |
! |
9367 |
||
130 | 9368 |
preferredExtent |
132 | 9369 |
"return my preferred extent. |
9370 |
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
|
9371 |
whichever is larger, by the sum of the component's heights." |
118 | 9372 |
|
120 | 9373 |
|w h p| |
118 | 9374 |
|
3756
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9375 |
"/ If I have an explicit preferredExtent.. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9376 |
explicitExtent notNil ifTrue:[ |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9377 |
^ explicitExtent |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9378 |
]. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9379 |
|
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9380 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9381 |
preferredExtent notNil ifTrue:[ |
2801 | 9382 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9383 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9384 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9385 |
h := yPosition + ViewSpacing. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9386 |
verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9387 |
"/ 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
|
9388 |
"/ 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
|
9389 |
"/ do this now. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9390 |
verticalPanel extent:(verticalPanel computePreferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9391 |
h := h + verticalPanel height. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9392 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9393 |
|
120 | 9394 |
addedComponents notNil ifTrue:[ |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9395 |
w := self maxPreferredWidthOfAddedComponents. |
120 | 9396 |
] ifFalse:[ |
3618 | 9397 |
w := super preferredExtent x. |
120 | 9398 |
]. |
132 | 9399 |
w := w max:width. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9400 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9401 |
subViews size ~~ 0 ifTrue:[ |
2801 | 9402 |
p := buttonPanel preferredExtent. |
9403 |
w := w max:p x. |
|
9404 |
h := h |
|
9405 |
+ p y |
|
9406 |
+ ViewSpacing. |
|
120 | 9407 |
]. |
118 | 9408 |
|
120 | 9409 |
"/ okButton isNil ifTrue:[ |
130 | 9410 |
"/ ^ super preferredExtent |
120 | 9411 |
"/ ]. |
130 | 9412 |
"/ p := buttonPanel preferredExtent. |
120 | 9413 |
"/ w := p x. |
9414 |
"/ h := ViewSpacing |
|
9415 |
"/ + p y |
|
9416 |
"/ + ViewSpacing. |
|
9417 |
"/ |
|
9418 |
^ w @ h |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9419 |
|
797 | 9420 |
"Modified: 19.7.1996 / 20:43:52 / cg" |
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9421 |
! |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9422 |
|
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9423 |
specificationFor:aKey |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9424 |
"return an interface specs literal encoding. |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9425 |
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
|
9426 |
|
2568 | 9427 |
^ ApplicationModel |
9428 |
specificationFor:aKey |
|
9429 |
application:self |
|
9430 |
onDevice:(self graphicsDevice) |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9431 |
! ! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9432 |
|
197 | 9433 |
!DialogBox methodsFor:'user actions'! |
76 | 9434 |
|
197 | 9435 |
abortPressed |
9436 |
"sent by the cancel button; user pressed abort button |
|
9437 |
- hide myself and evaluate okAction" |
|
121 | 9438 |
|
197 | 9439 |
abortButton turnOffWithoutRedraw. |
9440 |
acceptValue value:false. |
|
121 | 9441 |
|
197 | 9442 |
"/ actually, only hides if I have been opened modal |
9443 |
self hideAndEvaluate:abortAction |
|
121 | 9444 |
! |
9445 |
||
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9446 |
actionArgument |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9447 |
^ nil |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9448 |
! |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9449 |
|
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9450 |
closeCancel |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9451 |
"closed via escape" |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9452 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9453 |
acceptValue value:false. |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9454 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9455 |
"/ actually, only hides if I have been opened modal |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9456 |
self hideAndEvaluate:abortAction |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9457 |
! |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9458 |
|
197 | 9459 |
doAccept |
9460 |
"let all components accept (i.e. update their model from the values), |
|
9461 |
then set my accept value to true. |
|
9462 |
This is confusing: this method was originally called #accept, |
|
9463 |
but renamed for compatibility with ST-80, where #accept returns the |
|
9464 |
accept-valueHolder (which looks like a bad name to me ...)." |
|
76 | 9465 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9466 |
autoAccept ifTrue:[ |
1401 | 9467 |
addedComponents notNil ifTrue:[ |
9468 |
addedComponents do:[:aComponent | |
|
9469 |
(aComponent respondsTo:#accept) ifTrue:[ |
|
9470 |
aComponent accept |
|
9471 |
] |
|
9472 |
] |
|
9473 |
]. |
|
197 | 9474 |
]. |
9475 |
acceptValue value:true. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9476 |
|
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9477 |
"Modified: 4.3.1996 / 12:14:56 / cg" |
128 | 9478 |
! |
9479 |
||
197 | 9480 |
keyPress:aKey x:x y:y |
2700 | 9481 |
"return-key duplicates ok-function if acceptReturnAsOK is true" |
76 | 9482 |
|
490 | 9483 |
<resource: #keyboard (#Return)> |
9484 |
||
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9485 |
|b| |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9486 |
|
3809 | 9487 |
"/ oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has |
9488 |
"/ no one to inform about RETURN/ESCAPE. So the procesing here is still needed. |
|
9489 |
||
3808
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9490 |
(aKey == #Return) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9491 |
(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
|
9492 |
^ self okPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9493 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9494 |
(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
|
9495 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9496 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9497 |
(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
|
9498 |
b turnOnWithAction. b turnOffWithAction. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9499 |
^ self. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9500 |
] |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9501 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9502 |
|
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9503 |
(aKey == #Escape) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9504 |
(abortButton notNil) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9505 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9506 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9507 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9508 |
|
197 | 9509 |
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
|
9510 |
|
490 | 9511 |
"Modified: 7.3.1996 / 13:15:09 / cg" |
76 | 9512 |
! |
9513 |
||
197 | 9514 |
lastFieldLeft |
9515 |
"if the dialog involves input fields, this is called |
|
9516 |
when the last field is left by Return-key or NextField-key" |
|
120 | 9517 |
|
197 | 9518 |
acceptOnLeave ifTrue:[ |
1401 | 9519 |
acceptReturnAsOK ifTrue:[ |
9520 |
focusToOKOnLeave ifTrue:[ |
|
9521 |
self focusOnOk. |
|
9522 |
^ self. |
|
9523 |
]. |
|
9524 |
self okPressed |
|
9525 |
] |
|
197 | 9526 |
]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9527 |
inputFieldGroup activateFirst |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
9528 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9529 |
"Modified: 19.4.1996 / 17:09:02 / cg" |
76 | 9530 |
! |
9531 |
||
197 | 9532 |
okPressed |
9533 |
"sent by the okButton; user pressed ok-button |
|
9534 |
- make myself invisible and if an action was specified do it" |
|
128 | 9535 |
|
197 | 9536 |
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
|
9537 |
|
197 | 9538 |
self doAccept. |
9539 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9540 |
acceptCheck notNil ifTrue:[ |
302 | 9541 |
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
|
9542 |
]. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9543 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9544 |
hideOnAccept ifTrue:[ |
302 | 9545 |
"/ actually, only hides if I have been opened modal |
9546 |
self hideAndEvaluate:okAction. |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9547 |
] ifFalse:[ |
302 | 9548 |
okAction value |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9549 |
] |
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9550 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9551 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9552 |
openDialog |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9553 |
self showAtPointer. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9554 |
^ self accepted |
128 | 9555 |
! ! |
240 | 9556 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
9557 |
!DialogBox class methodsFor:'documentation'! |
240 | 9558 |
|
9559 |
version |
|
4222
53a2a6433f59
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4220
diff
changeset
|
9560 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.311 2011-02-02 12:29:16 cg Exp $' |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9561 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9562 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9563 |
version_CVS |
4222
53a2a6433f59
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4220
diff
changeset
|
9564 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.311 2011-02-02 12:29:16 cg Exp $' |
240 | 9565 |
! ! |
2618 | 9566 |
|
498 | 9567 |
DialogBox initialize! |