author | Claus Gittinger <cg@exept.de> |
Tue, 08 Nov 2011 13:30:03 +0100 | |
changeset 4330 | 9207417a6965 |
parent 4329 | 242be44c97ef |
child 4331 | ee5133add66d |
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 |
|
4302 | 4360 |
^ self request:aString list:listOfChoices initialAnswer:'' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4361 |
|
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4362 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4363 |
Dialog |
2548 | 4364 |
request:'Enter a string:' |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4365 |
list:#('foo' 'bar' 'baz') |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4366 |
" |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4367 |
|
4302 | 4368 |
"Modified: / 18-08-2011 / 19:29:28 / cg" |
1705
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4369 |
! |
1a126505ac49
added a standard request dialog with a comboBox
Claus Gittinger <cg@exept.de>
parents:
1704
diff
changeset
|
4370 |
|
4301
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4371 |
request:aString list:listOfChoices initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4372 |
"launch a Dialog, which allows user to enter something, |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4373 |
but adds a list of choices for fast input. |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4374 |
Return the entered string (may be empty string) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4375 |
or the empty string (if cancel was pressed)" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4376 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4377 |
^ self |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4378 |
request:aString |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4379 |
displayAt:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4380 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4381 |
action:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4382 |
initialAnswer:initialAnswer |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4383 |
okLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4384 |
cancelLabel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4385 |
title:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4386 |
onCancel:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4387 |
list:listOfChoices |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4388 |
initialSelection:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4389 |
entryCompletionBlock:nil |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4390 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4391 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4392 |
Dialog |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4393 |
request:'Enter a string:' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4394 |
list:#('foo' 'bar' 'baz') |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4395 |
initialAnswer:'foe' |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4396 |
" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4397 |
|
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4398 |
"Modified: / 29-05-1996 / 14:26:25 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4399 |
"Created: / 18-08-2011 / 19:28:13 / cg" |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4400 |
! |
1b9559767efb
added: #request:list:initialAnswer:
Claus Gittinger <cg@exept.de>
parents:
4294
diff
changeset
|
4401 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4402 |
request:aString okLabel:okLabel |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4403 |
"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
|
4404 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4405 |
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
|
4406 |
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
|
4407 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4408 |
^ self |
2439 | 4409 |
request:aString |
4410 |
displayAt:nil |
|
4411 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4412 |
action:nil |
|
4413 |
initialAnswer:'' |
|
4414 |
okLabel:okLabel |
|
4415 |
cancelLabel:nil |
|
2444 | 4416 |
title:nil |
4417 |
onCancel:nil |
|
4418 |
list:nil |
|
4419 |
initialSelection:nil |
|
4420 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4421 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4422 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4423 |
Dialog |
2548 | 4424 |
request:'Enter a string:' |
4425 |
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
|
4426 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4427 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4428 |
"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
|
4429 |
"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
|
4430 |
! |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4431 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4432 |
request:aString okLabel:okLabel onCancel:cancelValue |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4433 |
"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
|
4434 |
The okButton is labelled as okLabel. |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4435 |
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
|
4436 |
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
|
4437 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4438 |
^ self |
2439 | 4439 |
request:aString |
4440 |
displayAt:nil |
|
4441 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4442 |
action:nil |
|
4443 |
initialAnswer:'' |
|
4444 |
okLabel:okLabel |
|
4445 |
cancelLabel:nil |
|
2444 | 4446 |
title:nil |
2439 | 4447 |
onCancel:cancelValue |
2444 | 4448 |
list:nil |
4449 |
initialSelection:nil |
|
4450 |
entryCompletionBlock:nil |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4451 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4452 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4453 |
Dialog |
2548 | 4454 |
request:'Enter a string:' |
4455 |
okLabel:'Yes' |
|
2439 | 4456 |
onCancel:nil |
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4457 |
" |
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4458 |
|
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4459 |
"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
|
4460 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4461 |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4462 |
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
|
4463 |
"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
|
4464 |
The okButton is labelled as okLabel. |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4465 |
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
|
4466 |
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
|
4467 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4468 |
^ self |
2439 | 4469 |
request:aString |
4470 |
displayAt:nil |
|
4471 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4472 |
action:nil |
|
4473 |
initialAnswer:'' |
|
4474 |
okLabel:okLabel |
|
4475 |
cancelLabel:nil |
|
4476 |
title:titleString |
|
4477 |
onCancel:cancelValue |
|
2444 | 4478 |
list:nil |
4479 |
initialSelection:nil |
|
4480 |
entryCompletionBlock:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4481 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4482 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4483 |
Dialog |
2548 | 4484 |
request:'Enter a String:' |
4485 |
okLabel:'Yes' |
|
2439 | 4486 |
title:'foo' |
4487 |
onCancel:nil |
|
718
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4488 |
" |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4489 |
|
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4490 |
"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
|
4491 |
"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
|
4492 |
! |
bd04131f84c8
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
717
diff
changeset
|
4493 |
|
2360 | 4494 |
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
|
4495 |
"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
|
4496 |
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
|
4497 |
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
|
4498 |
|
717
816259bd3408
more fill-in-the-blank standard entries
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
4499 |
^ self |
2360 | 4500 |
request:aString |
4501 |
displayAt:nil |
|
2439 | 4502 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
2360 | 4503 |
action:nil |
4504 |
initialAnswer:'' |
|
2444 | 4505 |
okLabel:nil |
4506 |
cancelLabel:nil |
|
4507 |
title:nil |
|
2360 | 4508 |
onCancel:cancelActionOrValue |
2444 | 4509 |
list:nil |
4510 |
initialSelection:nil |
|
4511 |
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
|
4512 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4513 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4514 |
Dialog |
2548 | 4515 |
request:'Enter a String:' |
2360 | 4516 |
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
|
4517 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4518 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4519 |
"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
|
4520 |
"Modified: 29.5.1996 / 14:28:59 / cg" |
100 | 4521 |
! |
4522 |
||
2718 | 4523 |
request:aString title:titleString initialAnswer:initial |
4524 |
"launch a Dialog, which allows user to enter something. |
|
4525 |
Return the entered string (may be empty string) or nil (if cancel was pressed)" |
|
4526 |
||
4527 |
^ self |
|
4528 |
request:aString |
|
4529 |
displayAt:nil |
|
4530 |
centered:(ForceModalBoxesToOpenAtCenter ? false) |
|
4531 |
action:nil |
|
4532 |
initialAnswer:initial |
|
4533 |
okLabel:nil |
|
4534 |
cancelLabel:nil |
|
4535 |
title:titleString |
|
4093 | 4536 |
onCancel:nil |
2718 | 4537 |
list:nil |
4538 |
initialSelection:nil |
|
4539 |
entryCompletionBlock:nil |
|
4540 |
||
4541 |
" |
|
4542 |
Dialog |
|
4543 |
request:'enter a string:' |
|
4544 |
initialAnswer:'the default' |
|
4545 |
" |
|
4546 |
||
4547 |
"Modified: 29.5.1996 / 14:30:05 / cg" |
|
4548 |
! |
|
4549 |
||
3152 | 4550 |
requestNumber:aString |
4551 |
"launch a Dialog, which allows user to enter a number. |
|
4552 |
Return the numeric value or nil |
|
4553 |
(for an invalid number or if cancel was pressed)" |
|
4554 |
||
4555 |
|string| |
|
4556 |
||
4557 |
string := self request:aString. |
|
4558 |
^ Number readFrom:string onError:nil. |
|
4559 |
||
4560 |
" |
|
4561 |
Dialog requestNumber:'Enter your Age:' |
|
4562 |
" |
|
4563 |
||
4564 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
4565 |
! |
|
4566 |
||
3321 | 4567 |
requestNumber:aString initialAnswer: aNumber |
4568 |
"launch a Dialog, which allows user to enter a number. |
|
4569 |
Return the numeric value or nil |
|
4570 |
(for an invalid number or if cancel was pressed)" |
|
4571 |
||
4572 |
|string| |
|
4573 |
||
4574 |
string := self request:aString initialAnswer: aNumber. |
|
4575 |
^ Number readFrom:string onError:nil. |
|
4576 |
||
4577 |
" |
|
4578 |
Dialog requestNumber:'Enter your Age:' initialAnswer: 25 |
|
4579 |
" |
|
4580 |
||
4581 |
"Created: / 26-07-2006 / 12:22:23 / fm" |
|
4582 |
"Modified: / 07-08-2006 / 15:31:30 / fm" |
|
4583 |
! |
|
4584 |
||
197 | 4585 |
requestPassword:aString |
4586 |
"launch a Dialog, which allows user to enter something invisibly. |
|
4587 |
Return the entered string (may be empty string) |
|
4588 |
or nil (if cancel was pressed)" |
|
100 | 4589 |
|
197 | 4590 |
^ EnterBox requestPassword:aString |
133 | 4591 |
|
4592 |
" |
|
4593 |
Dialog |
|
2548 | 4594 |
requestPassword:'Enter Secret:' |
133 | 4595 |
" |
197 | 4596 |
|
4597 |
"Created: 17.11.1995 / 09:45:21 / cg" |
|
2014 | 4598 |
! |
4599 |
||
4139 | 4600 |
requestText:title |
4601 |
"open a dialog asking for multiline text. |
|
4602 |
Return a stringCollection or nil if cancelled." |
|
4603 |
||
4604 |
^ self |
|
4605 |
requestText:title lines:10 columns:40 initialAnswer:'' |
|
4606 |
||
4607 |
" |
|
4608 |
Dialog requestText:'Bla' |
|
4609 |
" |
|
4610 |
! |
|
4611 |
||
4612 |
requestText:title initialAnswer:initialAnswer |
|
4613 |
"open a dialog asking for multiline text. |
|
4614 |
Return a stringCollection or nil if cancelled." |
|
4615 |
||
4616 |
^ self |
|
4617 |
requestText:title lines:10 columns:40 initialAnswer:initialAnswer |
|
4618 |
||
4619 |
" |
|
4620 |
Dialog requestText:'Bla' initialAnswer:'Hello world' |
|
4621 |
" |
|
4622 |
! |
|
4623 |
||
2014 | 4624 |
requestText:title lines:numLines columns:numCols initialAnswer:initialText |
4625 |
"open a dialog asking for multiline text. |
|
4626 |
Return a stringCollection or nil if cancelled." |
|
4627 |
||
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4628 |
|dialog textHolder| |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4629 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4630 |
textHolder := ValueHolder new. |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
4631 |
dialog := Dialog forRequestText:title lines:numLines columns:numCols initialAnswer:initialText model:textHolder. |
2014 | 4632 |
dialog open. |
4633 |
dialog accepted ifTrue:[ |
|
2675 | 4634 |
^ textHolder value |
2014 | 4635 |
]. |
4636 |
^ nil |
|
4637 |
||
2675 | 4638 |
" |
4639 |
Dialog requestText:'Bla' lines:8 columns:40 initialAnswer:'hello world' |
|
4640 |
" |
|
4641 |
||
4642 |
"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
|
4643 |
! ! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4644 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
4645 |
!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
|
4646 |
|
3234 | 4647 |
choose:aString fromList:list lines:maxLines |
4648 |
"launch a Dialog showing the message and list. |
|
4649 |
The user can select an item and click ok; in this case, the corresponding value |
|
4650 |
from listValues is returned (doubleclick works as well). |
|
4651 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4652 |
Pressing ok without a selection is treated like cancel." |
|
4653 |
||
4654 |
^ self |
|
4655 |
choose:aString |
|
3455 | 4656 |
fromList:(list collect:[:each| each printString]) values:list |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4657 |
initialSelection:nil |
3455 | 4658 |
buttons:nil values:nil |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4659 |
default:nil |
3234 | 4660 |
lines:maxLines |
4661 |
cancel:nil |
|
4662 |
multiple:false |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4663 |
title:nil |
3234 | 4664 |
postBuildBlock:nil |
4665 |
||
4666 |
" |
|
4667 |
Transcript showCR:( |
|
4668 |
Dialog |
|
4669 |
choose:'choose any' |
|
4670 |
fromList:#(1 2 3 4 5 6 7) |
|
4671 |
lines:4 |
|
4672 |
) |
|
4673 |
" |
|
4674 |
||
3455 | 4675 |
"Modified: / 02-03-2007 / 12:08:31 / cg" |
3234 | 4676 |
! |
4677 |
||
3307 | 4678 |
choose:aString fromList:list lines:maxLines initialSelection:initialSelection |
4679 |
"launch a Dialog showing the message and list. |
|
4680 |
The user can select an item and click ok; in this case, the corresponding value |
|
4681 |
from listValues is returned (doubleclick works as well). |
|
4682 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4683 |
Pressing ok without a selection is treated like cancel." |
|
4684 |
||
4685 |
^ self |
|
4686 |
choose:aString |
|
4687 |
fromList:list values:list initialSelection:initialSelection |
|
4688 |
buttons:nil values:nil |
|
4689 |
lines:maxLines |
|
4690 |
cancel:nil |
|
4691 |
multiple:false |
|
4692 |
postBuildBlock:nil |
|
4693 |
||
4694 |
" |
|
4695 |
Transcript showCR:( |
|
4696 |
Dialog |
|
4697 |
choose:'choose any' |
|
4698 |
fromList:#(1 2 3 4 5 6 7) |
|
4699 |
lines:4 |
|
4700 |
initialSelection:4 |
|
4701 |
) |
|
4702 |
" |
|
4703 |
||
4704 |
"Modified: 27.1.1996 / 14:17:07 / cg" |
|
4705 |
! |
|
4706 |
||
3455 | 4707 |
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
|
4708 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4709 |
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
|
4710 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4711 |
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
|
4712 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4713 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4714 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4715 |
choose:aString |
3455 | 4716 |
fromList:(list collect:[:each| each printString]) values:list |
4717 |
initialSelection:initialSelection |
|
4718 |
buttons:nil values:nil |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4719 |
default:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4720 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4721 |
cancel:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4722 |
multiple:false |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4723 |
title:windowTitle |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4724 |
postBuildBlock:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4725 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4726 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4727 |
Transcript showCR:( |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4728 |
Dialog |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4729 |
choose:'choose any' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4730 |
fromList:#(1 2 3 4 5 6 7) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4731 |
lines:4 |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4732 |
title:'Choose' |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4733 |
) |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4734 |
" |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4735 |
|
3455 | 4736 |
"Created: / 02-03-2007 / 12:06:39 / cg" |
4737 |
! |
|
4738 |
||
4739 |
choose:aString fromList:list lines:maxLines title:windowTitle |
|
4740 |
"launch a Dialog showing the message and list. |
|
4741 |
The user can select an item and click ok; in this case, the corresponding value |
|
4742 |
from listValues is returned (doubleclick works as well). |
|
4743 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4744 |
Pressing ok without a selection is treated like cancel." |
|
4745 |
||
4746 |
^ self |
|
4747 |
choose:aString |
|
4748 |
fromList:(list collect:[:each| each printString]) values:list |
|
4749 |
initialSelection:nil |
|
4750 |
buttons:nil values:nil |
|
4751 |
default:nil |
|
4752 |
lines:maxLines |
|
4753 |
cancel:nil |
|
4754 |
multiple:false |
|
4755 |
title:windowTitle |
|
4756 |
postBuildBlock:nil |
|
4757 |
||
4758 |
" |
|
4759 |
Transcript showCR:( |
|
4760 |
Dialog |
|
4761 |
choose:'choose any' |
|
4762 |
fromList:#(1 2 3 4 5 6 7) |
|
4763 |
lines:4 |
|
4764 |
title:'Choose' |
|
4765 |
) |
|
4766 |
" |
|
4767 |
||
4768 |
"Modified: / 02-03-2007 / 12:08:20 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4769 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4770 |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
4771 |
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
|
4772 |
"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
|
4773 |
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
|
4774 |
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
|
4775 |
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
|
4776 |
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
|
4777 |
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
|
4778 |
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
|
4779 |
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
|
4780 |
|
2111 | 4781 |
^ self |
4782 |
choose:aString |
|
3455 | 4783 |
fromList:list values:listValues |
4784 |
buttons:buttonLabels values:buttonValues |
|
2111 | 4785 |
lines:maxLines |
4786 |
cancel:cancelBlock |
|
4787 |
multiple:false |
|
4788 |
||
4789 |
" |
|
4790 |
full example: |
|
4791 |
||
4792 |
Transcript showCR:( |
|
4793 |
Dialog |
|
4794 |
choose:'choose any' |
|
4795 |
fromList:#('one' 'two' 'three' 'four') |
|
4796 |
values:#(1 2 3 4) |
|
4797 |
buttons:#('five' 'six' 'seven') |
|
4798 |
values:#(5 6 7) |
|
4799 |
lines:10 |
|
4800 |
cancel:nil |
|
4801 |
) |
|
4802 |
||
4803 |
||
4804 |
no buttons: |
|
4805 |
||
4806 |
Transcript showCR:( |
|
4807 |
Dialog |
|
4808 |
choose:'choose any' |
|
4809 |
fromList:#('one' 'two' 'three' 'four') |
|
4810 |
values:#(1 2 3 4) |
|
4811 |
buttons:nil |
|
4812 |
values:nil |
|
4813 |
lines:4 |
|
4814 |
cancel:nil |
|
4815 |
) |
|
4816 |
||
4817 |
||
4818 |
no list (lines argument is ignored): |
|
4819 |
||
4820 |
Transcript showCR:( |
|
4821 |
Dialog |
|
4822 |
choose:'choose any' |
|
4823 |
fromList:nil |
|
4824 |
values:nil |
|
4825 |
buttons:#('one' 'two' 'three' 'four') |
|
4826 |
values:#(1 2 3 4) |
|
4827 |
lines:nil |
|
4828 |
cancel:nil |
|
4829 |
) |
|
4830 |
||
4831 |
||
4832 |
full including cancel value: |
|
4833 |
||
4834 |
Transcript showCR:( |
|
4835 |
Dialog |
|
4836 |
choose:'choose example' |
|
4837 |
fromList:#('one' 'two' 'three' 'four') |
|
4838 |
values:#(1 2 3 4) |
|
4839 |
buttons:#('five' 'six' 'seven') |
|
4840 |
values:#(5 6 7) |
|
4841 |
lines:4 |
|
4842 |
cancel:[Transcript flash. #aborted] |
|
4843 |
) |
|
4844 |
||
4845 |
||
4846 |
degenerated: |
|
4847 |
||
4848 |
Transcript showCR:( |
|
4849 |
Dialog |
|
4850 |
choose:'choose any' |
|
4851 |
fromList:nil |
|
4852 |
values:nil |
|
4853 |
buttons:nil |
|
4854 |
values:nil |
|
4855 |
lines:nil |
|
4856 |
cancel:nil |
|
4857 |
) |
|
4858 |
||
4859 |
||
4860 |
" |
|
4861 |
||
3455 | 4862 |
"Modified: / 02-03-2007 / 12:08:12 / cg" |
2111 | 4863 |
! |
4864 |
||
4865 |
choose:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple |
|
4866 |
"launch a Dialog showing the message and list. |
|
4867 |
The user can select an item and click ok; in this case, the corresponding value |
|
4868 |
from listValues is returned (doubleclick works as well). |
|
4869 |
The list may be suppressed (if the list arg is nil). |
|
4870 |
If a list is present, multiple controls if multiple selections are allowed. |
|
4871 |
Below the list, an optional row of buttons is shown, which can also be |
|
4872 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
4873 |
If cancel is pressed, the value of cancelBlock is returned. |
|
4874 |
Pressing ok without a selection is treated like cancel." |
|
4875 |
||
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4876 |
^ self |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4877 |
choose:aString |
3455 | 4878 |
fromList:list values:listValues |
4879 |
buttons:buttonLabels values:buttonValues |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4880 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4881 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4882 |
multiple:multiple |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4883 |
postBuildBlock:nil |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4884 |
|
3455 | 4885 |
"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
|
4886 |
! |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4887 |
|
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4888 |
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
|
4889 |
"launch a Dialog showing the message and list. |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4890 |
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
|
4891 |
from listValues is returned (doubleclick works as well). |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
4892 |
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
|
4893 |
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
|
4894 |
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
|
4895 |
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
|
4896 |
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
|
4897 |
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
|
4898 |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4899 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4900 |
choose:aString |
3455 | 4901 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4902 |
initialSelection:nil |
3455 | 4903 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4904 |
default:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4905 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4906 |
cancel:cancelBlock |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4907 |
multiple:multiple |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
4908 |
title:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4909 |
postBuildBlock:aBlockOrNil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4910 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4911 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4912 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4913 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4914 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4915 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4916 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4917 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4918 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4919 |
buttons:#('five' 'six' 'seven') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4920 |
values:#(5 6 7) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4921 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4922 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4923 |
multiple:true |
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 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4926 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4927 |
no buttons: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4928 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4929 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4930 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4931 |
choose:'choose any' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4932 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4933 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4934 |
buttons:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4935 |
values:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4936 |
lines:4 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4937 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4938 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4939 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4940 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4941 |
|
3455 | 4942 |
"Modified: / 02-03-2007 / 12:08:02 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4943 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
4944 |
|
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4945 |
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
|
4946 |
"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
|
4947 |
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
|
4948 |
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
|
4949 |
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
|
4950 |
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
|
4951 |
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
|
4952 |
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
|
4953 |
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
|
4954 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4955 |
^ self |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4956 |
choose:aString |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4957 |
fromList:list values:listValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4958 |
buttons:buttonLabels values:buttonValues |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4959 |
lines:maxLines |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4960 |
cancel:cancelBlock |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4961 |
multiple:false |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4962 |
postBuildBlock:postBuildBlock. |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4963 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4964 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4965 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4966 |
full example: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4967 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4968 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4969 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4970 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4971 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4972 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4973 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4974 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4975 |
lines:10 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4976 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4977 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4978 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4979 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4980 |
no buttons: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4981 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4982 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4983 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4984 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4985 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4986 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4987 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4988 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4989 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4990 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4991 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4992 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4993 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4994 |
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
|
4995 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4996 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4997 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4998 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
4999 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5000 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5001 |
buttons:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5002 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5003 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5004 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5005 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5006 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5007 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5008 |
full including cancel value: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5009 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5010 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5011 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5012 |
choose:'choose example' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5013 |
fromList:#('one' 'two' 'three' 'four') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5014 |
values:#(1 2 3 4) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5015 |
buttons:#('five' 'six' 'seven') |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5016 |
values:#(5 6 7) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5017 |
lines:4 |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5018 |
cancel:[Transcript flash. #aborted] |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5019 |
) |
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 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5022 |
degenerated: |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5023 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5024 |
Transcript showCR:( |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5025 |
Dialog |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5026 |
choose:'choose any' |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5027 |
fromList:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5028 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5029 |
buttons:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5030 |
values:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5031 |
lines:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5032 |
cancel:nil |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5033 |
) |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5034 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5035 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5036 |
" |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5037 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5038 |
"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
|
5039 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5040 |
|
3340 | 5041 |
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
|
5042 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5043 |
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
|
5044 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5045 |
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
|
5046 |
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
|
5047 |
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
|
5048 |
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
|
5049 |
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
|
5050 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5051 |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5052 |
^ self |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5053 |
choose:aString |
3455 | 5054 |
fromList:list values:listValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5055 |
initialSelection:initialListSelectionOrNil |
3455 | 5056 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5057 |
default:defaultValue |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5058 |
lines:maxLines |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5059 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5060 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5061 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5062 |
postBuildBlock:aBlockOrNil |
3455 | 5063 |
|
5064 |
"Modified: / 02-03-2007 / 12:07:57 / cg" |
|
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5065 |
! |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5066 |
|
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5067 |
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
|
5068 |
"launch a Dialog showing the message and list. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5069 |
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
|
5070 |
from listValues is returned (doubleclick works as well). |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5071 |
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
|
5072 |
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
|
5073 |
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
|
5074 |
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
|
5075 |
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
|
5076 |
Pressing ok without a selection is treated like cancel." |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5077 |
|
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5078 |
^ self |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5079 |
choose:aString |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5080 |
fromList:list values:listValues |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5081 |
initialSelection:initialListSelectionOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5082 |
buttons:buttonLabels values:buttonValues |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5083 |
default:defaultValue |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5084 |
lines:maxLines width:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5085 |
cancel:cancelBlock |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5086 |
multiple:multiple |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5087 |
title:windowTitle |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5088 |
postBuildBlock:aBlockOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5089 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5090 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5091 |
full example: |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5092 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5093 |
Transcript showCR:( |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5094 |
Dialog |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5095 |
choose:'choose any' |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5096 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5097 |
initialSelection: nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5098 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5099 |
default:6 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5100 |
lines:10 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5101 |
cancel:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5102 |
multiple:true |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5103 |
postBuildBlock:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5104 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5105 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5106 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5107 |
no buttons: |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5108 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5109 |
Transcript showCR:( |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5110 |
Dialog |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5111 |
choose:'choose any' |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5112 |
fromList:#('one' 'two' 'three' 'four') |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5113 |
values:#(1 2 3 4) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5114 |
buttons:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5115 |
values:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5116 |
lines:4 |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5117 |
cancel:nil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5118 |
multiple:true |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5119 |
) |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5120 |
" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5121 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5122 |
"Created: / 22-08-2006 / 16:10:19 / cg" |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5123 |
! |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5124 |
|
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5125 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues default:defaultValue lines:maxLines width:boxWidthOrNil cancel:cancelBlock multiple:multiple title:windowTitle postBuildBlock:aBlockOrNil |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5126 |
"launch a Dialog showing the message and list. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5127 |
The user can select an item and click ok; in this case, the corresponding value |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5128 |
from listValues is returned (doubleclick works as well). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5129 |
The list may be suppressed (if the list arg is nil). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5130 |
If a list is present, multiple controls if multiple selections are allowed. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5131 |
Below the list, an optional row of buttons is shown, which can also be |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5132 |
clicked upon, and a corresponding value from buttonValues is returned. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5133 |
If cancel is pressed, the value of cancelBlock is returned. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5134 |
Pressing ok without a selection is treated like cancel." |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5135 |
|
3469 | 5136 |
|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
|
5137 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5138 |
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
|
5139 |
(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
|
5140 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5141 |
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
|
5142 |
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
|
5143 |
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
|
5144 |
"/ 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
|
5145 |
"/ 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
|
5146 |
"/ ] ifFalse:[ |
4b259f245421
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4132
diff
changeset
|
5147 |
"/ 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
|
5148 |
"/ 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
|
5149 |
"/ ]. |
2111 | 5150 |
listView list:list. |
2116 | 5151 |
listView doubleClickAction:[:selectionIndex | |
2111 | 5152 |
|val| |
5153 |
||
2116 | 5154 |
multiple ifTrue:[ |
5155 |
val := selectionIndex collect:[:idx | listValues at:idx]. |
|
5156 |
] ifFalse:[ |
|
5157 |
val := listValues at:selectionIndex. |
|
5158 |
]. |
|
2111 | 5159 |
box destroy. |
5160 |
^ val |
|
5161 |
]. |
|
5162 |
listView multipleSelectOk:multiple. |
|
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5163 |
initialListSelectionOrNil notNil ifTrue:[ |
3005 | 5164 |
multiple ifTrue:[ |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5165 |
listView selection:(initialListSelectionOrNil collect:[:each| listValues indexOf:each]) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5166 |
] ifFalse:[ |
3005 | 5167 |
listView selection:(listValues indexOf:initialListSelectionOrNil) |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5168 |
] |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5169 |
]. |
2111 | 5170 |
box addComponent:listView indent:(ViewSpacing // 2) withHeight:(listView heightForLines:maxLines). |
5171 |
box makeTabable:listView. |
|
3340 | 5172 |
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
|
5173 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5174 |
|
2112 | 5175 |
buttonLabels size > 0 ifTrue:[ |
2111 | 5176 |
panel := HorizontalPanelView new. |
5177 |
panel horizontalLayout:#fitSpace. |
|
3340 | 5178 |
haveDefault := false. |
2111 | 5179 |
buttonLabels keysAndValuesDo:[:index :label | |
5180 |
|b| |
|
5181 |
||
5182 |
b := Button label:label. |
|
5183 |
b action:[ |
|
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5184 |
|val selectionValues| |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5185 |
|
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5186 |
selectionValues := listValues isNil |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5187 |
ifTrue:[ listView selection ] |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5188 |
ifFalse:[ listView selection collect:[:idx | listValues at:idx]]. |
2111 | 5189 |
val := buttonValues at:index. |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5190 |
val isBlock ifTrue:[ |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5191 |
val := val valueWithOptionalArgument:selectionValues and:box |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5192 |
] ifFalse:[ |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5193 |
multiple ifTrue:[ |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5194 |
val := Array with:val |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5195 |
]. |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5196 |
]. |
2111 | 5197 |
box destroy. |
5198 |
^ val |
|
5199 |
]. |
|
3340 | 5200 |
haveDefault ifFalse:[ |
5201 |
defaultValue notNil ifTrue:[ |
|
5202 |
(buttonValues at:index) = defaultValue ifTrue:[ |
|
5203 |
b isReturnButton:true. |
|
5204 |
haveDefault := true. |
|
5205 |
]. |
|
5206 |
]. |
|
5207 |
]. |
|
2111 | 5208 |
panel add:b. |
5209 |
box makeTabable:b. |
|
5210 |
]. |
|
5211 |
box addComponent:panel indent:0. "/ panel has its own idea of indenting |
|
3340 | 5212 |
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
|
5213 |
]. |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5214 |
box addAbortButton. |
3340 | 5215 |
list notNil ifTrue:[ |
5216 |
haveDefault ifTrue:[ |
|
5217 |
(box addOkButton) isReturnButton:false. |
|
5218 |
] ifFalse:[ |
|
5219 |
box addOkButton. |
|
5220 |
]. |
|
5221 |
]. |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5222 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
5223 |
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
|
5224 |
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
|
5225 |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5226 |
aBlockOrNil notNil ifTrue:[ |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5227 |
aBlockOrNil value:box |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5228 |
]. |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5229 |
windowTitle notNil ifTrue:[ |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5230 |
box label:windowTitle. |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5231 |
]. |
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5232 |
boxWidthOrNil notNil ifTrue:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5233 |
box width:(boxWidthOrNil max:250). |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5234 |
] ifFalse:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5235 |
box width < 250 ifTrue:[ |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5236 |
box width:250. |
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5237 |
] |
4104
279210ad5459
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4093
diff
changeset
|
5238 |
]. |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
5239 |
|
2439 | 5240 |
self showBox:box. |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5241 |
"/ notice: if one of the extra buttons is pressed, we do not arrive here, and the returned value |
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
5242 |
"/ is the value returned by the button-value (which might be a block) |
2111 | 5243 |
|
307
d3fe810390cb
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 |
box accepted ifTrue:[ |
2111 | 5245 |
(sel := listView selection) notNil ifTrue:[ |
5246 |
box destroy. |
|
5247 |
sel isInteger ifTrue:[ |
|
5248 |
^ listValues at:sel |
|
3340 | 5249 |
]. |
5250 |
^ sel collect:[:idx | listValues at:idx] |
|
5251 |
]. |
|
5252 |
box destroy. |
|
3536
76d3579362e4
choose:fromList.... returned true if OK was pressed without
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
5253 |
^ 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
|
5254 |
]. |
2111 | 5255 |
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
|
5256 |
^ cancelBlock value |
197 | 5257 |
|
5258 |
" |
|
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5259 |
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
|
5260 |
|
2111 | 5261 |
Transcript showCR:( |
5262 |
Dialog |
|
5263 |
choose:'choose any' |
|
3340 | 5264 |
fromList:#('one' 'two' 'three' 'four') values:#(1 2 3 4) |
5265 |
initialSelection: nil |
|
5266 |
buttons:#('five' 'six' 'seven') values:#(5 6 7) |
|
5267 |
default:6 |
|
2111 | 5268 |
lines:10 |
5269 |
cancel:nil |
|
5270 |
multiple:true |
|
3340 | 5271 |
postBuildBlock:nil |
2111 | 5272 |
) |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5273 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5274 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5275 |
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
|
5276 |
|
2111 | 5277 |
Transcript showCR:( |
5278 |
Dialog |
|
5279 |
choose:'choose any' |
|
5280 |
fromList:#('one' 'two' 'three' 'four') |
|
5281 |
values:#(1 2 3 4) |
|
5282 |
buttons:nil |
|
5283 |
values:nil |
|
5284 |
lines:4 |
|
5285 |
cancel:nil |
|
5286 |
multiple:true |
|
5287 |
) |
|
133 | 5288 |
" |
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5289 |
|
4329
242be44c97ef
added: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4307
diff
changeset
|
5290 |
"Created: / 08-11-2011 / 12:15:20 / cg" |
3340 | 5291 |
! |
5292 |
||
5293 |
choose:aString fromList:list values:listValues initialSelection:initialListSelectionOrNil buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock multiple:multiple postBuildBlock:aBlockOrNil |
|
5294 |
"launch a Dialog showing the message and list. |
|
5295 |
The user can select an item and click ok; in this case, the corresponding value |
|
5296 |
from listValues is returned (doubleclick works as well). |
|
5297 |
The list may be suppressed (if the list arg is nil). |
|
5298 |
If a list is present, multiple controls if multiple selections are allowed. |
|
5299 |
Below the list, an optional row of buttons is shown, which can also be |
|
5300 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5301 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5302 |
Pressing ok without a selection is treated like cancel." |
|
5303 |
||
5304 |
^ self |
|
5305 |
choose:aString |
|
3455 | 5306 |
fromList:list values:listValues |
3340 | 5307 |
initialSelection:initialListSelectionOrNil |
3455 | 5308 |
buttons:buttonLabels values:buttonValues |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5309 |
default:nil |
3340 | 5310 |
lines:maxLines |
3393
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5311 |
cancel:cancelBlock |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5312 |
multiple:multiple |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5313 |
title:nil |
280482ccaab8
choose... got a title argument.
Claus Gittinger <cg@exept.de>
parents:
3384
diff
changeset
|
5314 |
postBuildBlock:aBlockOrNil |
3340 | 5315 |
|
3455 | 5316 |
"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
|
5317 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5318 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5319 |
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
|
5320 |
"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
|
5321 |
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
|
5322 |
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
|
5323 |
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
|
5324 |
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
|
5325 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5326 |
^ self |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5327 |
choose:aString |
3455 | 5328 |
fromList:list values:listValues |
5329 |
buttons:nil values:nil |
|
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5330 |
lines:maxLines |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5331 |
cancel:cancelBlock |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5332 |
multiple:false |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5333 |
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
|
5334 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5335 |
" |
655 | 5336 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5337 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5338 |
choose:'choose any' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5339 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5340 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5341 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5342 |
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
|
5343 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5344 |
|
655 | 5345 |
Transcript showCR:( |
2183
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5346 |
Dialog |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5347 |
choose:'choose example' |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5348 |
fromList:#('one' 'two' 'three' 'four') |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5349 |
values:#(1 2 3 4) |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5350 |
lines:4 |
209de080ee24
postBuild callBack added to choose:fromList:...
Claus Gittinger <cg@exept.de>
parents:
2147
diff
changeset
|
5351 |
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
|
5352 |
) |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5353 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5354 |
|
3455 | 5355 |
"Modified: / 02-03-2007 / 12:07:42 / cg" |
5356 |
! |
|
5357 |
||
3630 | 5358 |
choose:aString fromList:list values:values lines:maxLines cancel:cancelBlock title:windowTitle |
5359 |
"launch a Dialog showing the message and list. |
|
5360 |
The user can select an item and click ok; in this case, the corresponding value |
|
5361 |
from listValues is returned (doubleclick works as well). |
|
5362 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5363 |
Pressing ok without a selection is treated like cancel." |
|
5364 |
||
5365 |
^ self |
|
5366 |
choose:aString |
|
5367 |
fromList:list values:values |
|
5368 |
initialSelection:nil |
|
5369 |
buttons:nil values:nil |
|
5370 |
default:nil |
|
5371 |
lines:maxLines |
|
5372 |
cancel:cancelBlock |
|
5373 |
multiple:false |
|
5374 |
title:windowTitle |
|
5375 |
postBuildBlock:nil |
|
5376 |
||
5377 |
" |
|
5378 |
Transcript showCR:( |
|
5379 |
Dialog |
|
5380 |
choose:'choose any' |
|
5381 |
fromList:#(1 2 3 4 5 6 7) |
|
5382 |
lines:4 |
|
5383 |
title:'Choose' |
|
5384 |
) |
|
5385 |
" |
|
5386 |
||
5387 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5388 |
! |
|
5389 |
||
3455 | 5390 |
choose:aString fromList:list values:values lines:maxLines initialSelection:initialSelection title:windowTitle |
5391 |
"launch a Dialog showing the message and list. |
|
5392 |
The user can select an item and click ok; in this case, the corresponding value |
|
5393 |
from listValues is returned (doubleclick works as well). |
|
5394 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5395 |
Pressing ok without a selection is treated like cancel." |
|
5396 |
||
5397 |
^ self |
|
5398 |
choose:aString |
|
5399 |
fromList:list values:values |
|
5400 |
initialSelection:initialSelection |
|
5401 |
buttons:nil values:nil |
|
5402 |
default:nil |
|
5403 |
lines:maxLines |
|
5404 |
cancel:nil |
|
5405 |
multiple:false |
|
5406 |
title:windowTitle |
|
5407 |
postBuildBlock:nil |
|
5408 |
||
5409 |
" |
|
5410 |
Transcript showCR:( |
|
5411 |
Dialog |
|
5412 |
choose:'choose any' |
|
5413 |
fromList:#(1 2 3 4 5 6 7) |
|
5414 |
lines:4 |
|
5415 |
title:'Choose' |
|
5416 |
) |
|
5417 |
" |
|
5418 |
||
5419 |
"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
|
5420 |
! |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5421 |
|
3630 | 5422 |
choose:aString fromList:list values:values lines:maxLines title:windowTitle |
5423 |
"launch a Dialog showing the message and list. |
|
5424 |
The user can select an item and click ok; in this case, the corresponding value |
|
5425 |
from listValues is returned (doubleclick works as well). |
|
5426 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5427 |
Pressing ok without a selection is treated like cancel." |
|
5428 |
||
5429 |
^ self |
|
5430 |
choose:aString |
|
5431 |
fromList:list values:values |
|
5432 |
initialSelection:nil |
|
5433 |
buttons:nil values:nil |
|
5434 |
default:nil |
|
5435 |
lines:maxLines |
|
5436 |
cancel:nil |
|
5437 |
multiple:false |
|
5438 |
title:windowTitle |
|
5439 |
postBuildBlock:nil |
|
5440 |
||
5441 |
" |
|
5442 |
Transcript showCR:( |
|
5443 |
Dialog |
|
5444 |
choose:'choose any' |
|
5445 |
fromList:#(1 2 3 4 5 6 7) |
|
5446 |
lines:4 |
|
5447 |
title:'Choose' |
|
5448 |
) |
|
5449 |
" |
|
5450 |
||
5451 |
"Created: / 02-03-2007 / 12:07:32 / cg" |
|
5452 |
! |
|
5453 |
||
2473 | 5454 |
choose:aString label:windowLabel image:imageOrNil labels:buttonLabels values:values default:default onCancel:cancelValue |
2472 | 5455 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
5456 |
Returning a corresponding value from the values-array. |
|
5457 |
The default entries button is marked as a return button and entering |
|
5458 |
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
|
5459 |
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
|
5460 |
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
|
5461 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5462 |
|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
|
5463 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5464 |
box := OptionBox title:aString numberOfOptions:buttonLabels size. |
803 | 5465 |
windowLabel notNil ifTrue:[ |
2439 | 5466 |
box label:windowLabel |
803 | 5467 |
]. |
2473 | 5468 |
imageOrNil notNil ifTrue:[ |
5469 |
box image:imageOrNil |
|
5470 |
]. |
|
5471 |
||
307
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5472 |
box buttonTitles:(self classResources array:buttonLabels) |
2439 | 5473 |
actions:(values collect:[:val | [answer := val]]). |
2472 | 5474 |
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
|
5475 |
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
|
5476 |
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
|
5477 |
idx ~~ 0 ifTrue:[box defaultButtonIndex:idx]. |
2439 | 5478 |
|
5479 |
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
|
5480 |
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
|
5481 |
^ 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
|
5482 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5483 |
"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
|
5484 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5485 |
Dialog |
2439 | 5486 |
choose:'choose any' |
2472 | 5487 |
label:'Foo Bar Baz' |
2439 | 5488 |
labels:#('one' 'two' 'three' 'four') |
5489 |
values:#(1 2 3 4) |
|
2472 | 5490 |
default:2 |
5491 |
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
|
5492 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5493 |
Dialog |
2439 | 5494 |
choose:'choose any' |
5495 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5496 |
values:#(nil foo bar baz) |
|
5497 |
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
|
5498 |
|
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5499 |
Dialog |
2439 | 5500 |
choose:'choose any' |
5501 |
labels:#('one' 'two' 'three' 'four') |
|
5502 |
values:#(1 2 3 4) |
|
5503 |
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
|
5504 |
" |
d3fe810390cb
changed cancel-value to '' (ST-80 compat.); added xxx:onCancel: methods; added more choose methods
Claus Gittinger <cg@exept.de>
parents:
302
diff
changeset
|
5505 |
|
2473 | 5506 |
"Modified: / 16.11.2001 / 14:55:33 / cg" |
5507 |
"Created: / 16.11.2001 / 15:04:16 / cg" |
|
5508 |
! |
|
5509 |
||
5510 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default |
|
5511 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5512 |
Returning a corresponding value from the values-array. |
|
5513 |
The default entries button is marked as a return button and entering |
|
5514 |
return will choose that value; hitting escape returns nil. |
|
5515 |
For a good userInterface style, we recommend this being the last |
|
5516 |
entry (to make the right-most button the default button)." |
|
5517 |
||
5518 |
^ self |
|
5519 |
choose:aString |
|
3455 | 5520 |
label:windowLabel image:nil |
5521 |
labels:buttonLabels values:values |
|
2473 | 5522 |
default:default |
5523 |
onCancel:nil |
|
5524 |
||
5525 |
"no good style (default button is not the rightmost one) |
|
5526 |
||
5527 |
Dialog |
|
5528 |
choose:'choose any' |
|
5529 |
labels:#('one' 'two' 'three' 'four') |
|
5530 |
values:#(1 2 3 4) |
|
5531 |
default:2 |
|
5532 |
||
5533 |
Dialog |
|
5534 |
choose:'choose any' |
|
5535 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5536 |
values:#(nil foo bar baz) |
|
5537 |
default:#baz |
|
5538 |
||
5539 |
Dialog |
|
5540 |
choose:'choose any' |
|
5541 |
labels:#('one' 'two' 'three' 'four') |
|
5542 |
values:#(1 2 3 4) |
|
5543 |
default:nil |
|
5544 |
" |
|
5545 |
||
3455 | 5546 |
"Created: / 22-07-1996 / 11:44:27 / cg" |
5547 |
"Modified: / 02-03-2007 / 12:09:01 / cg" |
|
2473 | 5548 |
! |
5549 |
||
5550 |
choose:aString label:windowLabel labels:buttonLabels values:values default:default onCancel:cancelValue |
|
5551 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5552 |
Returning a corresponding value from the values-array. |
|
5553 |
The default entries button is marked as a return button and entering |
|
5554 |
return will choose that value; hitting escape returns cancelValue. |
|
5555 |
For a good userInterface style, we recommend this being the last |
|
5556 |
entry (to make the right-most button the default button)." |
|
5557 |
||
5558 |
^ self |
|
3455 | 5559 |
choose:aString |
5560 |
label:windowLabel image:nil |
|
2473 | 5561 |
labels:buttonLabels values:values |
5562 |
default:default onCancel:cancelValue |
|
5563 |
||
5564 |
"no good style (default button is not the rightmost one) |
|
5565 |
||
5566 |
Dialog |
|
5567 |
choose:'choose any' |
|
5568 |
label:'Foo Bar Baz' |
|
5569 |
labels:#('one' 'two' 'three' 'four') |
|
5570 |
values:#(1 2 3 4) |
|
5571 |
default:2 |
|
5572 |
onCancel:1 |
|
5573 |
||
5574 |
Dialog |
|
5575 |
choose:'choose any' |
|
5576 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5577 |
values:#(nil foo bar baz) |
|
5578 |
default:#baz |
|
5579 |
||
5580 |
Dialog |
|
5581 |
choose:'choose any' |
|
5582 |
labels:#('one' 'two' 'three' 'four') |
|
5583 |
values:#(1 2 3 4) |
|
5584 |
default:nil |
|
5585 |
" |
|
5586 |
||
3455 | 5587 |
"Created: / 16-11-2001 / 14:53:55 / cg" |
5588 |
"Modified: / 02-03-2007 / 12:08:44 / cg" |
|
803 | 5589 |
! |
5590 |
||
5591 |
choose:aString labels:buttonLabels values:values default:default |
|
5592 |
"launch a Dialog, which allows user to enter any of buttonLabels. |
|
5593 |
Returning a corresponding value from the values-array. |
|
5594 |
The default entries button is marked as a return button and entering |
|
5595 |
return will choose that value. |
|
5596 |
For a good userInterface style, we recommend this being the last |
|
5597 |
entry (to make the right-most button the default button)." |
|
5598 |
||
5599 |
^ self |
|
2473 | 5600 |
choose:aString |
3455 | 5601 |
label:nil image:nil |
5602 |
labels:buttonLabels values:values |
|
2473 | 5603 |
default:default |
5604 |
onCancel:nil |
|
803 | 5605 |
|
5606 |
||
5607 |
"no good style (default button is not the rightmost one) |
|
5608 |
||
5609 |
Dialog |
|
2473 | 5610 |
choose:'choose any' |
5611 |
labels:#('one' 'two' 'three' 'four') |
|
5612 |
values:#(1 2 3 4) |
|
5613 |
default:2 |
|
803 | 5614 |
|
5615 |
Dialog |
|
2473 | 5616 |
choose:'choose any' |
5617 |
labels:#('cancel' 'foo' 'bar' 'baz') |
|
5618 |
values:#(nil foo bar baz) |
|
5619 |
default:#baz |
|
803 | 5620 |
|
5621 |
Dialog |
|
2473 | 5622 |
choose:'choose any' |
5623 |
labels:#('one' 'two' 'three' 'four') |
|
5624 |
values:#(1 2 3 4) |
|
5625 |
default:nil |
|
5626 |
" |
|
5627 |
||
3455 | 5628 |
"Modified: / 02-03-2007 / 12:08:55 / cg" |
2111 | 5629 |
! |
5630 |
||
5631 |
chooseMultiple:aString fromList:list values:listValues buttons:buttonLabels values:buttonValues lines:maxLines cancel:cancelBlock |
|
5632 |
"launch a Dialog showing the message and list. |
|
5633 |
The user can select an item and click ok; in this case, the corresponding value |
|
5634 |
from listValues is returned (doubleclick works as well). |
|
5635 |
The list may be suppressed (if the list arg is nil). |
|
5636 |
Below the list, an optional row of buttons is shown, which can also be |
|
5637 |
clicked upon, and a corresponding value from buttonValues is returned. |
|
5638 |
If cancel is pressed, the value of cancelBlock is returned. |
|
5639 |
Pressing ok without a selection is treated like cancel." |
|
5640 |
||
5641 |
^ self |
|
5642 |
choose:aString |
|
3455 | 5643 |
fromList:list values:listValues |
5644 |
buttons:buttonLabels values:buttonValues |
|
2111 | 5645 |
lines:maxLines |
5646 |
cancel:cancelBlock |
|
5647 |
multiple:true |
|
5648 |
||
5649 |
" |
|
5650 |
full example: |
|
5651 |
||
5652 |
Transcript showCR:( |
|
5653 |
Dialog |
|
2112 | 5654 |
chooseMultiple:'choose selected' |
2111 | 5655 |
fromList:#('one' 'two' 'three' 'four') |
5656 |
values:#(1 2 3 4) |
|
5657 |
buttons:nil |
|
5658 |
values:nil |
|
5659 |
lines:10 |
|
5660 |
cancel:nil |
|
5661 |
) |
|
2112 | 5662 |
|
5663 |
Transcript showCR:( |
|
5664 |
Dialog |
|
5665 |
chooseMultiple:'choose selected' |
|
5666 |
fromList:#('one' 'two' 'three' 'four') |
|
5667 |
values:#(1 2 3 4) |
|
5668 |
buttons:#() |
|
5669 |
values:#() |
|
5670 |
lines:10 |
|
5671 |
cancel:nil |
|
5672 |
) |
|
2111 | 5673 |
" |
5674 |
||
3455 | 5675 |
"Modified: / 02-03-2007 / 12:09:10 / cg" |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5676 |
! |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5677 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5678 |
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
|
5679 |
"launch a Dialog showing the message and list. |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5680 |
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
|
5681 |
from listValues is returned (doubleclick works as well). |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5682 |
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
|
5683 |
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
|
5684 |
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
|
5685 |
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
|
5686 |
Pressing ok without a selection is treated like cancel." |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5687 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5688 |
^ self |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5689 |
choose:aString |
3455 | 5690 |
fromList:list values:listValues |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5691 |
initialSelection:initialListSelectionOrNil |
3455 | 5692 |
buttons:nil values:nil |
2222
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5693 |
lines:maxLines |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5694 |
cancel:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5695 |
multiple:true |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5696 |
postBuildBlock:nil |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5697 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5698 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5699 |
full example: |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5700 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5701 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5702 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5703 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5704 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5705 |
values:#(1 2 3 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5706 |
initialSelection:#(2 4) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5707 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5708 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5709 |
|
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5710 |
Transcript showCR:( |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5711 |
Dialog |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5712 |
chooseMultiple:'choose selected' |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5713 |
fromList:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5714 |
values:#('one' 'two' 'three' 'four') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5715 |
initialSelection:#( 'two' 'three') |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5716 |
lines:10 |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5717 |
) |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5718 |
" |
c3fb44421dda
list selectBox with initial selection
Claus Gittinger <cg@exept.de>
parents:
2221
diff
changeset
|
5719 |
|
3455 | 5720 |
"Created: / 18-08-2000 / 22:38:13 / cg" |
5721 |
"Modified: / 02-03-2007 / 12:09:15 / cg" |
|
100 | 5722 |
! ! |
5723 |
||
2439 | 5724 |
!DialogBox class methodsFor:'private'! |
5725 |
||
5726 |
showAndThenDestroyBox:aBox |
|
5727 |
self showBox:aBox. |
|
5728 |
aBox destroy |
|
5729 |
! |
|
5730 |
||
5731 |
showBox:aBox |
|
2666
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5732 |
|wg v| |
4e5cf41990d6
show (some dialogs) centered
Claus Gittinger <cg@exept.de>
parents:
2640
diff
changeset
|
5733 |
|
2439 | 5734 |
ForceModalBoxesToOpenAtCenter == true ifTrue:[ |
5735 |
aBox showAtCenter. |
|
3888 | 5736 |
^ self. |
5737 |
]. |
|
5738 |
ForceModalBoxesToOpenAtPointer == true ifTrue:[ |
|
5739 |
aBox showAtPointer. |
|
5740 |
^ self. |
|
5741 |
]. |
|
5742 |
||
5743 |
wg := WindowGroup activeGroup. |
|
5744 |
wg isNil ifTrue:[ |
|
5745 |
aBox showAtCenter. |
|
5746 |
^ self. |
|
5747 |
]. |
|
5748 |
wg isModal ifTrue:[ |
|
5749 |
v := wg mainView. |
|
5750 |
v notNil ifTrue:[ |
|
5751 |
aBox showCenteredIn:v. |
|
5752 |
^ self. |
|
5753 |
]. |
|
5754 |
]. |
|
5755 |
||
5756 |
v := wg mainGroup mainView. |
|
5757 |
v isNil ifTrue:[ |
|
5758 |
aBox showAtCenter. |
|
5759 |
^ self. |
|
5760 |
]. |
|
5761 |
||
5762 |
aBox showCenteredIn:v. |
|
2439 | 5763 |
! ! |
5764 |
||
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5765 |
!DialogBox class methodsFor:'queries'! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5766 |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5767 |
defaultOKButtonAtLeft |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5768 |
"somewhat of a kludge: |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5769 |
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
|
5770 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5771 |
^ (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
|
5772 |
|
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5773 |
" |
2694 | 5774 |
DialogBox defaultOKButtonAtLeft |
5775 |
" |
|
2197
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5776 |
! |
5b3dd41c21ac
added query if ok button should be at left
Claus Gittinger <cg@exept.de>
parents:
2183
diff
changeset
|
5777 |
|
1573
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5778 |
defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5779 |
"return a default parent (top-) window for the dialog. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5780 |
Here, the currently active view is returned, if there |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5781 |
is one; otherwise, the first encountered topView is |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5782 |
returned." |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5783 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5784 |
|activeGroup| |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5785 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5786 |
activeGroup := WindowGroup activeGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5787 |
activeGroup isNil ifTrue:[ |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5788 |
"/ mhmh - looks like I am a background process ... |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5789 |
activeGroup := Transcript windowGroup. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5790 |
activeGroup isNil ifTrue:[^ nil]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5791 |
]. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5792 |
^ activeGroup topViews first. |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5793 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5794 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5795 |
self defaultParentWindow |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5796 |
" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5797 |
|
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5798 |
"Modified: / 16.6.1998 / 12:36:15 / cg" |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5799 |
! ! |
63a7b74f45be
added #defaultParentWindow for VW compatibility.
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
5800 |
|
2486 | 5801 |
!DialogBox class methodsFor:'smalltalk dialogs'! |
5802 |
||
3276 | 5803 |
requestClass:aString |
5804 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5805 |
Return the entered class or nil (if cancel was pressed). |
|
5806 |
The entryField does classNameCompletion on TAB." |
|
5807 |
||
5808 |
^ self requestClass:aString okLabel:'OK' initialAnswer:nil. |
|
5809 |
||
5810 |
" |
|
5811 |
Dialog |
|
5812 |
requestClass:'Enter a class:' |
|
5813 |
" |
|
5814 |
! |
|
5815 |
||
3282 | 5816 |
requestClass:aString initialAnswer:initialAnswer |
5817 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5818 |
Return the entered class or nil (if cancel was pressed). |
|
5819 |
The entryField does classNameCompletion on TAB." |
|
5820 |
||
5821 |
^ self requestClass:aString okLabel:'OK' initialAnswer:initialAnswer. |
|
5822 |
||
5823 |
" |
|
5824 |
Dialog |
|
5825 |
requestClass:'Enter a class:' |
|
5826 |
initialAnswer:'Array' |
|
5827 |
" |
|
5828 |
! |
|
5829 |
||
3532 | 5830 |
requestClass:aString list:list okLabel:okLabel initialAnswer:initial |
3276 | 5831 |
"launch a Dialog, which allows user to enter an existing classes name. |
5832 |
Return the entered class or nil (if cancel was pressed). |
|
3181 | 5833 |
The entryField does classNameCompletion on TAB." |
5834 |
||
5835 |
|className| |
|
5836 |
||
3532 | 5837 |
className := self requestClassName:aString list:list okLabel:okLabel initialAnswer:initial. |
3276 | 5838 |
className isEmptyOrNil ifTrue:[^ nil]. |
3181 | 5839 |
^ Smalltalk classNamed:className |
5840 |
||
5841 |
" |
|
5842 |
Dialog |
|
3276 | 5843 |
requestClass:'Enter a class:' |
3181 | 5844 |
okLabel:'OK' |
5845 |
initialAnswer:'Arr' |
|
5846 |
" |
|
3532 | 5847 |
|
5848 |
"Created: / 12-01-2008 / 23:02:28 / cg" |
|
5849 |
! |
|
5850 |
||
5851 |
requestClass:aString okLabel:okLabel initialAnswer:initial |
|
5852 |
"launch a Dialog, which allows user to enter an existing classes name. |
|
5853 |
Return the entered class or nil (if cancel was pressed). |
|
5854 |
The entryField does classNameCompletion on TAB." |
|
5855 |
||
5856 |
^ self requestClass:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5857 |
||
5858 |
" |
|
5859 |
Dialog |
|
5860 |
requestClass:'Enter a class:' |
|
5861 |
okLabel:'OK' |
|
5862 |
initialAnswer:'Arr' |
|
5863 |
" |
|
5864 |
||
5865 |
"Modified: / 12-01-2008 / 23:02:42 / cg" |
|
5866 |
! |
|
5867 |
||
5868 |
requestClassName:aString list:list okLabel:okLabel initialAnswer:initial |
|
3181 | 5869 |
"launch a Dialog, which allows user to enter a class name. |
5870 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5871 |
The entryField does classNameCompletion on TAB." |
|
5872 |
||
5873 |
^ self |
|
5874 |
request:aString |
|
5875 |
displayAt:nil |
|
5876 |
centered:nil |
|
5877 |
action:nil |
|
5878 |
initialAnswer:initial |
|
5879 |
okLabel:okLabel |
|
5880 |
cancelLabel:nil |
|
5881 |
title:nil |
|
5882 |
onCancel:nil |
|
3532 | 5883 |
list:list |
3181 | 5884 |
initialSelection:nil |
3182 | 5885 |
entryCompletionBlock:DoWhatIMeanSupport classNameEntryCompletionBlock |
3181 | 5886 |
|
5887 |
" |
|
5888 |
Dialog |
|
3532 | 5889 |
requestClassName:'Enter a class:' |
5890 |
list:(Array with:Array with:String with:Point) |
|
5891 |
okLabel:'OK' |
|
5892 |
initialAnswer:'Arr' |
|
5893 |
" |
|
5894 |
||
5895 |
"Created: / 12-01-2008 / 22:58:01 / cg" |
|
5896 |
! |
|
5897 |
||
5898 |
requestClassName:aString okLabel:okLabel initialAnswer:initial |
|
5899 |
"launch a Dialog, which allows user to enter a class name. |
|
5900 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
5901 |
The entryField does classNameCompletion on TAB." |
|
5902 |
||
5903 |
^ self requestClassName:aString list:nil okLabel:okLabel initialAnswer:initial |
|
5904 |
||
5905 |
" |
|
5906 |
Dialog |
|
3181 | 5907 |
requestClassName:'enter a class:' |
5908 |
okLabel:'OK' |
|
5909 |
initialAnswer:'Arr' |
|
5910 |
" |
|
3532 | 5911 |
|
5912 |
"Modified: / 12-01-2008 / 22:58:13 / cg" |
|
3181 | 5913 |
! |
5914 |
||
3538 | 5915 |
requestName:title fromList:nameList title:boxTitle initialAnswer:initialTextOrNil |
5916 |
"Ask for a name from a list (used for namespaces and sharedPools)" |
|
5917 |
||
5918 |
|newName box| |
|
5919 |
||
5920 |
box := ListSelectionBox new. |
|
5921 |
box title:title. |
|
5922 |
box list:nameList. |
|
5923 |
box okAction:[:sel | newName := sel]. |
|
5924 |
box initialText:initialTextOrNil. |
|
5925 |
boxTitle notNil ifTrue:[ box label:boxTitle ]. |
|
5926 |
box showAtPointer. |
|
5927 |
||
5928 |
newName notNil ifTrue:[ |
|
5929 |
newName := newName withoutSeparators. |
|
5930 |
]. |
|
5931 |
^ newName |
|
5932 |
||
5933 |
" |
|
5934 |
Dialog |
|
5935 |
requestName:'Select a Name' |
|
5936 |
fromList:#('foo' 'bar' 'baz') |
|
5937 |
title:'blabla' |
|
5938 |
initialAnswer:nil |
|
5939 |
" |
|
5940 |
! |
|
5941 |
||
2486 | 5942 |
requestNameSpace:title initialAnswer:initialTextOrNil |
5943 |
"Ask for a namespaces name" |
|
5944 |
||
2996 | 5945 |
^ self |
5946 |
requestNameSpace:title |
|
3538 | 5947 |
title:title |
2996 | 5948 |
initialAnswer:initialTextOrNil |
5949 |
||
5950 |
" |
|
3538 | 5951 |
Dialog |
5952 |
requestNameSpace:'Select a NameSpace' |
|
5953 |
initialAnswer:nil |
|
2996 | 5954 |
" |
5955 |
! |
|
5956 |
||
5957 |
requestNameSpace:title title:boxTitle initialAnswer:initialTextOrNil |
|
5958 |
"Ask for a namespaces name" |
|
5959 |
||
3538 | 5960 |
|allNameSpaces| |
2486 | 5961 |
|
3282 | 5962 |
allNameSpaces := NameSpace allNameSpaces collect:[:each | each name]. |
2486 | 5963 |
allNameSpaces := allNameSpaces asOrderedCollection sort. |
5964 |
||
3538 | 5965 |
^ self |
5966 |
requestName:title |
|
5967 |
fromList:allNameSpaces |
|
5968 |
title:boxTitle |
|
5969 |
initialAnswer:initialTextOrNil |
|
5970 |
||
5971 |
" |
|
5972 |
Dialog |
|
5973 |
requestNameSpace:'Select a NameSpace' |
|
5974 |
initialAnswer:nil |
|
2486 | 5975 |
" |
5976 |
! |
|
5977 |
||
3736 | 5978 |
requestProject:title from:listOfProjects initialAnswer:initialTextOrNil suggestions:suggestions |
3384 | 5979 |
"Ask for a project (package-id)" |
5980 |
||
3736 | 5981 |
|newProject box| |
3384 | 5982 |
|
5983 |
box := ListSelectionBox new. |
|
5984 |
box useComboBoxWithList:suggestions. |
|
5985 |
box title:title. |
|
3736 | 5986 |
box list:listOfProjects. |
3384 | 5987 |
box okAction:[:sel | newProject := sel]. |
5988 |
box initialText:initialTextOrNil. |
|
5989 |
box entryCompletionBlock:(DoWhatIMeanSupport packageNameEntryCompletionBlock). |
|
4307
f7c4d912269c
changed: #requestProject:from:initialAnswer:suggestions:
Claus Gittinger <cg@exept.de>
parents:
4302
diff
changeset
|
5990 |
box label:'Enter Project/PackageID'. |
3384 | 5991 |
box showAtPointer. |
5992 |
||
5993 |
newProject notNil ifTrue:[ |
|
5994 |
newProject := newProject withoutSeparators asSymbol. |
|
5995 |
]. |
|
5996 |
^ newProject |
|
5997 |
||
5998 |
" |
|
5999 |
Dialog |
|
6000 |
requestProject:'enter a project' |
|
6001 |
initialAnswer:'stx:libbasic' |
|
6002 |
suggestions:#('foo' 'bar' 'baz') |
|
6003 |
" |
|
6004 |
||
6005 |
"Created: / 07-09-2006 / 11:40:17 / cg" |
|
6006 |
! |
|
6007 |
||
3736 | 6008 |
requestProject:title initialAnswer:initialTextOrNil suggestions:suggestions |
6009 |
"Ask for a project (package-id)" |
|
6010 |
||
6011 |
|allProjects| |
|
6012 |
||
6013 |
allProjects := Smalltalk allProjectIDs. |
|
6014 |
^ self |
|
6015 |
requestProject:title |
|
6016 |
from:allProjects |
|
6017 |
initialAnswer:initialTextOrNil |
|
6018 |
suggestions:suggestions |
|
6019 |
! |
|
6020 |
||
2486 | 6021 |
requestSelector:aString initialAnswer:initial |
6022 |
"launch a Dialog, which allows user to enter a method selector. |
|
6023 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6024 |
The entryField does selectorCompletion on TAB." |
|
6025 |
||
6026 |
^ self requestSelector:aString okLabel:nil initialAnswer:initial |
|
6027 |
||
6028 |
" |
|
6029 |
Dialog |
|
6030 |
requestSelector:'enter a selector:' |
|
6031 |
initialAnswer:'at:p' |
|
6032 |
" |
|
6033 |
! |
|
6034 |
||
6035 |
requestSelector:aString okLabel:okLabel initialAnswer:initial |
|
6036 |
"launch a Dialog, which allows user to enter a method selector. |
|
6037 |
Return the entered string (may be empty string) or nil (if cancel was pressed). |
|
6038 |
The entryField does selectorCompletion on TAB." |
|
6039 |
||
6040 |
^ self |
|
6041 |
request:aString |
|
6042 |
displayAt:nil |
|
6043 |
centered:nil |
|
6044 |
action:nil |
|
6045 |
initialAnswer:initial |
|
6046 |
okLabel:okLabel |
|
6047 |
cancelLabel:nil |
|
6048 |
title:nil |
|
6049 |
onCancel:nil |
|
6050 |
list:nil |
|
6051 |
initialSelection:nil |
|
2629 | 6052 |
entryCompletionBlock:[:s :field| |
6053 |
|completion| |
|
2486 | 6054 |
|
6055 |
completion := Smalltalk selectorCompletion:s. |
|
3881 | 6056 |
completion second size > 1 ifTrue:[ |
6057 |
UserPreferences current beepInEditor ifTrue:[ |
|
6058 |
Screen current beep |
|
6059 |
]. |
|
6060 |
]. |
|
2629 | 6061 |
field contents:(completion first) |
2486 | 6062 |
] |
6063 |
||
6064 |
" |
|
6065 |
Dialog |
|
6066 |
requestSelector:'enter a selector:' |
|
6067 |
initialAnswer:'at:p' |
|
6068 |
" |
|
3538 | 6069 |
! |
6070 |
||
6071 |
requestSharedPool:title title:boxTitle initialAnswer:initialTextOrNil |
|
6072 |
"Ask for a sharedPools name" |
|
6073 |
||
6074 |
|allPools| |
|
6075 |
||
6076 |
allPools := SharedPool allSubclasses collect:[:each | each name]. |
|
6077 |
allPools := allPools asOrderedCollection sort. |
|
6078 |
||
6079 |
^ self |
|
6080 |
requestName:title |
|
6081 |
fromList:allPools |
|
6082 |
title:boxTitle |
|
6083 |
initialAnswer:initialTextOrNil |
|
6084 |
||
6085 |
" |
|
6086 |
Dialog |
|
6087 |
requestSharedPool:'Select a SharedPool' |
|
6088 |
title:nil |
|
6089 |
initialAnswer:nil |
|
6090 |
" |
|
2486 | 6091 |
! ! |
6092 |
||
197 | 6093 |
!DialogBox methodsFor:'accessing-behavior'! |
6094 |
||
6095 |
abortAction:aBlock |
|
6096 |
"define the action to be performed when abort is pressed" |
|
6097 |
||
6098 |
abortAction := aBlock |
|
125 | 6099 |
! |
6100 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6101 |
acceptCheck:aBlock |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6102 |
"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
|
6103 |
accepted (ok-button or Return-key). If it returns true, the box is closed, |
2106 | 6104 |
otherwise not. Of course, you may also use a valueHolder instead of a block |
6105 |
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
|
6106 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6107 |
acceptCheck := aBlock |
2106 | 6108 |
|
6109 |
"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
|
6110 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6111 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6112 |
acceptOnLeave:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6113 |
"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
|
6114 |
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
|
6115 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6116 |
acceptOnLeave := aBoolean. |
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6117 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6118 |
"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
|
6119 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6120 |
|
197 | 6121 |
acceptReturnAsOK:aBoolean |
6122 |
"turn on/off interpretation of return-key as ok. |
|
6123 |
Default is on" |
|
6124 |
||
6125 |
acceptReturnAsOK := aBoolean. |
|
6126 |
okButton notNil ifTrue:[ |
|
6127 |
okButton isReturnButton:aBoolean. |
|
6128 |
] |
|
6129 |
! |
|
6130 |
||
6131 |
action:aBlock |
|
6132 |
"set the action to be performed when user presses ok-button; |
|
6133 |
aBlock must be nil or a block. This method simply |
|
6134 |
reuses okAction: and has been added for a consistent action-setting |
|
6135 |
protocol." |
|
76 | 6136 |
|
197 | 6137 |
self okAction:aBlock |
6138 |
! |
|
6139 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6140 |
focusOnField:anInputField |
1646 | 6141 |
"arrange for the argument to get the focus (initially)" |
6142 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6143 |
inputFieldGroup makeActive:anInputField |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6144 |
|
1646 | 6145 |
"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
|
6146 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6147 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6148 |
focusToOKOnLeave:aBoolean |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6149 |
"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
|
6150 |
or cursor key. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6151 |
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
|
6152 |
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
|
6153 |
the dialog is accepted & closed." |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6154 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6155 |
focusToOKOnLeave := aBoolean. |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6156 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6157 |
"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
|
6158 |
"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
|
6159 |
! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
6160 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6161 |
hideOnAccept:aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6162 |
"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
|
6163 |
The default is true" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6164 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6165 |
hideOnAccept := aBoolean |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6166 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6167 |
|
593 | 6168 |
makeTabable:aComponentOrSubcomponent |
6169 |
"add a component (usually a subcomponent, of which the dialog |
|
6170 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6171 |
stepped through via FocusNext/FocusPrevious). |
|
6172 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6173 |
||
3467 | 6174 |
aComponentOrSubcomponent canTab:true. |
6175 |
||
6176 |
"/ tabableElements isNil ifTrue:[ |
|
6177 |
"/ tabableElements := OrderedCollection new |
|
6178 |
"/ ]. |
|
6179 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6180 |
"/ tabableElements add:aComponentOrSubcomponent. |
|
6181 |
"/ ]. |
|
6182 |
||
6183 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6184 |
self addToInputFieldGroup:aComponentOrSubcomponent |
|
593 | 6185 |
]. |
6186 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
6187 |
"Modified: 31.5.1996 / 21:22:13 / cg" |
593 | 6188 |
! |
6189 |
||
1843 | 6190 |
makeTabable:aComponentOrSubcomponent after:anotherComponent |
6191 |
"add a component (usually a subcomponent, of which the dialog |
|
6192 |
does not know) to the list of tabable ones (i.e. those, that can be |
|
6193 |
stepped through via FocusNext/FocusPrevious). |
|
6194 |
Toplevel tabable components are usually added with #addComponent:tabable:" |
|
6195 |
||
3467 | 6196 |
<resource: #obsolete> |
6197 |
self obsoleteMethodWarning. "/ focusSequence has been eliminated |
|
6198 |
||
6199 |
aComponentOrSubcomponent canTab:true. |
|
6200 |
||
6201 |
"/ tabableElements isNil ifTrue:[ |
|
6202 |
"/ tabableElements := OrderedCollection new |
|
6203 |
"/ ]. |
|
6204 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent ifAbsent:nil. |
|
6205 |
"/ |
|
6206 |
"/ anotherComponent isNil ifTrue:[ |
|
6207 |
"/ tabableElements addLast:aComponentOrSubcomponent |
|
6208 |
"/ ] ifFalse:[ |
|
6209 |
"/ tabableElements add:aComponentOrSubcomponent after:anotherComponent. |
|
6210 |
"/ ]. |
|
6211 |
"/ |
|
1843 | 6212 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
6213 |
self addToInputFieldGroup:aComponentOrSubcomponent after:anotherComponent |
|
6214 |
]. |
|
6215 |
||
6216 |
"Modified: 18.10.1997 / 03:08:20 / cg" |
|
6217 |
! |
|
6218 |
||
1355 | 6219 |
makeUntabable:aComponentOrSubcomponent |
3467 | 6220 |
aComponentOrSubcomponent canTab:false. |
6221 |
||
6222 |
"/ (tabableElements includesIdentical:aComponentOrSubcomponent) ifFalse:[ |
|
6223 |
"/ tabableElements removeIdentical:aComponentOrSubcomponent. |
|
6224 |
"/ ]. |
|
6225 |
||
6226 |
(aComponentOrSubcomponent isInputField) ifTrue:[ |
|
6227 |
self removeFromInputFieldGroup:aComponentOrSubcomponent |
|
1355 | 6228 |
]. |
6229 |
||
6230 |
"Modified: 18.10.1997 / 02:50:05 / cg" |
|
593 | 6231 |
! |
6232 |
||
2361 | 6233 |
noAction:aBlock |
6234 |
"define the action to be performed when 'no' is pressed" |
|
6235 |
||
6236 |
abortAction := aBlock |
|
6237 |
||
6238 |
"Modified: 16.1.1997 / 11:29:18 / cg" |
|
6239 |
! |
|
6240 |
||
197 | 6241 |
okAction:aBlock |
6242 |
"define the action to be performed when ok is pressed" |
|
133 | 6243 |
|
197 | 6244 |
okAction := aBlock |
2361 | 6245 |
! |
6246 |
||
6247 |
title:aString yesAction:yesBlock noAction:noBlock |
|
6248 |
"define title and actions" |
|
6249 |
||
6250 |
self title:aString. |
|
6251 |
okAction := yesBlock. |
|
6252 |
abortAction := noBlock |
|
6253 |
! |
|
6254 |
||
6255 |
yesAction:aBlock |
|
6256 |
"define the action to be performed when 'yes' is pressed" |
|
6257 |
||
6258 |
okAction := aBlock |
|
6259 |
||
6260 |
"Modified: 16.1.1997 / 11:31:21 / cg" |
|
6261 |
! |
|
6262 |
||
6263 |
yesAction:yesBlock noAction:noBlock |
|
6264 |
"define both actions" |
|
6265 |
||
6266 |
okAction := yesBlock. |
|
6267 |
abortAction := noBlock |
|
197 | 6268 |
! ! |
6269 |
||
6270 |
!DialogBox methodsFor:'accessing-components'! |
|
6271 |
||
6272 |
abortButton |
|
6273 |
"return the abortButton - this access is provided to allow |
|
6274 |
setting the buttons look (for example: colors or font)" |
|
6275 |
||
6276 |
^ abortButton |
|
76 | 6277 |
! |
6278 |
||
2327 | 6279 |
buttonPanel |
6280 |
"return the buttonPanel - this access is provided to allow |
|
6281 |
setting the buttons look (for example: colors or font)" |
|
6282 |
||
6283 |
^ buttonPanel |
|
6284 |
! |
|
6285 |
||
2147
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6286 |
cancelButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6287 |
"same as #abortButton; |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6288 |
return the abortButton - this access is provided to allow |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6289 |
setting the buttons look (for example: colors or font)" |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6290 |
|
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6291 |
^ self abortButton |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6292 |
! |
3d1a7c11592b
added #cancelButton (for convenience)
Claus Gittinger <cg@exept.de>
parents:
2145
diff
changeset
|
6293 |
|
2361 | 6294 |
noButton |
6295 |
"return the no-button" |
|
6296 |
||
6297 |
^ abortButton |
|
6298 |
! |
|
6299 |
||
197 | 6300 |
okButton |
6301 |
"return the okButton - this access is provided to allow |
|
6302 |
setting the buttons look (for example: colors or font)" |
|
76 | 6303 |
|
197 | 6304 |
^ okButton |
2361 | 6305 |
! |
6306 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6307 |
verticalPanel |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6308 |
"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
|
6309 |
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
|
6310 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6311 |
|savedY| |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6312 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6313 |
verticalPanel isNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6314 |
savedY := yPosition. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6315 |
self addComponent:(verticalPanel := VerticalPanelView new). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6316 |
verticalPanel horizontalLayout:#fit. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6317 |
verticalPanel verticalLayout:#top. |
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
6318 |
verticalPanel height:25. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6319 |
yPosition := savedY. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6320 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6321 |
^ verticalPanel |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6322 |
! |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6323 |
|
2361 | 6324 |
yesButton |
6325 |
"return the 'yes'-button" |
|
6326 |
||
6327 |
^ okButton |
|
6328 |
||
6329 |
"Modified: 16.1.1997 / 11:31:27 / cg" |
|
197 | 6330 |
! ! |
155 | 6331 |
|
197 | 6332 |
!DialogBox methodsFor:'accessing-elements'! |
6333 |
||
6334 |
componentAt:name |
|
680 | 6335 |
"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
|
6336 |
named previously with #name:as:" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6337 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6338 |
namedComponents isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6339 |
^ namedComponents at:name ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6340 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6341 |
"Modified: 16.1.1997 / 11:40:50 / cg" |
76 | 6342 |
! |
6343 |
||
197 | 6344 |
name:element as:name |
680 | 6345 |
"assign a name to a component. This can be done during construction, |
6346 |
to allow later access to the components (i.e. without a need to |
|
6347 |
remember them in some instVars)" |
|
6348 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6349 |
namedComponents isNil ifTrue:[ |
1401 | 6350 |
namedComponents := Dictionary new. |
197 | 6351 |
]. |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6352 |
namedComponents at:name put:element |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6353 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6354 |
"Modified: 16.1.1997 / 11:41:03 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6355 |
! ! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6356 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6357 |
!DialogBox methodsFor:'accessing-look'! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6358 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6359 |
abortText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6360 |
"define the label in the abort-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6361 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6362 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6363 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6364 |
aString ~= abortButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6365 |
oldSize := abortButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6366 |
abortButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6367 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6368 |
abortButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6369 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6370 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6371 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6372 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6373 |
|
1702 | 6374 |
hideButtons |
6375 |
"hides the buttonPanel (i.e. the ok and cancel buttons if any)" |
|
6376 |
||
6377 |
buttonPanel notNil ifTrue:[buttonPanel beInvisible] |
|
6378 |
! |
|
6379 |
||
2361 | 6380 |
noLabel:aString |
6381 |
"define the label of the 'no'-button. |
|
6382 |
And alias for #noText: - for backward compatibility" |
|
6383 |
||
6384 |
self noText:aString. |
|
6385 |
||
6386 |
"Created: 13.12.1995 / 16:21:57 / cg" |
|
6387 |
"Modified: 16.1.1997 / 11:30:25 / cg" |
|
6388 |
! |
|
6389 |
||
6390 |
noText:aString |
|
6391 |
"define the label of the no-button. |
|
6392 |
If not set, it defaults to the resource-string for 'no'." |
|
6393 |
||
6394 |
aString ~= abortButton label ifTrue:[ |
|
6395 |
abortButton label:aString. |
|
6396 |
abortButton resize. |
|
6397 |
shown ifTrue:[self resize] |
|
6398 |
] |
|
6399 |
! |
|
6400 |
||
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6401 |
okText:aString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6402 |
"define the text in the ok-button" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6403 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6404 |
|oldSize| |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6405 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6406 |
aString ~= okButton label ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6407 |
oldSize := okButton extent. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6408 |
okButton label:aString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6409 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6410 |
okButton extent ~= oldSize ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6411 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6412 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6413 |
] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6414 |
! |
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 |
okText:okString abortText:abortString |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6417 |
"set both texts displayed in the buttons" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6418 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6419 |
(abortString ~= abortButton label |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6420 |
or:[okString ~= okButton label]) ifTrue:[ |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6421 |
okButton label:okString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6422 |
abortButton label:abortString. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6423 |
okButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6424 |
abortButton resize. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6425 |
shown ifTrue:[self resize] |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6426 |
] |
2361 | 6427 |
! |
6428 |
||
6429 |
okText:yesString noText:noString |
|
6430 |
"define the labels of both buttons. |
|
6431 |
Alias for yesText:noText: for backward compatibility." |
|
6432 |
||
6433 |
^ self yesText:yesString noText:noString |
|
6434 |
||
6435 |
"Modified: 16.1.1997 / 11:30:58 / cg" |
|
6436 |
! |
|
6437 |
||
6438 |
title:aString yesText:yesString noText:noString |
|
6439 |
"define title and button labels" |
|
6440 |
||
6441 |
self title:aString. |
|
6442 |
self yesText:yesString noText:noString |
|
6443 |
! |
|
6444 |
||
6445 |
yesLabel:aString |
|
6446 |
"define the label of the 'yes'-button. |
|
6447 |
An alias for #yesText: for backward compatibility." |
|
6448 |
||
6449 |
self yesText:aString. |
|
6450 |
||
6451 |
"Created: 13.12.1995 / 16:22:05 / cg" |
|
6452 |
"Modified: 16.1.1997 / 11:31:58 / cg" |
|
6453 |
! |
|
6454 |
||
6455 |
yesText:aString |
|
6456 |
"define the label of the 'yes'-button" |
|
6457 |
||
6458 |
self okText:aString |
|
6459 |
||
6460 |
"Modified: 16.1.1997 / 11:31:39 / cg" |
|
6461 |
! |
|
6462 |
||
6463 |
yesText:yesString noText:noString |
|
6464 |
"define the labels of both buttons" |
|
6465 |
||
6466 |
((yesString ~= okButton label) or:[noString ~= abortButton label]) ifTrue:[ |
|
6467 |
okButton label:yesString. |
|
6468 |
abortButton label:noString. |
|
6469 |
okButton resize. |
|
6470 |
abortButton resize. |
|
6471 |
shown ifTrue:[self resize] |
|
6472 |
] |
|
6473 |
||
6474 |
"Modified: 21.2.1996 / 00:58:38 / cg" |
|
197 | 6475 |
! ! |
6476 |
||
6477 |
!DialogBox methodsFor:'accessing-models'! |
|
76 | 6478 |
|
197 | 6479 |
accept |
6480 |
"return the valueHolder holding true when the box |
|
6481 |
is accepted, false if closed via the windowManager or |
|
6482 |
the cancel button. |
|
6483 |
This is confusing: this method was originally called #acceptValue, |
|
6484 |
but renamed for compatibility with ST-80. |
|
6485 |
This looks like a bad name to me, since in most other situations, #accept |
|
6486 |
is used to force an accept, not to return some valueHolder ...)." |
|
6487 |
||
6488 |
^ acceptValue |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6489 |
! |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6490 |
|
2221
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6491 |
acceptChannel |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6492 |
"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
|
6493 |
is accepted" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6494 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6495 |
^ acceptValue |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6496 |
|
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6497 |
"Created: / 18.8.2000 / 21:44:24 / cg" |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6498 |
! |
9510bfb6912c
additional interface to create a textBox
Claus Gittinger <cg@exept.de>
parents:
2220
diff
changeset
|
6499 |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6500 |
acceptChannel:aValueHolder |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6501 |
"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
|
6502 |
is accepted" |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6503 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
6504 |
acceptValue := aValueHolder |
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6505 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6506 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6507 |
aspectAt:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6508 |
"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
|
6509 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6510 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6511 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6512 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6513 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6514 |
bindings isNil ifTrue:[bindings := IdentityDictionary new]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6515 |
bindings at:anAspectSymbol put:aDataModel |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6516 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6517 |
"Created: 16.1.1997 / 11:38:46 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6518 |
"Modified: 16.1.1997 / 11:41:28 / cg" |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6519 |
! |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6520 |
|
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6521 |
aspectFor:anAspectSymbol |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6522 |
"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
|
6523 |
requires that a corresponding dataModel has been set (usually during |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6524 |
initialization) via the #aspectAt:put: message. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6525 |
Allows users of boxes to access individual values - especially useful, |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6526 |
in multi-field dialogs." |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6527 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6528 |
"/ subclasses may redefine some aspects... |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6529 |
(self respondsTo:anAspectSymbol) ifTrue:[ |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6530 |
^ self perform:anAspectSymbol |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6531 |
]. |
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6532 |
|
950
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6533 |
bindings isNil ifTrue:[^ nil]. |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6534 |
^ bindings at:anAspectSymbol ifAbsent:nil |
09baff873688
added aspect dictionary facility.
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
6535 |
|
3404
7c42d37d18ea
allow for subclasses to define an aspect method
Claus Gittinger <cg@exept.de>
parents:
3393
diff
changeset
|
6536 |
"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
|
6537 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6538 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6539 |
cancel |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
6540 |
^ BlockValue forLogicalNot:(acceptValue) |
76 | 6541 |
! ! |
6542 |
||
120 | 6543 |
!DialogBox methodsFor:'construction-adding'! |
6544 |
||
593 | 6545 |
addComponent:aComponent |
6546 |
"add any component with its preferred height and full width. |
|
6547 |
Returns the component." |
|
6548 |
||
6549 |
^ self addComponent:aComponent indent:nil tabable:false |
|
6550 |
||
6551 |
"Modified: 9.2.1996 / 22:22:41 / cg" |
|
6552 |
! |
|
6553 |
||
6554 |
addComponent:aComponent indent:indent |
|
6555 |
"add any component with its preferred height and full width. |
|
6556 |
The indent is temporarily changed to indent. |
|
6557 |
Returns the component." |
|
6558 |
||
6559 |
^ self addComponent:aComponent indent:indent tabable:false |
|
6560 |
||
6561 |
"Modified: 9.2.1996 / 22:22:44 / cg" |
|
6562 |
! |
|
6563 |
||
6564 |
addComponent:aComponent indent:indent tabable:tabable |
|
6565 |
"add any component with its preferred height and full width. |
|
6566 |
The indent is temporarily changed to indent. |
|
6567 |
Returns the component." |
|
6568 |
||
6569 |
|oldLeft oldRight result| |
|
6570 |
||
6571 |
oldLeft := leftIndent. |
|
6572 |
oldRight := rightIndent. |
|
6573 |
indent notNil ifTrue:[ |
|
1401 | 6574 |
leftIndent := rightIndent := indent. |
593 | 6575 |
]. |
6576 |
result := self addComponent:aComponent tabable:tabable tabbedComponent:aComponent. |
|
6577 |
leftIndent := oldLeft. |
|
6578 |
rightIndent := oldRight. |
|
6579 |
^ result |
|
6580 |
||
6581 |
"Modified: 9.2.1996 / 22:22:50 / cg" |
|
6582 |
! |
|
6583 |
||
6584 |
addComponent:aComponent indent:indent withExtent:ext |
|
6585 |
"add any component with some given extent. |
|
6586 |
Returns the component." |
|
6587 |
||
6588 |
|fullSize lI rI| |
|
6589 |
||
6590 |
indent isNil ifTrue:[ |
|
2801 | 6591 |
lI := leftIndent. |
6592 |
rI := rightIndent. |
|
593 | 6593 |
] ifFalse:[ |
2801 | 6594 |
lI := rI := indent |
593 | 6595 |
]. |
6596 |
||
6597 |
self basicAddComponent:aComponent. |
|
4155
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6598 |
(ext x isInteger) ifTrue:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6599 |
fullSize := ext + (lI + rI @ 0). |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6600 |
width := fullSize x max:width. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6601 |
] ifFalse:[ |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6602 |
fullSize := ext. |
1edd671b6485
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4146
diff
changeset
|
6603 |
]. |
593 | 6604 |
aComponent extent:fullSize. |
2801 | 6605 |
aComponent origin:(0.0 @ yPosition); |
6606 |
leftInset:lI; |
|
6607 |
rightInset:rI. |
|
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6608 |
|
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6609 |
yPosition := aComponent corner y + ViewSpacing. |
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6610 |
"/ yPosition := yPosition + aComponent height + ViewSpacing. |
593 | 6611 |
needResize := true. |
6612 |
^ aComponent |
|
6613 |
||
4294
f635b66d4b27
changed: #addComponent:indent:withExtent:
Claus Gittinger <cg@exept.de>
parents:
4293
diff
changeset
|
6614 |
"Modified: / 29-07-2011 / 12:28:47 / cg" |
593 | 6615 |
! |
6616 |
||
6617 |
addComponent:aComponent indent:indent withHeight:height |
|
6618 |
"add any component with some given height and full width. |
|
6619 |
Returns the component." |
|
6620 |
||
6621 |
|lI rI| |
|
6622 |
||
6623 |
indent isNil ifTrue:[ |
|
2801 | 6624 |
lI := leftIndent. |
6625 |
rI := rightIndent. |
|
593 | 6626 |
] ifFalse:[ |
2801 | 6627 |
lI := rI := indent |
593 | 6628 |
]. |
6629 |
self basicAddComponent:aComponent. |
|
3283 | 6630 |
aComponent |
6631 |
height:height; |
|
6632 |
origin:0.0@yPosition; |
|
6633 |
width:1.0; |
|
6634 |
leftInset:lI; |
|
6635 |
rightInset:rI. |
|
2801 | 6636 |
yPosition := yPosition + height + ViewSpacing. |
593 | 6637 |
^ aComponent |
6638 |
||
6639 |
"Modified: 9.2.1996 / 22:22:58 / cg" |
|
6640 |
! |
|
6641 |
||
6642 |
addComponent:aComponent tabable:tabable |
|
6643 |
"add any component with its preferred height and full width. |
|
6644 |
Returns the component." |
|
6645 |
||
6646 |
^ self addComponent:aComponent tabable:tabable tabbedComponent:aComponent |
|
6647 |
||
6648 |
"Modified: 9.2.1996 / 22:23:04 / cg" |
|
6649 |
! |
|
6650 |
||
6651 |
addComponent:aComponent tabable:tabable tabbedComponent:subComponent |
|
6652 |
"add any component with its preferred height and full width. |
|
6653 |
Returns the component." |
|
6654 |
||
6655 |
tabable ifTrue:[ |
|
3467 | 6656 |
aComponent canTab:true. |
6657 |
||
6658 |
"/ tabableElements isNil ifTrue:[ |
|
6659 |
"/ tabableElements := OrderedCollection new |
|
6660 |
"/ ]. |
|
6661 |
"/ tabableElements add:subComponent |
|
593 | 6662 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
6663 |
^ self addComponent:aComponent withHeight:(aComponent preferredHeight). |
593 | 6664 |
|
6665 |
"Modified: 9.2.1996 / 22:23:07 / cg" |
|
6666 |
! |
|
6667 |
||
6668 |
addComponent:aComponent withExtent:ext |
|
6669 |
"add any component with some given extent. |
|
6670 |
Returns the component." |
|
6671 |
||
6672 |
^ self addComponent:aComponent indent:nil withExtent:ext |
|
6673 |
||
6674 |
"Modified: 9.2.1996 / 22:23:11 / cg" |
|
6675 |
! |
|
6676 |
||
6677 |
addComponent:aComponent withHeight:height |
|
6678 |
"add any component with some given height and full width. |
|
6679 |
Returns the component." |
|
6680 |
||
6681 |
^ self addComponent:aComponent indent:nil withHeight:height |
|
6682 |
||
6683 |
"Modified: 9.2.1996 / 22:23:15 / cg" |
|
6684 |
! |
|
6685 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6686 |
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
|
6687 |
"add a label and some view side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6688 |
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
|
6689 |
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
|
6690 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6691 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6692 |
|
795 | 6693 |
^ self |
1401 | 6694 |
addLabelledField:aView |
6695 |
label:labelString |
|
6696 |
adjust:labelAdjust |
|
6697 |
tabable:tabable |
|
6698 |
from:leftX to:rightX separateAtX:relativeX |
|
6699 |
nameAs:nil |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6700 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6701 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6702 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6703 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6704 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6705 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6706 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6707 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6708 |
field := dialog |
1401 | 6709 |
addLabelledField:(EditField on:model) label:'input here:' |
6710 |
adjust:#left |
|
6711 |
tabable:true |
|
6712 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6713 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6714 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6715 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6716 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6717 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6718 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6719 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6720 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6721 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6722 |
model := SelectionInList new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6723 |
model list:#('foo' 'bar' 'baz'). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6724 |
model selectionIndex:2. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6725 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6726 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6727 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6728 |
field := dialog |
1401 | 6729 |
addLabelledField:(PopUpList on:model) label:'select here:' |
6730 |
adjust:#left |
|
6731 |
tabable:true |
|
6732 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6733 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6734 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6735 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6736 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6737 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6738 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6739 |
"Created: 3.6.1996 / 11:03:24 / cg" |
795 | 6740 |
"Modified: 17.7.1996 / 15:04:07 / cg" |
6741 |
! |
|
6742 |
||
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6743 |
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
|
6744 |
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
|
6745 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6746 |
"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
|
6747 |
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
|
6748 |
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
|
6749 |
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
|
6750 |
Return the inputField." |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6751 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6752 |
^ self |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6753 |
addLabelledField:aView |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6754 |
label:labelString |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6755 |
adjust:labelAdjust |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6756 |
tabable:tabable |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6757 |
from:leftX to:rightX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6758 |
separateAtX:relativeX |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6759 |
nameAs:aName |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6760 |
foregroundColor:nil |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6761 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6762 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6763 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6764 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6765 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6766 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6767 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6768 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6769 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6770 |
addLabelledField:(EditField on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6771 |
label:'input here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6772 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6773 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6774 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6775 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6776 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6777 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6778 |
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
|
6779 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6780 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6781 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6782 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6783 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6784 |
model := '' asValue. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6785 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6786 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6787 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6788 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6789 |
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
|
6790 |
label:'select foo:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6791 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6792 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6793 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6794 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6795 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6796 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6797 |
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
|
6798 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6799 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6800 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6801 |
|dialog model field| |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6802 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6803 |
model := SelectionInList new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6804 |
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
|
6805 |
model selectionIndex:2. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6806 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6807 |
dialog := DialogBox new. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6808 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6809 |
field := dialog |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6810 |
addLabelledField:(PopUpList on:model) |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6811 |
label:'select here:' |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6812 |
adjust:#left |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6813 |
tabable:true |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6814 |
separateAtX:0.3. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6815 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6816 |
dialog addAbortButton; addOkButton. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6817 |
dialog open. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6818 |
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
|
6819 |
" |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6820 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6821 |
"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
|
6822 |
"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
|
6823 |
! |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6824 |
|
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6825 |
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
|
6826 |
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
|
6827 |
foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6828 |
|
795 | 6829 |
"add a label and some view side-by-side. |
6830 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
6831 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
6832 |
The inputField gets model as its model. |
|
6833 |
Return the inputField." |
|
6834 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6835 |
|y lbl max relW wLabel| |
795 | 6836 |
|
6837 |
y := self yPosition. |
|
6838 |
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
|
6839 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6840 |
max := lbl preferredHeight max:(aView preferredHeight max:aView height). |
795 | 6841 |
|
6842 |
relW := rightX - leftX. |
|
6843 |
||
6844 |
self addComponent:lbl indent:leftIndent withHeight:max. |
|
6845 |
lbl rightInset:0. |
|
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6846 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6847 |
wLabel := relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6848 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6849 |
wLabel := relW*relativeX. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6850 |
]. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6851 |
|
795 | 6852 |
lbl |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6853 |
width:wLabel; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6854 |
left:leftX; |
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6855 |
adjust:labelAdjust; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6856 |
borderWidth:0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6857 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6858 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6859 |
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
|
6860 |
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
|
6861 |
lbl sizeFixed:true. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6862 |
]. |
795 | 6863 |
|
4146
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6864 |
fgColor notNil ifTrue:[ |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6865 |
lbl foregroundColor:fgColor |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6866 |
]. |
dac4342e6797
added: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4145
diff
changeset
|
6867 |
|
795 | 6868 |
self yPosition:y. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6869 |
|
4217
9453a5aa3fcf
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4216
diff
changeset
|
6870 |
"/ 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
|
6871 |
"/ aView height:max. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6872 |
|
795 | 6873 |
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
|
6874 |
|
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6875 |
relativeX isInteger ifTrue:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6876 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6877 |
leftInset:(ViewSpacing + relativeX); |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6878 |
left:0.0; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6879 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6880 |
right:1.0. |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6881 |
] ifFalse:[ |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6882 |
aView |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6883 |
leftInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6884 |
rightInset:ViewSpacing; |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6885 |
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
|
6886 |
left:leftX+(relW*relativeX). |
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6887 |
]. |
4218
7b0e5dd511e9
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4217
diff
changeset
|
6888 |
|
4219
c83b708345f7
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4218
diff
changeset
|
6889 |
"/ 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
|
6890 |
aView setHeight:max. |
795 | 6891 |
|
6892 |
aView isInputField ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6893 |
self addToInputFieldGroup:aView |
795 | 6894 |
]. |
6895 |
||
6896 |
aName notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6897 |
self name:lbl as:(aName , '.label'). |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6898 |
self name:aView as:aName |
795 | 6899 |
]. |
4216
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6900 |
|
4d5603687943
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4208
diff
changeset
|
6901 |
^ aView |
795 | 6902 |
|
6903 |
" |
|
6904 |
|dialog model field| |
|
6905 |
||
6906 |
model := '' asValue. |
|
6907 |
||
6908 |
dialog := DialogBox new. |
|
6909 |
||
6910 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6911 |
addLabelledField:(EditField on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6912 |
label:'input here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6913 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6914 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6915 |
separateAtX:0.3. |
807 | 6916 |
|
6917 |
dialog addAbortButton; addOkButton. |
|
6918 |
dialog open. |
|
6919 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6920 |
" |
|
6921 |
||
6922 |
" |
|
6923 |
|dialog model field| |
|
6924 |
||
6925 |
model := '' asValue. |
|
6926 |
||
6927 |
dialog := DialogBox new. |
|
6928 |
||
6929 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6930 |
addLabelledField:((ComboListView on:model) list:#('foo' 'bar' 'baz')) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6931 |
label:'select foo:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6932 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6933 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6934 |
separateAtX:0.3. |
795 | 6935 |
|
6936 |
dialog addAbortButton; addOkButton. |
|
6937 |
dialog open. |
|
6938 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6939 |
" |
|
6940 |
||
6941 |
" |
|
6942 |
|dialog model field| |
|
6943 |
||
6944 |
model := SelectionInList new. |
|
6945 |
model list:#('foo' 'bar' 'baz'). |
|
6946 |
model selectionIndex:2. |
|
6947 |
||
6948 |
dialog := DialogBox new. |
|
6949 |
||
6950 |
field := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6951 |
addLabelledField:(PopUpList on:model) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6952 |
label:'select here:' |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6953 |
adjust:#left |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6954 |
tabable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
6955 |
separateAtX:0.3. |
795 | 6956 |
|
6957 |
dialog addAbortButton; addOkButton. |
|
6958 |
dialog open. |
|
6959 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
|
6960 |
" |
|
6961 |
||
4193
bfcc66744c84
changed: #addLabelledField:label:adjust:tabable:from:to:separateAtX:nameAs:foregroundColor:
Claus Gittinger <cg@exept.de>
parents:
4183
diff
changeset
|
6962 |
"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
|
6963 |
"Modified: / 02-02-2011 / 12:17:55 / cg" |
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6964 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6965 |
|
593 | 6966 |
addLabelledField:aView label:labelString adjust:labelAdjust tabable:tabable separateAtX:relativeX |
6967 |
"add a label and some view side-by-side. |
|
6968 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
6969 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
6970 |
The inputField gets model as its model. |
|
6971 |
Return the inputField." |
|
6972 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6973 |
^ self |
1401 | 6974 |
addLabelledField:aView |
6975 |
label:labelString |
|
6976 |
adjust:labelAdjust |
|
6977 |
tabable:tabable |
|
6978 |
from:0.0 to:1.0 |
|
6979 |
separateAtX:relativeX |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6980 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6981 |
"/ |y lbl max| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6982 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6983 |
"/ y := self yPosition. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6984 |
"/ lbl := Label label:labelString. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6985 |
"/ max := lbl preferredExtent y max:(aView preferredExtent y). |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6986 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6987 |
"/ self addComponent:lbl indent:leftIndent withHeight:max. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6988 |
"/ lbl rightInset:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6989 |
"/ lbl width:relativeX; adjust:labelAdjust; borderWidth:0. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6990 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6991 |
"/ self yPosition:y. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6992 |
"/ self addComponent:aView tabable:tabable. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6993 |
"/ aView leftInset:ViewSpacing; rightInset:ViewSpacing. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6994 |
"/ aView width:(1.0 - relativeX); left:relativeX. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6995 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6996 |
"/ aView isInputField ifTrue:[ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6997 |
"/ self addToInputFieldGroup:aView |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6998 |
"/ ]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
6999 |
"/ |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7000 |
"/ ^ aView |
593 | 7001 |
|
7002 |
" |
|
7003 |
|dialog model field| |
|
7004 |
||
7005 |
model := '' asValue. |
|
7006 |
||
7007 |
dialog := DialogBox new. |
|
7008 |
||
7009 |
field := dialog |
|
1401 | 7010 |
addLabelledField:(EditField on:model) label:'input here:' |
7011 |
adjust:#left |
|
7012 |
tabable:true |
|
7013 |
separateAtX:0.3. |
|
593 | 7014 |
|
7015 |
dialog addAbortButton; addOkButton. |
|
7016 |
dialog open. |
|
655 | 7017 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7018 |
" |
7019 |
||
7020 |
" |
|
7021 |
|dialog model field| |
|
7022 |
||
7023 |
model := SelectionInList new. |
|
7024 |
model list:#('foo' 'bar' 'baz'). |
|
7025 |
model selectionIndex:2. |
|
7026 |
||
7027 |
dialog := DialogBox new. |
|
7028 |
||
7029 |
field := dialog |
|
1401 | 7030 |
addLabelledField:(PopUpList on:model) label:'select here:' |
7031 |
adjust:#left |
|
7032 |
tabable:true |
|
7033 |
separateAtX:0.3. |
|
593 | 7034 |
|
7035 |
dialog addAbortButton; addOkButton. |
|
7036 |
dialog open. |
|
655 | 7037 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7038 |
" |
7039 |
||
7040 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7041 |
"Modified: 3.6.1996 / 18:48:49 / cg" |
593 | 7042 |
! |
7043 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7044 |
addMessage:labelString centered:centered |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7045 |
^ self addTextLabel:labelString |
2116 | 7046 |
|
7047 |
"Created: / 4.2.2000 / 00:03:24 / cg" |
|
7048 |
! |
|
7049 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7050 |
addMessage:labelString textLine:valueHolder boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7051 |
^ self |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7052 |
addMessage:labelString |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7053 |
textLine:valueHolder |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7054 |
type:nil |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7055 |
boundary:fraction |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7056 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7057 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7058 |
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
|
7059 |
|pos lbl field| |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7060 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7061 |
pos := self yPosition. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7062 |
lbl := self addTextLabel:labelString. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7063 |
lbl width:fraction. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7064 |
self yPosition:pos. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7065 |
field := self addInputFieldOn:valueHolder tabable:true. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7066 |
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
|
7067 |
typeSymbolOrNil == #password ifTrue:[ |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7068 |
field bePassword |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7069 |
]. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7070 |
^ field |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7071 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
7072 |
|
593 | 7073 |
addTextLabel:aString |
7074 |
"create a text label - the name has been choosen for ST-80 compatibility; |
|
7075 |
however, ST/X labels allow image labels too. |
|
7076 |
Returns the label." |
|
7077 |
||
7078 |
|l| |
|
7079 |
||
7080 |
l := Label new label:aString. |
|
7081 |
l borderWidth:0. |
|
7082 |
self addComponent:l. |
|
7083 |
^ l |
|
7084 |
||
7085 |
" |
|
7086 |
|b| |
|
7087 |
||
7088 |
b := DialogBox new. |
|
7089 |
b addTextLabel:'hello'. |
|
7090 |
b showAtPointer |
|
7091 |
" |
|
7092 |
" |
|
7093 |
|b| |
|
7094 |
||
7095 |
b := DialogBox new. |
|
7096 |
b leftIndent:100. |
|
7097 |
b addTextLabel:'hello'. |
|
7098 |
b leftIndent:0. |
|
7099 |
b addTextLabel:'world'. |
|
7100 |
b showAtPointer |
|
7101 |
" |
|
7102 |
" |
|
7103 |
|b| |
|
7104 |
||
7105 |
b := DialogBox new. |
|
7106 |
b addTextLabel:'hello'. |
|
7107 |
b addTextLabel:'world'. |
|
7108 |
b addOkButton. |
|
7109 |
b showAtPointer |
|
7110 |
" |
|
7111 |
" |
|
7112 |
|b| |
|
7113 |
||
7114 |
b := DialogBox new. |
|
7115 |
b addTextLabel:'hello'. |
|
7116 |
(b addTextLabel:'world') foregroundColor:Color red. |
|
7117 |
b addOkButton. |
|
7118 |
b showAtPointer |
|
7119 |
" |
|
7120 |
" |
|
7121 |
|b| |
|
7122 |
||
7123 |
b := DialogBox new. |
|
7124 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7125 |
b addOkButton. |
|
7126 |
b showAtPointer |
|
7127 |
" |
|
7128 |
" |
|
7129 |
|b| |
|
7130 |
||
7131 |
b := DialogBox new. |
|
7132 |
b addTextLabel:'hello world\\How about this ?' withCRs. |
|
7133 |
b addTextLabel:'not bad'. |
|
7134 |
b addAbortButton. |
|
7135 |
b addOkButton. |
|
7136 |
b showAtPointer |
|
7137 |
" |
|
7138 |
! |
|
7139 |
||
3908 | 7140 |
addTextLabelOn:aValueHolder |
7141 |
"create a text label showing the contents of a valueHolder. |
|
7142 |
Returns the label." |
|
7143 |
||
7144 |
|l| |
|
7145 |
||
7146 |
l := Label new labelChannel:aValueHolder. |
|
7147 |
l borderWidth:0. |
|
7148 |
self addComponent:l. |
|
7149 |
^ l |
|
7150 |
||
7151 |
" |
|
7152 |
|b| |
|
7153 |
||
7154 |
b := DialogBox new. |
|
7155 |
b addTextLabelOn:'hello' asValue. |
|
7156 |
b showAtPointer |
|
7157 |
" |
|
7158 |
" |
|
7159 |
|b| |
|
7160 |
||
7161 |
b := DialogBox new. |
|
7162 |
b leftIndent:100. |
|
7163 |
b addTextLabelOn:'hello' asValue. |
|
7164 |
b leftIndent:0. |
|
7165 |
b addTextLabelOn:'world' asValue. |
|
7166 |
b showAtPointer |
|
7167 |
" |
|
7168 |
! |
|
7169 |
||
593 | 7170 |
addToInputFieldGroup:aComponentOrSubcomponent |
7171 |
"add a component to the input group. |
|
7172 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7173 |
a topLevel component." |
|
7174 |
||
1355 | 7175 |
self |
1401 | 7176 |
addToInputFieldGroup:aComponentOrSubcomponent before:nil |
1355 | 7177 |
|
7178 |
"Modified: 18.10.1997 / 03:09:17 / cg" |
|
7179 |
! |
|
7180 |
||
7181 |
addToInputFieldGroup:aComponentOrSubcomponent before:anotherComponent |
|
7182 |
"add a component to the input group. |
|
7183 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7184 |
a topLevel component." |
|
7185 |
||
593 | 7186 |
inputFieldGroup isNil ifTrue:[ |
1759 | 7187 |
inputFieldGroup := EnterFieldGroup new. |
7188 |
inputFieldGroup leaveAction:[self lastFieldLeft]. |
|
7189 |
"/ |
|
7190 |
"/ the first inputField gets the focus initially |
|
7191 |
"/ |
|
7192 |
aComponentOrSubcomponent hasKeyboardFocus:true. |
|
593 | 7193 |
]. |
1355 | 7194 |
inputFieldGroup add:aComponentOrSubcomponent before:anotherComponent. |
593 | 7195 |
self delegate:(KeyboardForwarder to:inputFieldGroup condition:#noFocus). |
7196 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7197 |
"/ inputFields isNil ifTrue:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7198 |
"/ inputFields := OrderedCollection new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7199 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7200 |
"/ "/ 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
|
7201 |
"/ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7202 |
"/ aComponentOrSubcomponent showCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7203 |
"/ aComponentOrSubcomponent hasKeyboardFocus:true. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7204 |
"/ ] ifFalse:[ |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7205 |
"/ aComponentOrSubcomponent hideCursor. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7206 |
"/ aComponentOrSubcomponent hasKeyboardFocus:false. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7207 |
"/ ]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7208 |
"/ inputFields add:aComponentOrSubcomponent |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7209 |
|
1355 | 7210 |
"Modified: 18.10.1997 / 02:47:20 / cg" |
7211 |
"Created: 18.10.1997 / 03:08:51 / cg" |
|
7212 |
! |
|
7213 |
||
7214 |
removeFromInputFieldGroup:aComponentOrSubcomponent |
|
7215 |
"remove a component from the input group. |
|
7216 |
The argument, aComponentOrSubcomponent may even be a nested subcomponent of |
|
7217 |
a topLevel component." |
|
7218 |
||
7219 |
inputFieldGroup isNil ifTrue:[^ self]. |
|
7220 |
inputFieldGroup remove:aComponentOrSubcomponent. |
|
7221 |
||
7222 |
"Created: 18.10.1997 / 02:51:30 / cg" |
|
593 | 7223 |
! ! |
7224 |
||
7225 |
!DialogBox methodsFor:'construction-buttons'! |
|
7226 |
||
1763 | 7227 |
addAbortAndOkButtons |
7228 |
"create both abort- and Ok Buttons" |
|
7229 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7230 |
self |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7231 |
addAbortButtonLabelled:nil; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7232 |
addOkButtonLabelled:nil |
1763 | 7233 |
! |
7234 |
||
197 | 7235 |
addAbortButton |
7236 |
"create an abortButton - to be sent from redefined initialize |
|
162 | 7237 |
methods in subclasses or when creating a box programmatically. |
7238 |
Returns the button." |
|
7239 |
||
197 | 7240 |
^ self addAbortButtonLabelled:nil |
122 | 7241 |
! |
120 | 7242 |
|
162 | 7243 |
addAbortButton:aButton |
7244 |
"add an already created abortButton - to be sent from redefined initialize |
|
7245 |
methods in subclasses or when creating a box programmatically. |
|
7246 |
Returns the button." |
|
7247 |
||
7248 |
abortButton := aButton. |
|
7249 |
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
|
7250 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7251 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7252 |
"/ 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
|
7253 |
|
2698 | 7254 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7255 |
"/ 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
|
7256 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7257 |
"/ 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
|
7258 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7259 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7260 |
self addButton:aButton before:nil. |
1763 | 7261 |
^ aButton. |
162 | 7262 |
|
7263 |
"Created: 17.9.1995 / 20:17:26 / claus" |
|
7264 |
! |
|
7265 |
||
122 | 7266 |
addAbortButtonLabelled:buttonLabel |
7267 |
"create an abortButton with a label - to be sent from redefined initialize |
|
7268 |
methods in subclasses or when creating a box programmatically. |
|
7269 |
A nil argument creates one with the default label. |
|
7270 |
Returns the button." |
|
7271 |
||
162 | 7272 |
|aButton| |
7273 |
||
7274 |
aButton := Button abortButton. |
|
7275 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7276 |
^ self addAbortButton:aButton |
|
7277 |
||
344
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| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7280 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7281 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7282 |
dialog addAbortButtonLabelled:'get out of here'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7283 |
dialog addOkButtonLabelled:'yes thats ok'. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7284 |
dialog open. |
655 | 7285 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7286 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7287 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7288 |
"Modified: 9.2.1996 / 22:09:40 / cg" |
120 | 7289 |
! |
76 | 7290 |
|
197 | 7291 |
addButton:aButton |
7292 |
"add a button into the buttonPanel. |
|
122 | 7293 |
Returns the button." |
120 | 7294 |
|
3050 | 7295 |
"/ ^ self addButton:aButton after:nil |
7296 |
(self class defaultOKButtonAtLeft) ifFalse:[ |
|
7297 |
^ self addButton:aButton before:nil |
|
7298 |
] ifTrue:[ |
|
7299 |
^ self addButton:aButton after:nil |
|
7300 |
]. |
|
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 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7304 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7305 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7306 |
dialog addAbortButton. |
655 | 7307 |
dialog addButton:(Button label:'foo' action:[Transcript showCR:'foo']). |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7308 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7309 |
dialog open. |
655 | 7310 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7311 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7312 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7313 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7314 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7315 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7316 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7317 |
dialog addAbortButton. |
655 | 7318 |
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
|
7319 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7320 |
dialog open. |
655 | 7321 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7322 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7323 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7324 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7325 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7326 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7327 |
dialog := DialogBox new. |
655 | 7328 |
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
|
7329 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7330 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7331 |
dialog open. |
655 | 7332 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7333 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7334 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7335 |
"Modified: 9.2.1996 / 22:14:17 / cg" |
197 | 7336 |
! |
7337 |
||
7338 |
addButton:aButton after:someOtherButtonOrNil |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7339 |
"add a button into the buttonPanel. |
197 | 7340 |
If the argument someOtherButtonOrNil is nil, the button is |
7341 |
added at the end." |
|
7342 |
||
7343 |
|h| |
|
7344 |
||
7345 |
buttonPanel addSubView:aButton after:someOtherButtonOrNil. |
|
7346 |
buttonPanel subViews size > 1 ifTrue:[ |
|
1843 | 7347 |
buttonPanel horizontalLayout:#fitSpace. |
197 | 7348 |
]. |
7349 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
|
1843 | 7350 |
buttonPanel topInset:h negated |
197 | 7351 |
]. |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7352 |
needResize := true. |
197 | 7353 |
^ aButton |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
7354 |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7355 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7356 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7357 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7358 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7359 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7360 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7361 |
dialog addButton:(Button |
1843 | 7362 |
label:'foo' |
7363 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7364 |
after:(dialog okButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7365 |
dialog open. |
655 | 7366 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7367 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7368 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7369 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7370 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7371 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7372 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7373 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7374 |
dialog addButton:(Button |
1843 | 7375 |
label:'foo' |
7376 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7377 |
after:(dialog abortButton). |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7378 |
dialog open. |
655 | 7379 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7380 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7381 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7382 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7383 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7384 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7385 |
dialog addAbortButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7386 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7387 |
dialog addButton:(Button |
1843 | 7388 |
label:'foo' |
7389 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7390 |
after:nil. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7391 |
dialog open. |
655 | 7392 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7393 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7394 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7395 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
197 | 7396 |
! |
7397 |
||
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7398 |
addButton:aButton before:someOtherButtonOrNil |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7399 |
"add a button into the buttonPanel. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7400 |
If the argument someOtherButtonOrNil is nil, the button is |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7401 |
added upFront." |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7402 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7403 |
|h| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7404 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7405 |
buttonPanel addSubView:aButton before:someOtherButtonOrNil. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7406 |
buttonPanel subViews size > 1 ifTrue:[ |
1843 | 7407 |
buttonPanel horizontalLayout:#fitSpace. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7408 |
]. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7409 |
(h := (aButton heightIncludingBorder + (ViewSpacing * 2))) > buttonPanel topInset ifTrue:[ |
1843 | 7410 |
buttonPanel topInset:h negated |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7411 |
]. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
7412 |
preferredExtent := nil. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7413 |
needResize := true. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7414 |
^ aButton |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7415 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7416 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7417 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7418 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7419 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7420 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7421 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7422 |
dialog addButton:(Button |
1843 | 7423 |
label:'foo' |
7424 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7425 |
before:(dialog okButton). |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7426 |
dialog open. |
655 | 7427 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7428 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7429 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7430 |
|dialog| |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7431 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7432 |
dialog := DialogBox new. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7433 |
dialog addAbortButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7434 |
dialog addOkButton. |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7435 |
dialog addButton:(Button |
1843 | 7436 |
label:'foo' |
7437 |
action:[dialog hide. Transcript showCR:'foo']) |
|
7438 |
before:nil. |
|
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7439 |
dialog open. |
655 | 7440 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
353
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7441 |
" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7442 |
|
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7443 |
"Modified: 9.2.1996 / 22:13:51 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7444 |
"Created: 10.2.1996 / 16:04:35 / cg" |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7445 |
! |
f93d08174b61
added #addHelpButton; added #addButton:before:
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
7446 |
|
593 | 7447 |
addHelpButtonFor:pathToHelpText |
7448 |
"add a help button to the buttonPanel. |
|
7449 |
The argument, pathToHelpText should specify the path to the help |
|
7450 |
text under either the doc/online/<language> or the help/<language> |
|
7451 |
directory." |
|
7452 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7453 |
^ self addHelpButtonWithAction:[HTMLDocumentView openFullOnHelpFile:pathToHelpText]. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7454 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7455 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7456 |
|box| |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7457 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7458 |
box := DialogBox new. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7459 |
box |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7460 |
addHelpButtonFor:'Launcher/compilerSettings.html'; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7461 |
addAbortButton; |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7462 |
addOkButton. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7463 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7464 |
box open |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7465 |
" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7466 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7467 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7468 |
"Modified: / 26-01-2011 / 18:04:53 / cg" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7469 |
! |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7470 |
|
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7471 |
addHelpButtonWithAction:helpAction |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7472 |
"add a help button to the buttonPanel. |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7473 |
The argument, helpAction is avaluated when clicked" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7474 |
|
593 | 7475 |
|helpButton| |
7476 |
||
2478 | 7477 |
helpButton := Button label:(resources string:'Help'). |
593 | 7478 |
helpButton action:[ |
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7479 |
self withWaitCursorDo:helpAction |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7480 |
]. |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7481 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7482 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7483 |
"/ 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
|
7484 |
|
2698 | 7485 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7486 |
"/ 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
|
7487 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7488 |
"/ 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
|
7489 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7490 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7491 |
self addButton:helpButton before:nil. |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7492 |
^ helpButton |
593 | 7493 |
|
7494 |
" |
|
7495 |
|box| |
|
7496 |
||
7497 |
box := DialogBox new. |
|
7498 |
box |
|
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7499 |
addHelpButtonWithAction:[ Transcript flash ]; |
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7500 |
addAbortButton; |
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7501 |
addOkButton. |
593 | 7502 |
|
7503 |
box open |
|
7504 |
" |
|
7505 |
||
4220
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7506 |
"Modified: / 09-09-1996 / 22:40:21 / stefan" |
9d4156203a02
added: #addHelpButtonWithAction:
Claus Gittinger <cg@exept.de>
parents:
4219
diff
changeset
|
7507 |
"Created: / 26-01-2011 / 18:04:16 / cg" |
593 | 7508 |
! |
7509 |
||
2116 | 7510 |
addOK:checkBlock |
7511 |
|butt| |
|
7512 |
||
7513 |
butt := self addOkButton. |
|
7514 |
"/ what is checkBlock ? |
|
7515 |
^ butt |
|
7516 |
||
7517 |
"Modified: / 4.2.2000 / 00:09:15 / cg" |
|
7518 |
! |
|
7519 |
||
593 | 7520 |
addOkButton |
7521 |
"create an okButton - to be sent from redefined initialize |
|
7522 |
methods in subclasses or when creating a box programmatically. |
|
7523 |
Returns the button." |
|
7524 |
||
7525 |
^ self addOkButtonLabelled:nil |
|
7526 |
||
7527 |
" |
|
7528 |
|dialog| |
|
7529 |
||
7530 |
dialog := DialogBox new. |
|
7531 |
dialog addOkButton. |
|
7532 |
dialog open. |
|
655 | 7533 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7534 |
" |
7535 |
||
7536 |
"Modified: 9.2.1996 / 21:37:02 / cg" |
|
7537 |
! |
|
7538 |
||
7539 |
addOkButton:aButton |
|
7540 |
"add an already created okButton - to be sent from redefined initialize |
|
7541 |
methods in subclasses or when creating a box programmatically. |
|
7542 |
Returns the button." |
|
7543 |
||
1764 | 7544 |
"/ okButton isNil ifTrue:[ |
7545 |
okButton := aButton. |
|
7546 |
"/ ]. |
|
593 | 7547 |
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
|
7548 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7549 |
"/ changed: |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7550 |
"/ 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
|
7551 |
|
2698 | 7552 |
"/ (Dialog defaultOKButtonAtLeft) ifTrue:[ |
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7553 |
"/ 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
|
7554 |
"/ ] ifFalse:[ |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7555 |
"/ 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
|
7556 |
"/ ]. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7557 |
|
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
7558 |
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
|
7559 |
|
1760
631f902aaabe
care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents:
1759
diff
changeset
|
7560 |
^ aButton. |
593 | 7561 |
|
7562 |
" |
|
7563 |
|dialog b| |
|
7564 |
||
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2361
diff
changeset
|
7565 |
b := Button label:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedBy:0.5). |
593 | 7566 |
|
7567 |
dialog := DialogBox new. |
|
7568 |
dialog addOkButton:b. |
|
7569 |
dialog open. |
|
655 | 7570 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7571 |
" |
7572 |
||
7573 |
"Modified: 17.9.1995 / 20:20:41 / claus" |
|
7574 |
"Modified: 9.2.1996 / 21:38:48 / cg" |
|
7575 |
! |
|
7576 |
||
7577 |
addOkButtonLabelled:buttonLabel |
|
7578 |
"create an okButton with a label - to be sent from redefined initialize |
|
7579 |
methods in subclasses or when creating a box programmatically. |
|
7580 |
A nil argument creates one with the default text. |
|
7581 |
Returns the button." |
|
7582 |
||
7583 |
|aButton| |
|
7584 |
||
7585 |
aButton := Button okButton. |
|
7586 |
buttonLabel notNil ifTrue:[aButton label:buttonLabel]. |
|
7587 |
aButton isReturnButton:acceptReturnAsOK. |
|
7588 |
^ self addOkButton:aButton. |
|
7589 |
||
7590 |
" |
|
7591 |
|dialog| |
|
7592 |
||
7593 |
dialog := DialogBox new. |
|
7594 |
dialog addOkButtonLabelled:'get out of here'. |
|
7595 |
dialog open. |
|
655 | 7596 |
dialog accepted ifTrue:[Transcript showCR:'yes']. |
593 | 7597 |
" |
7598 |
||
7599 |
"Modified: 9.2.1996 / 21:39:34 / cg" |
|
7600 |
! ! |
|
7601 |
||
7602 |
!DialogBox methodsFor:'construction-check & comboboxes'! |
|
7603 |
||
197 | 7604 |
addCheckBox:label on:aModel |
7605 |
"create a checkBox with label on aModel and add it. |
|
7606 |
Returns the box." |
|
7607 |
||
7608 |
^ self addCheckBox:label on:aModel tabable:true |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7609 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7610 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7611 |
|dialog check| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7612 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7613 |
check := true asValue. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7614 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7615 |
dialog := DialogBox new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7616 |
dialog addCheckBox:'on or off' on:check. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7617 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7618 |
dialog open. |
655 | 7619 |
dialog accepted ifTrue:[Transcript showCR:check value]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7620 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7621 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7622 |
"Modified: 9.2.1996 / 22:15:38 / cg" |
197 | 7623 |
! |
7624 |
||
600 | 7625 |
addCheckBox:label on:aModel tabable:tabable |
7626 |
"create a checkBox with label on aModel and add it. |
|
7627 |
Returns the box." |
|
7628 |
||
7629 |
|b| |
|
7630 |
||
7631 |
b := CheckBox on:aModel. |
|
7632 |
b label:label. |
|
7633 |
self addComponent:b tabable:tabable. |
|
7634 |
^ b |
|
7635 |
||
7636 |
" |
|
7637 |
|dialog check1 check2 check3| |
|
7638 |
||
7639 |
check1 := true asValue. |
|
7640 |
check2 := false asValue. |
|
7641 |
check3 := true asValue. |
|
7642 |
||
7643 |
dialog := DialogBox new. |
|
7644 |
dialog addCheckBox:'on or off' on:check1 tabable:false. |
|
7645 |
dialog addHorizontalLine. |
|
7646 |
||
7647 |
dialog addCheckBox:'on or off' on:check2 tabable:true. |
|
7648 |
dialog addCheckBox:'on or off' on:check3 tabable:true. |
|
7649 |
dialog addOkButton. |
|
7650 |
dialog open. |
|
7651 |
" |
|
7652 |
||
7653 |
"Modified: 9.2.1996 / 22:16:49 / cg" |
|
7654 |
! |
|
7655 |
||
593 | 7656 |
addComboBoxOn:aModel |
7657 |
"create a comboBoxView on aModel and add it. |
|
7658 |
Returns the comboBoxView." |
|
7659 |
||
7660 |
^ self addComboBoxOn:aModel tabable:true |
|
7661 |
||
7662 |
" |
|
7663 |
without a list, the comboBox is disabled: |
|
7664 |
||
7665 |
|box val| |
|
7666 |
||
7667 |
val := 'some input' asValue. |
|
7668 |
||
7669 |
box := Dialog new. |
|
7670 |
||
7671 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7672 |
box addVerticalSpace. |
|
7673 |
(box addComboBoxOn:val). |
|
7674 |
box addOkButton. |
|
7675 |
box open. |
|
7676 |
box accepted ifTrue:[ |
|
1401 | 7677 |
Transcript showCR:val value |
593 | 7678 |
]. |
7679 |
" |
|
7680 |
||
7681 |
"with a list, it can be pulled: |
|
7682 |
||
7683 |
|box val| |
|
7684 |
||
7685 |
val := '' asValue. |
|
7686 |
||
7687 |
box := Dialog new. |
|
7688 |
||
7689 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7690 |
box addVerticalSpace. |
|
7691 |
(box addComboBoxOn:val) list:#('one' 'two' 'three' 'four'). |
|
7692 |
box addOkButton. |
|
7693 |
box open. |
|
7694 |
box accepted ifTrue:[ |
|
1401 | 7695 |
Transcript showCR:val value |
593 | 7696 |
]. |
7697 |
" |
|
7698 |
||
7699 |
"Modified: 28.2.1996 / 15:17:39 / cg" |
|
7700 |
"Created: 4.3.1996 / 17:21:45 / cg" |
|
7701 |
! |
|
7702 |
||
7703 |
addComboBoxOn:aModel tabable:tabable |
|
7704 |
"create a comboBoxView on aModel and add it. |
|
7705 |
Returns the comboBoxView." |
|
7706 |
||
7707 |
|f| |
|
7708 |
||
7709 |
f := ComboBoxView new. |
|
7710 |
f model:aModel. |
|
7711 |
self addComponent:f tabable:tabable. |
|
7712 |
tabable ifTrue:[ |
|
1401 | 7713 |
self addToInputFieldGroup:f editor. |
593 | 7714 |
]. |
7715 |
^ f |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7716 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7717 |
" |
593 | 7718 |
without a list, the comboBox is disabled: |
7719 |
||
7720 |
|box val| |
|
7721 |
||
7722 |
val := 'some input' asValue. |
|
7723 |
||
7724 |
box := Dialog new. |
|
7725 |
||
7726 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7727 |
box addVerticalSpace. |
|
7728 |
(box addComboBoxOn:val tabable:true). |
|
7729 |
box addOkButton. |
|
7730 |
box open. |
|
7731 |
box accepted ifTrue:[ |
|
1401 | 7732 |
Transcript showCR:val value |
593 | 7733 |
]. |
7734 |
" |
|
7735 |
||
7736 |
"with a list, it can be pulled: |
|
7737 |
||
7738 |
|box val| |
|
7739 |
||
7740 |
val := '' asValue. |
|
7741 |
||
7742 |
box := Dialog new. |
|
7743 |
||
7744 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7745 |
box addVerticalSpace. |
|
7746 |
(box addComboBoxOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7747 |
box addOkButton. |
|
7748 |
box open. |
|
7749 |
box accepted ifTrue:[ |
|
1401 | 7750 |
Transcript showCR:val value |
593 | 7751 |
]. |
7752 |
" |
|
7753 |
||
7754 |
"Modified: 4.3.1996 / 17:21:57 / cg" |
|
7755 |
! |
|
7756 |
||
7757 |
addComboListOn:aModel |
|
7758 |
"create a comboListView on aModel and add it. |
|
7759 |
Returns the comboListView." |
|
7760 |
||
7761 |
^ self addComboListOn:aModel tabable:true |
|
7762 |
||
7763 |
"without a list, the comboList is disabled: |
|
7764 |
||
7765 |
|box val| |
|
7766 |
||
7767 |
val := 'some input' asValue. |
|
7768 |
||
7769 |
box := Dialog new. |
|
7770 |
||
7771 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7772 |
box addVerticalSpace. |
|
7773 |
(box addComboListOn:val). |
|
7774 |
box addOkButton. |
|
7775 |
box open. |
|
7776 |
box accepted ifTrue:[ |
|
1401 | 7777 |
Transcript showCR:val value |
593 | 7778 |
]. |
7779 |
" |
|
7780 |
||
7781 |
"with a list, it can be pulled: |
|
7782 |
||
7783 |
|box val| |
|
7784 |
||
7785 |
val := '' asValue. |
|
7786 |
||
7787 |
box := Dialog new. |
|
7788 |
||
7789 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7790 |
box addVerticalSpace. |
|
7791 |
(box addComboListOn:val) list:#('one' 'two' 'three' 'four'). |
|
7792 |
box addOkButton. |
|
7793 |
box open. |
|
7794 |
box accepted ifTrue:[ |
|
1401 | 7795 |
Transcript showCR:val value |
593 | 7796 |
]. |
7797 |
" |
|
7798 |
||
7799 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7800 |
"Modified: 4.3.1996 / 17:22:59 / cg" |
|
7801 |
! |
|
7802 |
||
7803 |
addComboListOn:aModel tabable:tabable |
|
7804 |
"create a comboListView on aModel and add it. |
|
7805 |
Returns the comboListView." |
|
7806 |
||
7807 |
|f| |
|
7808 |
||
7809 |
f := ComboListView new. |
|
7810 |
f model:aModel. |
|
7811 |
self addComponent:f tabable:tabable. |
|
7812 |
^ f |
|
7813 |
||
7814 |
"without a list, the comboList is disabled: |
|
7815 |
||
7816 |
|box val| |
|
7817 |
||
7818 |
val := 'some input' asValue. |
|
7819 |
||
7820 |
box := Dialog new. |
|
7821 |
||
7822 |
(box addTextLabel:'combo list example') adjust:#left. |
|
7823 |
box addVerticalSpace. |
|
7824 |
(box addComboListOn:val tabable:true). |
|
7825 |
box addOkButton. |
|
7826 |
box open. |
|
7827 |
box accepted ifTrue:[ |
|
1401 | 7828 |
Transcript showCR:val value |
593 | 7829 |
]. |
7830 |
" |
|
7831 |
||
7832 |
"with a list, it can be pulled: |
|
7833 |
||
7834 |
|box val| |
|
7835 |
||
7836 |
val := '' asValue. |
|
7837 |
||
7838 |
box := Dialog new. |
|
7839 |
||
7840 |
(box addTextLabel:'combo box example') adjust:#left. |
|
7841 |
box addVerticalSpace. |
|
7842 |
(box addComboListOn:val tabable:true) list:#('one' 'two' 'three' 'four'). |
|
7843 |
box addOkButton. |
|
7844 |
box open. |
|
7845 |
box accepted ifTrue:[ |
|
1401 | 7846 |
Transcript showCR:val value |
593 | 7847 |
]. |
7848 |
" |
|
7849 |
||
7850 |
"Created: 28.2.1996 / 15:16:34 / cg" |
|
7851 |
"Modified: 4.3.1996 / 17:23:38 / cg" |
|
7852 |
! ! |
|
7853 |
||
7854 |
!DialogBox methodsFor:'construction-inputfields'! |
|
7855 |
||
7856 |
addFilenameInputFieldOn:aModel in:aDirectory tabable:tabable |
|
7857 |
"create a fileName input field on aModel and add it. |
|
7858 |
Returns the field. This is much like a normal input field, |
|
7859 |
but supports filename completion." |
|
7860 |
||
7861 |
|f| |
|
7862 |
||
7863 |
f := FilenameEditField new. |
|
7864 |
aDirectory notNil ifTrue:[f directory:aDirectory]. |
|
7865 |
f model:aModel. |
|
7866 |
self addInputField:f tabable:tabable. |
|
7867 |
^ f |
|
7868 |
! |
|
7869 |
||
7870 |
addInputField:aField |
|
7871 |
"add an already created input field. |
|
7872 |
Returns the field." |
|
7873 |
||
7874 |
^ self addInputField:aField tabable:true |
|
7875 |
||
7876 |
"Modified: 9.2.1996 / 20:46:16 / cg" |
|
7877 |
! |
|
7878 |
||
7879 |
addInputField:aField tabable:tabable |
|
7880 |
"add an already created input field. |
|
7881 |
If tabable is true, the field is put into a group, to allow |
|
7882 |
stepping through the fields with #Cursor/#Return keys. |
|
7883 |
Returns the field." |
|
7884 |
||
7885 |
self addComponent:aField tabable:tabable. |
|
7886 |
tabable ifTrue:[ |
|
1401 | 7887 |
self addToInputFieldGroup:aField. |
593 | 7888 |
]. |
7889 |
^ aField |
|
7890 |
||
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
7891 |
"Modified: 31.5.1996 / 21:22:29 / cg" |
593 | 7892 |
! |
7893 |
||
7894 |
addInputFieldOn:aModel |
|
7895 |
"create an input field on aModel and add it. |
|
7896 |
Returns the field." |
|
7897 |
||
7898 |
^ self addInputFieldOn:aModel tabable:true |
|
7899 |
||
7900 |
" |
|
7901 |
|dialog model field| |
|
7902 |
||
7903 |
model := '' asValue. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7904 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
7905 |
dialog := DialogBox new. |
593 | 7906 |
(dialog addTextLabel:'enter a string') adjust:#left. |
7907 |
||
7908 |
field := dialog addInputFieldOn:model. |
|
7909 |
||
7910 |
dialog addAbortButton; addOkButton. |
|
7911 |
dialog open. |
|
655 | 7912 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7913 |
" |
7914 |
||
7915 |
"Modified: 9.2.1996 / 21:34:14 / cg" |
|
7916 |
! |
|
7917 |
||
7918 |
addInputFieldOn:aModel tabable:tabable |
|
7919 |
"create an input field on aModel and add it. |
|
7920 |
If tabable is false, the field cannot be tabbed into |
|
7921 |
and return does not close the box. |
|
7922 |
(pointer must be moved into it). |
|
7923 |
Returns the field." |
|
7924 |
||
7925 |
|f| |
|
7926 |
||
913 | 7927 |
f := EditField model:aModel. |
593 | 7928 |
self addInputField:f tabable:tabable. |
7929 |
^ f |
|
7930 |
||
7931 |
" a non-tabable field: |
|
7932 |
||
7933 |
|dialog model field| |
|
7934 |
||
7935 |
model := '' asValue. |
|
7936 |
||
7937 |
dialog := DialogBox new. |
|
7938 |
(dialog addTextLabel:'enter a string') adjust:#left. |
|
7939 |
||
7940 |
field := dialog addInputFieldOn:model tabable:false. |
|
7941 |
||
7942 |
dialog addAbortButton; addOkButton. |
|
7943 |
dialog open. |
|
655 | 7944 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 7945 |
" |
7946 |
||
7947 |
"Modified: 9.2.1996 / 21:36:16 / cg" |
|
913 | 7948 |
"Modified: 3.1.1997 / 10:24:04 / stefan" |
593 | 7949 |
! |
7950 |
||
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7951 |
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
|
7952 |
"add a label and an inputField side-by-side. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7953 |
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
|
7954 |
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
|
7955 |
The inputField gets model as its model. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7956 |
Return the inputField." |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7957 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7958 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7959 |
^ self |
1401 | 7960 |
addLabelledField:(EditField on:model) label:labelString |
7961 |
adjust:labelAdjust |
|
7962 |
tabable:tabable |
|
7963 |
from:leftX to:rightX |
|
7964 |
separateAtX:relativeX. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7965 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7966 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7967 |
|dialog model field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7968 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7969 |
model := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7970 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7971 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7972 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7973 |
field := dialog |
1401 | 7974 |
addLabelledInputField:'enter a string' |
7975 |
adjust:#left |
|
7976 |
on:model |
|
7977 |
tabable:true |
|
7978 |
separateAtX:0.3. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7979 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7980 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7981 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7982 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7983 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7984 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7985 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7986 |
|dialog model1 model2 field| |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7987 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7988 |
model1 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7989 |
model2 := '' asValue. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7990 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7991 |
dialog := DialogBox new. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7992 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7993 |
dialog addTextLabel:'a two-input box'. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7994 |
dialog addHorizontalLine. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7995 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
7996 |
field := dialog |
1401 | 7997 |
addLabelledInputField:'string1:' |
7998 |
adjust:#right |
|
7999 |
on:model1 |
|
8000 |
tabable:true |
|
8001 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8002 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8003 |
field := dialog |
1401 | 8004 |
addLabelledInputField:'string2:' |
8005 |
adjust:#right |
|
8006 |
on:model2 |
|
8007 |
tabable:true |
|
8008 |
separateAtX:0.4. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8009 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8010 |
dialog addAbortButton; addOkButton. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8011 |
dialog open. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8012 |
dialog accepted ifTrue:[ |
1401 | 8013 |
Transcript showCR:model1 value. |
8014 |
Transcript showCR:model2 value. |
|
745
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8015 |
]. |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8016 |
" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8017 |
|
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8018 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8019 |
"Created: 3.6.1996 / 11:04:23 / cg" |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8020 |
! |
9838e65744d0
allow partial-labelled inputFields
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
8021 |
|
593 | 8022 |
addLabelledInputField:labelString adjust:labelAdjust on:model tabable:tabable separateAtX:relativeX |
8023 |
"add a label and an inputField side-by-side. |
|
8024 |
The labels goes from 0.0 to relativeX; the inputField from relativeX to 1.0. |
|
8025 |
The labels string is defined by labelString and adjusted according to labelAdjust. |
|
8026 |
The inputField gets model as its model. |
|
8027 |
Return the inputField." |
|
8028 |
||
8029 |
||
8030 |
^ self |
|
1401 | 8031 |
addLabelledField:(EditField on:model) label:labelString |
8032 |
adjust:labelAdjust |
|
8033 |
tabable:tabable |
|
8034 |
separateAtX:relativeX. |
|
593 | 8035 |
|
8036 |
" |
|
8037 |
|dialog model field| |
|
8038 |
||
8039 |
model := '' asValue. |
|
8040 |
||
8041 |
dialog := DialogBox new. |
|
8042 |
||
8043 |
field := dialog |
|
1401 | 8044 |
addLabelledInputField:'enter a string' |
8045 |
adjust:#left |
|
8046 |
on:model |
|
8047 |
tabable:true |
|
8048 |
separateAtX:0.3. |
|
593 | 8049 |
|
8050 |
dialog addAbortButton; addOkButton. |
|
8051 |
dialog open. |
|
655 | 8052 |
dialog accepted ifTrue:[Transcript showCR:model value]. |
593 | 8053 |
" |
8054 |
||
8055 |
" |
|
8056 |
|dialog model1 model2 field| |
|
8057 |
||
8058 |
model1 := '' asValue. |
|
8059 |
model2 := '' asValue. |
|
8060 |
||
8061 |
dialog := DialogBox new. |
|
8062 |
||
8063 |
dialog addTextLabel:'a two-input box'. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8064 |
dialog addHorizontalLine. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8065 |
|
593 | 8066 |
field := dialog |
1401 | 8067 |
addLabelledInputField:'string1:' |
8068 |
adjust:#right |
|
8069 |
on:model1 |
|
8070 |
tabable:true |
|
8071 |
separateAtX:0.4. |
|
593 | 8072 |
|
8073 |
field := dialog |
|
1401 | 8074 |
addLabelledInputField:'string2:' |
8075 |
adjust:#right |
|
8076 |
on:model2 |
|
8077 |
tabable:true |
|
8078 |
separateAtX:0.4. |
|
593 | 8079 |
|
8080 |
dialog addAbortButton; addOkButton. |
|
8081 |
dialog open. |
|
8082 |
dialog accepted ifTrue:[ |
|
1401 | 8083 |
Transcript showCR:model1 value. |
8084 |
Transcript showCR:model2 value. |
|
593 | 8085 |
]. |
8086 |
" |
|
8087 |
||
8088 |
"Created: 13.4.1996 / 13:41:31 / cg" |
|
8089 |
"Modified: 19.4.1996 / 17:39:46 / cg" |
|
8090 |
! ! |
|
8091 |
||
8092 |
!DialogBox methodsFor:'construction-layout'! |
|
8093 |
||
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8094 |
addGap |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8095 |
"VW compatibility" |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8096 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8097 |
self addGap:4 |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8098 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
8099 |
|
2116 | 8100 |
addGap:pixels |
8101 |
"VW compatibility" |
|
8102 |
||
8103 |
self addVerticalSpace:pixels |
|
8104 |
||
8105 |
"Created: / 4.2.2000 / 00:03:58 / cg" |
|
8106 |
"Modified: / 5.2.2000 / 15:30:26 / cg" |
|
8107 |
! |
|
8108 |
||
593 | 8109 |
addHorizontalLine |
8110 |
"add a horizontal line as separator" |
|
8111 |
||
8112 |
^ self addComponent:(Separator new extent:1.0 @ 5). |
|
8113 |
||
8114 |
" |
|
8115 |
|dialog| |
|
8116 |
||
8117 |
dialog := DialogBox new. |
|
8118 |
dialog |
|
1401 | 8119 |
addTextLabel:'some title string'; |
8120 |
addHorizontalLine; |
|
8121 |
addTextLabel:'more text'; |
|
8122 |
addOkButton; |
|
8123 |
open. |
|
593 | 8124 |
" |
8125 |
||
8126 |
" |
|
8127 |
|dialog| |
|
8128 |
||
8129 |
dialog := DialogBox new. |
|
8130 |
dialog |
|
1401 | 8131 |
addTextLabel:'some title string'; |
8132 |
addHorizontalLine; |
|
8133 |
addTextLabel:'more text'. |
|
593 | 8134 |
(dialog addHorizontalLine) width:20. |
8135 |
dialog addTextLabel:'more text'. |
|
8136 |
(dialog addHorizontalLine) width:20. |
|
8137 |
dialog |
|
1401 | 8138 |
addTextLabel:'more text'; |
8139 |
addHorizontalLine; |
|
8140 |
addOkButton; |
|
8141 |
open. |
|
593 | 8142 |
" |
8143 |
||
8144 |
"Modified: 19.4.1996 / 15:11:30 / cg" |
|
8145 |
! |
|
8146 |
||
8147 |
addVerticalSpace |
|
8148 |
"add a default vertical space (1 mm)" |
|
8149 |
||
8150 |
self addVerticalSpace:(ViewSpacing). |
|
8151 |
||
8152 |
" |
|
8153 |
|dialog| |
|
8154 |
||
8155 |
dialog := DialogBox new. |
|
8156 |
dialog addTextLabel:'some title string'. |
|
8157 |
dialog addVerticalSpace. |
|
8158 |
dialog addTextLabel:'more text'. |
|
8159 |
||
8160 |
dialog addOkButton. |
|
8161 |
dialog open. |
|
8162 |
" |
|
8163 |
||
8164 |
"Modified: 9.2.1996 / 21:41:10 / cg" |
|
8165 |
! |
|
8166 |
||
8167 |
addVerticalSpace:nPixel |
|
8168 |
"add some pixels of space to the next component" |
|
8169 |
||
8170 |
yPosition := yPosition + nPixel. |
|
8171 |
needResize := true. |
|
8172 |
||
8173 |
" |
|
8174 |
|dialog| |
|
8175 |
||
8176 |
dialog := DialogBox new. |
|
8177 |
dialog addTextLabel:'some title string'. |
|
8178 |
dialog addVerticalSpace:50. |
|
8179 |
dialog addTextLabel:'more text'. |
|
8180 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8181 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8182 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8183 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8184 |
|
593 | 8185 |
"Modified: 9.2.1996 / 21:41:23 / cg" |
8186 |
! |
|
8187 |
||
2116 | 8188 |
bottomAlign:widgets |
8189 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8190 |
||
2145 | 8191 |
'DialogBox [warning]: unimplemented VW feature: #bottomAlign' infoPrintCR. |
8192 |
"/ self halt:'unimplemented VW functionality'. |
|
2116 | 8193 |
|
8194 |
"Created: / 4.2.2000 / 00:10:21 / cg" |
|
8195 |
"Modified: / 5.2.2000 / 15:31:23 / cg" |
|
8196 |
! |
|
8197 |
||
8198 |
bottomAlignLowerEdge:widget |
|
8199 |
"mhmh - seems similar to out stickAtBottom functionality - to be checked" |
|
8200 |
||
2145 | 8201 |
"/ self halt:'unimplemented VW functionality'. |
8202 |
self stickAtBottomWithVariableHeight:widget |
|
2116 | 8203 |
|
8204 |
"Modified: / 5.2.2000 / 15:31:15 / cg" |
|
8205 |
! |
|
8206 |
||
593 | 8207 |
leftIndent |
8208 |
"return the current indent |
|
8209 |
(current x position - thats where the next component will be located)." |
|
8210 |
||
8211 |
^ leftIndent |
|
8212 |
||
8213 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8214 |
! |
|
8215 |
||
8216 |
leftIndent:aNumber |
|
4145 | 8217 |
"set the left indent |
8218 |
(current x position - that's where the next component(s) will be located). |
|
8219 |
Setting this before adding a component will place it indented" |
|
593 | 8220 |
|
8221 |
leftIndent := aNumber. |
|
8222 |
needResize := true. |
|
8223 |
||
8224 |
" |
|
8225 |
|dialog| |
|
8226 |
||
8227 |
dialog := DialogBox new. |
|
8228 |
(dialog addTextLabel:'label1') adjust:#left. |
|
8229 |
dialog leftIndent:20. |
|
8230 |
(dialog addTextLabel:'label2') adjust:#left. |
|
8231 |
dialog leftIndent:40. |
|
8232 |
(dialog addTextLabel:'label3') adjust:#left. |
|
8233 |
dialog leftIndent:60. |
|
8234 |
(dialog addTextLabel:'label4') adjust:#left. |
|
8235 |
||
8236 |
dialog addOkButton. |
|
8237 |
dialog open. |
|
8238 |
" |
|
8239 |
||
8240 |
"Modified: 9.2.1996 / 21:42:20 / cg" |
|
8241 |
! |
|
8242 |
||
8243 |
rightIndent |
|
8244 |
"return the current right indent." |
|
8245 |
||
8246 |
^ rightIndent |
|
8247 |
||
8248 |
"Modified: 27.1.1996 / 18:21:31 / cg" |
|
8249 |
! |
|
8250 |
||
8251 |
rightIndent:aNumber |
|
8252 |
"set the right indent" |
|
8253 |
||
8254 |
rightIndent := aNumber. |
|
8255 |
needResize := true. |
|
8256 |
||
8257 |
" |
|
8258 |
|dialog| |
|
8259 |
||
8260 |
dialog := DialogBox new. |
|
8261 |
(dialog addTextLabel:'label1') adjust:#right. |
|
8262 |
dialog rightIndent:20. |
|
8263 |
(dialog addTextLabel:'label2') adjust:#right. |
|
8264 |
dialog rightIndent:40. |
|
8265 |
(dialog addTextLabel:'label3') adjust:#right. |
|
8266 |
dialog rightIndent:60. |
|
8267 |
(dialog addTextLabel:'label4') adjust:#right. |
|
8268 |
||
8269 |
dialog addOkButton. |
|
8270 |
dialog open. |
|
8271 |
" |
|
8272 |
||
8273 |
"Modified: 9.2.1996 / 21:42:46 / cg" |
|
8274 |
! |
|
8275 |
||
2116 | 8276 |
setInitialGap |
8277 |
||
8278 |
"Created: / 4.2.2000 / 00:01:44 / cg" |
|
8279 |
! |
|
8280 |
||
593 | 8281 |
stickAtBottomWithFixHeight:aComponent |
8282 |
"arrange for a component to be positioned at a constant offset |
|
8283 |
from the bottom of the box and its height to remain the same. |
|
8284 |
This will keep the component at a constant distance from the bottom |
|
2220 | 8285 |
(without this setup, it would stay at a constant offset from the top). |
8286 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8287 |
|
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8288 |
self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0 |
593 | 8289 |
|
8290 |
" |
|
8291 |
compare the resizing behavior of: |
|
8292 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8293 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8294 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8295 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8296 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8297 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8298 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8299 |
box show |
593 | 8300 |
|
8301 |
with: |
|
8302 |
||
1949
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8303 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8304 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8305 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8306 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8307 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8308 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8309 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8310 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8311 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8312 |
|
2220 | 8313 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8314 |
"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
|
8315 |
! |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8316 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8317 |
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
|
8318 |
"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
|
8319 |
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
|
8320 |
This will keep the component at a constant distance from the bottom |
2220 | 8321 |
(without this setup, it would stay at a constant offset from the top). |
8322 |
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
|
8323 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8324 |
self resize. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8325 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8326 |
aComponent |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8327 |
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
|
8328 |
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
|
8329 |
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
|
8330 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8331 |
" |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8332 |
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
|
8333 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8334 |
|box| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8335 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8336 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8337 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8338 |
box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8339 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8340 |
box show |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8341 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8342 |
with: |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8343 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8344 |
|box l2| |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8345 |
|
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8346 |
box := Dialog new. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8347 |
box addTextLabel:'hello'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8348 |
l2 := box addTextLabel:'hello2'. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8349 |
box addOkButton. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8350 |
box stickAtBottomWithFixHeight:l2. |
f8a1dfee9935
another stick method (allowing for left/right to be specified)
Claus Gittinger <cg@exept.de>
parents:
1898
diff
changeset
|
8351 |
box show |
593 | 8352 |
" |
8353 |
||
2220 | 8354 |
"Created: / 27.1.1996 / 17:17:41 / cg" |
8355 |
"Modified: / 18.8.2000 / 21:38:26 / cg" |
|
593 | 8356 |
! |
8357 |
||
8358 |
stickAtBottomWithVariableHeight:aComponent |
|
8359 |
"arrange for a component to be positioned at a constant offset |
|
8360 |
from the bottom of the box and its height to be adjusted. |
|
8361 |
This will resize the component for a constant distance from the top, |
|
8362 |
and the bottom. |
|
2220 | 8363 |
(without this setup, its height would remain constant). |
8364 |
ATTENTION: use this as a last step, after all components have been added." |
|
593 | 8365 |
|
8366 |
self resize. |
|
8367 |
||
8368 |
aComponent |
|
2220 | 8369 |
bottomInset:(self height - aComponent bottom); |
8370 |
corner:1.0@1.0. |
|
593 | 8371 |
|
8372 |
" |
|
8373 |
compare the resizing behavior of: |
|
8374 |
||
2220 | 8375 |
|box| |
8376 |
||
8377 |
box := Dialog new. |
|
8378 |
box addTextLabel:'hello'. |
|
8379 |
(box addComponent:(SelectionInListView new)) level:-1. |
|
8380 |
box addOkButton. |
|
8381 |
box show |
|
593 | 8382 |
|
8383 |
with: |
|
8384 |
||
2220 | 8385 |
|box list| |
8386 |
||
8387 |
box := Dialog new. |
|
8388 |
box addTextLabel:'hello'. |
|
8389 |
list := (box addComponent:(SelectionInListView new)) level:-1. |
|
8390 |
box addOkButton. |
|
8391 |
box stickAtBottomWithVariableHeight:list. |
|
8392 |
box show |
|
593 | 8393 |
" |
8394 |
||
2220 | 8395 |
"Modified: / 18.8.2000 / 21:38:35 / cg" |
593 | 8396 |
! |
8397 |
||
8398 |
yPosition |
|
8399 |
"return the current y position (thats where the next component |
|
8400 |
will be located)." |
|
8401 |
||
8402 |
^ yPosition |
|
120 | 8403 |
! |
8404 |
||
593 | 8405 |
yPosition:aNumber |
8406 |
"set the current y position (thats where the next component |
|
8407 |
will be located)." |
|
8408 |
||
8409 |
yPosition := aNumber. |
|
8410 |
needResize := true. |
|
8411 |
||
8412 |
" |
|
8413 |
|dialog pos| |
|
8414 |
||
8415 |
dialog := DialogBox new. |
|
8416 |
pos := dialog yPosition. |
|
8417 |
(dialog addTextLabel:'label1') width:0.5. |
|
8418 |
dialog yPosition:pos. |
|
8419 |
(dialog addTextLabel:'label2') width:0.5; left:0.5. |
|
8420 |
||
8421 |
dialog addOkButton. |
|
8422 |
dialog open. |
|
8423 |
" |
|
8424 |
||
8425 |
" |
|
8426 |
|dialog pos| |
|
8427 |
||
8428 |
dialog := DialogBox new. |
|
8429 |
pos := dialog yPosition. |
|
8430 |
#('one' 'two' 'three' 'four') |
|
8431 |
with:#(0.0 0.25 0.5 0.75) do:[:lbl :x | |
|
1401 | 8432 |
dialog yPosition:pos. |
8433 |
(dialog addComponent:(Button label:lbl) tabable:true) |
|
8434 |
width:0.25; left:x. |
|
593 | 8435 |
]. |
8436 |
||
8437 |
dialog addOkButton. |
|
8438 |
dialog open. |
|
8439 |
" |
|
8440 |
||
8441 |
"Modified: 9.2.1996 / 21:46:40 / cg" |
|
8442 |
! ! |
|
8443 |
||
8444 |
!DialogBox methodsFor:'construction-lists'! |
|
8445 |
||
2116 | 8446 |
addList:listHolder lines:nLines validation:validateionBlock |
8447 |
^ self |
|
8448 |
addListBoxOn:listHolder |
|
8449 |
withNumberOfLines:nLines |
|
8450 |
hScrollable:true |
|
8451 |
vScrollable:true |
|
8452 |
||
8453 |
"Created: / 4.2.2000 / 00:04:49 / cg" |
|
8454 |
"Modified: / 4.2.2000 / 00:06:06 / cg" |
|
8455 |
! |
|
8456 |
||
593 | 8457 |
addListBoxOn:aModel |
8458 |
"add a selectionInListView to the box. |
|
8459 |
The listViews ScrollWrapper is returned" |
|
8460 |
||
8461 |
^ self |
|
1401 | 8462 |
addListBoxOn:aModel |
8463 |
withNumberOfLines:nil |
|
8464 |
hScrollable:false |
|
8465 |
vScrollable:true. |
|
593 | 8466 |
|
8467 |
" |
|
8468 |
|dialog model listView| |
|
8469 |
||
8470 |
model := SelectionInList new. |
|
8471 |
model list:#('one' 'two' 'three' 'four'). |
|
8472 |
model selectionIndex:2. |
|
8473 |
||
8474 |
dialog := DialogBox new. |
|
8475 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8476 |
||
8477 |
listView := dialog addListBoxOn:model. |
|
8478 |
||
8479 |
dialog addAbortButton; addOkButton. |
|
8480 |
dialog open. |
|
8481 |
||
655 | 8482 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8483 |
" |
8484 |
||
8485 |
"Modified: 27.4.1996 / 18:27:58 / cg" |
|
8486 |
! |
|
8487 |
||
8488 |
addListBoxOn:aModel class:aListViewClass |
|
8489 |
"create & add an instance of aListViewClass to the box. |
|
8490 |
The listViews ScrollWrapper is returned" |
|
8491 |
||
8492 |
^ self |
|
1401 | 8493 |
addListBoxOn:aModel |
8494 |
class:aListViewClass |
|
8495 |
withNumberOfLines:nil |
|
8496 |
hScrollable:false |
|
8497 |
vScrollable:true. |
|
593 | 8498 |
|
8499 |
"Created: 19.4.1996 / 13:06:14 / cg" |
|
8500 |
"Modified: 27.4.1996 / 18:27:53 / cg" |
|
8501 |
! |
|
8502 |
||
8503 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines |
|
8504 |
"create and add an instance of aListViewClass to the box. |
|
8505 |
The list has numLines (if nonNil) number of lines shown. |
|
8506 |
The listViews ScrollWrapper is returned" |
|
8507 |
||
8508 |
^ self |
|
1401 | 8509 |
addListBoxOn:aModel |
8510 |
class:aListViewClass |
|
8511 |
withNumberOfLines:numLines |
|
8512 |
hScrollable:false |
|
8513 |
vScrollable:true. |
|
593 | 8514 |
|
8515 |
"Created: 19.4.1996 / 13:05:05 / cg" |
|
8516 |
"Modified: 27.4.1996 / 18:27:48 / cg" |
|
8517 |
! |
|
8518 |
||
8519 |
addListBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
766 | 8520 |
"add an instance of aListViewClass (selectionInListView) to the box. |
593 | 8521 |
The list has numLines (if nonNil) number of lines shown. |
8522 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8523 |
||
766 | 8524 |
|l| |
8525 |
||
8526 |
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
|
8527 |
(aListViewClass canUnderstand:#doubleClickAction:) ifTrue:[ |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8528 |
l doubleClickAction:[:name | self okPressed]. |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8529 |
]. |
766 | 8530 |
^ l |
593 | 8531 |
|
8532 |
" |
|
8533 |
|dialog listView| |
|
8534 |
||
8535 |
dialog := DialogBox new. |
|
8536 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8537 |
||
8538 |
listView := dialog |
|
3812
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8539 |
addListBoxOn:nil |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8540 |
class:FileSelectionList |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8541 |
withNumberOfLines:10 |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8542 |
hScrollable:false |
712b5b68c378
changed #addListBoxOn:class:withNumberOfLines:hScrollable:vScrollable:
Stefan Vogel <sv@exept.de>
parents:
3809
diff
changeset
|
8543 |
vScrollable:false. |
593 | 8544 |
|
8545 |
listView directory:'/etc'. |
|
8546 |
||
8547 |
dialog addAbortButton; addOkButton. |
|
8548 |
dialog open. |
|
8549 |
||
655 | 8550 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView selectionValue]. |
593 | 8551 |
" |
8552 |
||
8553 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8554 |
"Modified: 27.4.1996 / 18:26:15 / cg" |
|
766 | 8555 |
"Modified: 15.6.1996 / 00:31:20 / stefan" |
593 | 8556 |
! |
8557 |
||
8558 |
addListBoxOn:aModel withNumberOfLines:numLines |
|
8559 |
"add a selectionInListView to the box. |
|
8560 |
The list has numLines (if nonNil) number of lines shown. |
|
8561 |
The listViews ScrollWrapper is returned" |
|
8562 |
||
8563 |
^ self |
|
1401 | 8564 |
addListBoxOn:aModel |
8565 |
withNumberOfLines:numLines |
|
8566 |
hScrollable:false |
|
8567 |
vScrollable:true. |
|
593 | 8568 |
|
8569 |
" |
|
8570 |
|dialog model listView| |
|
8571 |
||
8572 |
model := SelectionInList new. |
|
8573 |
model list:#('one' 'two' 'three' 'four'). |
|
8574 |
model selectionIndex:2. |
|
8575 |
||
8576 |
dialog := DialogBox new. |
|
8577 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8578 |
||
8579 |
listView := dialog addListBoxOn:model withNumberOfLines:3. |
|
8580 |
||
8581 |
dialog addAbortButton; addOkButton. |
|
8582 |
dialog open. |
|
8583 |
||
655 | 8584 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8585 |
" |
8586 |
||
8587 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8588 |
"Modified: 27.4.1996 / 18:27:42 / cg" |
|
8589 |
! |
|
8590 |
||
8591 |
addListBoxOn:aModel withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
|
8592 |
"add a selectionInListView to the box. |
|
8593 |
The list has numLines (if nonNil) number of lines shown. |
|
8594 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8595 |
||
8596 |
^ self |
|
1401 | 8597 |
addListBoxOn:aModel |
8598 |
class:SelectionInListView |
|
8599 |
withNumberOfLines:numLines |
|
8600 |
hScrollable:hs |
|
8601 |
vScrollable:vs |
|
593 | 8602 |
|
8603 |
" |
|
8604 |
|dialog model listView| |
|
8605 |
||
8606 |
model := SelectionInList new. |
|
8607 |
model list:#('one' 'two' 'three' 'four'). |
|
8608 |
model selectionIndex:2. |
|
8609 |
||
8610 |
dialog := DialogBox new. |
|
8611 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8612 |
||
8613 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:true vScrollable:true. |
|
8614 |
||
8615 |
dialog addAbortButton; addOkButton. |
|
8616 |
dialog open. |
|
8617 |
||
655 | 8618 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8619 |
" |
8620 |
||
8621 |
" |
|
8622 |
|dialog model listView| |
|
8623 |
||
8624 |
model := SelectionInList new. |
|
8625 |
model list:#('one' 'two' 'three' 'four'). |
|
8626 |
model selectionIndex:2. |
|
8627 |
||
8628 |
dialog := DialogBox new. |
|
8629 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8630 |
||
8631 |
listView := dialog addListBoxOn:model withNumberOfLines:3 hScrollable:false vScrollable:false. |
|
8632 |
||
8633 |
dialog addAbortButton; addOkButton. |
|
8634 |
dialog open. |
|
8635 |
||
655 | 8636 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:model selection]. |
593 | 8637 |
" |
8638 |
||
8639 |
"Created: 22.2.1996 / 15:40:07 / cg" |
|
8640 |
"Modified: 27.4.1996 / 18:26:36 / cg" |
|
8641 |
! |
|
8642 |
||
8643 |
addPopUpList:labelString on:aModel |
|
8644 |
"create a popUpList with a label on aModel and add it. |
|
8645 |
Returns the box." |
|
8646 |
||
8647 |
^ self addPopUpList:labelString on:aModel tabable:true |
|
8648 |
! |
|
8649 |
||
8650 |
addPopUpList:labelString on:aModel tabable:tabable |
|
8651 |
"create a popUpList on aModel and add it. |
|
8652 |
Returns the popUpList." |
|
8653 |
||
8654 |
|p box l| |
|
8655 |
||
8656 |
p := PopUpList on:aModel. |
|
8657 |
p resize; sizeFixed:true. |
|
8658 |
labelString notNil ifTrue:[ |
|
1401 | 8659 |
box := HorizontalPanelView new. |
8660 |
box borderWidth:0; horizontalLayout:#rightSpace. |
|
8661 |
box add:(l := Label label:labelString). |
|
8662 |
l borderWidth:0. |
|
8663 |
box add:p. |
|
593 | 8664 |
] ifFalse:[ |
1401 | 8665 |
box := p. |
593 | 8666 |
]. |
8667 |
self addComponent:box tabable:tabable tabbedComponent:p. |
|
8668 |
^ p |
|
735
2552463a8f34
place popUp at right (without extra space)
Claus Gittinger <cg@exept.de>
parents:
719
diff
changeset
|
8669 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
8670 |
"Modified: 31.5.1996 / 21:25:17 / cg" |
593 | 8671 |
! |
8672 |
||
8673 |
addPopUpListOn:aModel |
|
8674 |
"create a popUpList on aModel and add it. |
|
8675 |
Returns the box." |
|
8676 |
||
8677 |
^ self addPopUpList:nil on:aModel tabable:true |
|
8678 |
! |
|
8679 |
||
8680 |
addPopUpListOn:aModel tabable:tabable |
|
8681 |
"create a popUpList on aModel and add it. |
|
8682 |
Returns the popUpList." |
|
8683 |
||
8684 |
^ self addPopUpList:nil on:aModel tabable:tabable |
|
766 | 8685 |
! |
8686 |
||
4293
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8687 |
addRadioButton:labelString on:aRadioButtonGroupModel value:radioValue tabable:tabable |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8688 |
"create a radio button on aModel and add it. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8689 |
Returns the radio button." |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8690 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8691 |
|r| |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8692 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8693 |
r := RadioButton label:labelString. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8694 |
aRadioButtonGroupModel add:r value:radioValue. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8695 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8696 |
self addComponent:r tabable:tabable. |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8697 |
^ r |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8698 |
|
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8699 |
"Created: / 23-07-2011 / 17:28:08 / cg" |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8700 |
! |
05baa387d4a1
added: #addRadioButton:on:value:tabable:
Claus Gittinger <cg@exept.de>
parents:
4227
diff
changeset
|
8701 |
|
766 | 8702 |
addTextBoxOn:aModel class:aListViewClass withNumberOfLines:numLines hScrollable:hs vScrollable:vs |
8703 |
"add an instance of aListViewClass to the box. |
|
8704 |
The list has numLines (if nonNil) number of lines shown. |
|
8705 |
If scrolled, the ScrollWrapper is returned - otherwise the listView." |
|
8706 |
||
8707 |
|l scr h dH| |
|
8708 |
||
8709 |
l := aListViewClass new. |
|
8710 |
l model:aModel. |
|
8711 |
||
877 | 8712 |
(vs or:[hs]) ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8713 |
hs ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8714 |
scr := HVScrollableView forView:l miniScrollerH:true . |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8715 |
] ifFalse:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8716 |
scr := ScrollableView forView:l |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8717 |
]. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8718 |
scr resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8719 |
"/ Transcript show:scr height; show:' '; showCR:l height. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8720 |
dH := scr height - l height. |
766 | 8721 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8722 |
l level:-1. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8723 |
scr := l. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8724 |
dH := 0. |
766 | 8725 |
]. |
8726 |
||
8727 |
numLines notNil ifTrue:[ |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8728 |
h := l heightForLines:numLines. |
766 | 8729 |
] ifFalse:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8730 |
h := l preferredHeight |
766 | 8731 |
]. |
8732 |
self addComponent:scr withHeight:(h + dH). |
|
8733 |
^ scr |
|
8734 |
||
8735 |
" |
|
8736 |
|dialog listView| |
|
8737 |
||
8738 |
dialog := DialogBox new. |
|
8739 |
(dialog addTextLabel:'select any') adjust:#left. |
|
8740 |
||
8741 |
listView := dialog |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8742 |
addTextBoxOn:nil |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8743 |
class:EditTextView |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8744 |
withNumberOfLines:10 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8745 |
hScrollable:true |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8746 |
vScrollable:true. |
766 | 8747 |
|
8748 |
||
8749 |
dialog addAbortButton; addOkButton. |
|
8750 |
dialog open. |
|
8751 |
||
8752 |
dialog accepted ifTrue:[Transcript show:'selection is:'; showCR:listView contents]. |
|
8753 |
" |
|
8754 |
||
8755 |
"Created: 14.6.1996 / 23:33:47 / stefan" |
|
877 | 8756 |
"Modified: 8.11.1996 / 15:31:15 / cg" |
593 | 8757 |
! ! |
8758 |
||
8759 |
!DialogBox methodsFor:'construction-rows & columns'! |
|
8760 |
||
130 | 8761 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock |
8762 |
"add some elements in a vertical column. |
|
8763 |
Equally space elements as returned from aBlock." |
|
8764 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8765 |
self |
1401 | 8766 |
addColumn:aRow |
8767 |
fromX:leftX toX:rightX |
|
8768 |
collect:aBlock |
|
8769 |
tabable:false |
|
130 | 8770 |
|
8771 |
" |
|
8772 |
|dialog| |
|
8773 |
||
8774 |
dialog := Dialog new. |
|
8775 |
dialog |
|
1401 | 8776 |
addColumn:#('label1' 'label2' 'lbl3' 'l4' 'label5') |
8777 |
fromX:0.0 |
|
8778 |
toX:1.0 |
|
8779 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8780 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8781 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8782 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8783 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8784 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8785 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8786 |
|dialog| |
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 := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8789 |
dialog |
1401 | 8790 |
addColumn:#('label1' 'label2' 'label3' 'label4' 'label5') |
8791 |
fromX:0.25 |
|
8792 |
toX:0.75 |
|
8793 |
collect:[:label | (Label label:label) adjust:#left]. |
|
130 | 8794 |
|
8795 |
dialog addOkButton. |
|
8796 |
dialog open. |
|
8797 |
" |
|
8798 |
||
8799 |
" |
|
8800 |
|dialog y| |
|
8801 |
||
8802 |
dialog := Dialog new. |
|
8803 |
y := dialog yPosition. |
|
8804 |
dialog |
|
1401 | 8805 |
addColumn:#('a1' 'b1' 'c1' 'd1') |
8806 |
fromX:0 |
|
8807 |
toX:(1/3) |
|
8808 |
collect:[:label | Label label:label]. |
|
130 | 8809 |
|
8810 |
dialog yPosition:y. |
|
8811 |
dialog |
|
1401 | 8812 |
addColumn:#('a2' 'b2' 'c2' 'd2') |
8813 |
fromX:(1/3) |
|
8814 |
toX:(2/3) |
|
8815 |
collect:[:label | Label label:label]. |
|
130 | 8816 |
|
8817 |
dialog yPosition:y. |
|
8818 |
dialog |
|
1401 | 8819 |
addColumn:#('a3' 'b3' 'c3' 'd3') |
8820 |
fromX:(2/3) |
|
8821 |
toX:1 |
|
8822 |
collect:[:label | Label label:label]. |
|
130 | 8823 |
|
8824 |
dialog addOkButton. |
|
8825 |
dialog open. |
|
8826 |
" |
|
344
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 |
"Modified: 9.2.1996 / 22:22:12 / cg" |
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 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8831 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8832 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8833 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8834 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8835 |
self |
1401 | 8836 |
addColumn:aRow |
8837 |
fromX:leftX toX:rightX |
|
8838 |
collect:aBlock |
|
8839 |
tabable:tabable |
|
8840 |
horizontalLayout:#fitSpace |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8841 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8842 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8843 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8844 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8845 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8846 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8847 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8848 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8849 |
dialog |
1401 | 8850 |
addColumn:#('one' 'two' 'three' 'four') |
8851 |
fromX:0 |
|
8852 |
toX:0.3 |
|
8853 |
collect:[:label | Label label:label]. |
|
344
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 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8856 |
dialog |
1401 | 8857 |
addColumn:values |
8858 |
fromX:0.3 |
|
8859 |
toX:1.0 |
|
8860 |
collect:[:value | EditField on:value] |
|
8861 |
tabable:true. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8862 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8863 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8864 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8865 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8866 |
dialog accepted ifTrue:[ |
1401 | 8867 |
Transcript showCR:(values collect:[:holder | holder value]) |
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 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8870 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8871 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8872 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8873 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8874 |
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
|
8875 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8876 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8877 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8878 |
dialog |
1401 | 8879 |
addColumn:(1 to:4) |
8880 |
fromX:0 |
|
8881 |
toX:0.5 |
|
8882 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8883 |
tabable:true |
|
8884 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8885 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8886 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8887 |
dialog |
1401 | 8888 |
addColumn:(5 to:8) |
8889 |
fromX:0.5 |
|
8890 |
toX:1.0 |
|
8891 |
collect:[:idx | CheckToggle on:(values at:idx)] |
|
8892 |
tabable:true |
|
8893 |
horizontalLayout:#center. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8894 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8895 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8896 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8897 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8898 |
dialog accepted ifTrue:[ |
1401 | 8899 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8900 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8901 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8902 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8903 |
"Created: 9.2.1996 / 21:51:47 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8904 |
"Modified: 9.2.1996 / 22:22:02 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8905 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8906 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8907 |
addColumn:aRow fromX:leftX toX:rightX collect:aBlock tabable:tabable horizontalLayout:hLayout |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8908 |
"add some elements in a vertical column. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8909 |
Equally space elements as returned from aBlock." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8910 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8911 |
|helper component| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8912 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8913 |
helper := VerticalPanelView new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8914 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8915 |
aRow do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8916 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8917 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8918 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8919 |
tabable ifTrue:[self makeTabable:component]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8920 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8921 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8922 |
helper resize. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8923 |
self addComponent:helper. |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8924 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8925 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8926 |
"/ Transcript show:'w now: '; showCR:helper preferredExtent x |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8927 |
]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8928 |
helper horizontalLayout:hLayout. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8929 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8930 |
right:rightX asFloat; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8931 |
leftInset:leftIndent; |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8932 |
rightInset:rightIndent. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8933 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8934 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8935 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8936 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8937 |
values := (1 to:4) collect:[:dummy | '' asValue]. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8938 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8939 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8940 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8941 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8942 |
addColumn:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8943 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8944 |
toX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8945 |
collect:[:label | Label label:label]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8946 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8947 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8948 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8949 |
addColumn:values |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8950 |
fromX:0.3 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8951 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8952 |
collect:[:value | EditField on:value] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8953 |
tabable:true. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8954 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8955 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8956 |
dialog open. |
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 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8959 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8960 |
] |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8961 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8962 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8963 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8964 |
|dialog y values| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8965 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8966 |
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
|
8967 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8968 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8969 |
y := dialog yPosition. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8970 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8971 |
addColumn:(1 to:4) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8972 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8973 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8974 |
collect:[:idx | CheckToggle on:(values at:idx)]. |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8975 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8976 |
dialog yPosition:y. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8977 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8978 |
addColumn:(5 to:8) |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8979 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8980 |
toX:1.0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8981 |
collect:[:idx | CheckToggle on:(values at:idx)] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8982 |
tabable:true. |
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 |
dialog accepted ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
8988 |
Transcript showCR:(values collect:[:holder | holder value]) |
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8989 |
] |
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 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8992 |
"Modified: 9.2.1996 / 22:02:22 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8993 |
"Created: 9.2.1996 / 22:20:31 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8994 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
8995 |
|
130 | 8996 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock |
8997 |
"add some elements in a horizontal row. |
|
8998 |
Equally space elements as returned from aBlock. |
|
8999 |
Advance y." |
|
9000 |
||
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9001 |
self |
1401 | 9002 |
addRow:aCol |
9003 |
fromX:leftX toX:rightX |
|
9004 |
collect:aBlock |
|
9005 |
tabable:true |
|
9006 |
horizontalLayout:#spread |
|
130 | 9007 |
|
9008 |
" |
|
9009 |
|dialog| |
|
9010 |
||
9011 |
dialog := Dialog new. |
|
9012 |
dialog |
|
1401 | 9013 |
addRow:#('a' 'b' 'c' 'd') |
9014 |
fromX:0 |
|
9015 |
toX:1 |
|
9016 |
collect:[:label | Label label:label]. |
|
130 | 9017 |
|
9018 |
dialog addOkButton. |
|
9019 |
dialog open. |
|
9020 |
" |
|
9021 |
||
9022 |
" |
|
9023 |
|dialog| |
|
9024 |
||
9025 |
dialog := Dialog new. |
|
9026 |
dialog |
|
1401 | 9027 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9028 |
fromX:0 |
|
9029 |
toX:1 |
|
9030 |
collect:[:label | Label label:label]. |
|
130 | 9031 |
|
9032 |
dialog |
|
1401 | 9033 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9034 |
fromX:0 |
|
9035 |
toX:0.5 |
|
9036 |
collect:[:label | Label label:label]. |
|
130 | 9037 |
|
9038 |
dialog |
|
1401 | 9039 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9040 |
fromX:0.5 |
|
9041 |
toX:1 |
|
9042 |
collect:[:label | Label label:label]. |
|
130 | 9043 |
|
9044 |
dialog addOkButton. |
|
9045 |
dialog open. |
|
9046 |
" |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9047 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9048 |
"Modified: 9.2.1996 / 22:25:16 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9049 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9050 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9051 |
addRow:aCol fromX:leftX toX:rightX collect:aBlock tabable:tabable |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9052 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9053 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9054 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9055 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9056 |
self |
1401 | 9057 |
addRow:aCol |
9058 |
fromX:leftX toX:rightX |
|
9059 |
collect:aBlock |
|
9060 |
tabable:tabable |
|
9061 |
horizontalLayout:#spread |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9062 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9063 |
"Created: 9.2.1996 / 22:25:35 / cg" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9064 |
! |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9065 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9066 |
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
|
9067 |
"add some elements in a horizontal row. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9068 |
Equally space elements as returned from aBlock. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9069 |
Advance y." |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9070 |
|
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9071 |
^ self |
1401 | 9072 |
addRow:aCol |
9073 |
fromX:leftX toX:rightX |
|
9074 |
collect:aBlock |
|
9075 |
tabable:tabable |
|
9076 |
horizontalLayout:hLayout |
|
9077 |
verticalLayout:#fit |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9078 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9079 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9080 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9081 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9082 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9083 |
dialog |
1401 | 9084 |
addRow:#('a' 'b' 'c' 'd') |
9085 |
fromX:0 |
|
9086 |
toX:1 |
|
9087 |
collect:[:label | Label label:label] |
|
9088 |
tabable:false |
|
9089 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9090 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9091 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9092 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9093 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9094 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9095 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9096 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9097 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9098 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9099 |
dialog |
1401 | 9100 |
addRow:#('one' 'two' 'three' 'four') |
9101 |
fromX:0 |
|
9102 |
toX:1 |
|
9103 |
collect:[:label | Button label:label] |
|
9104 |
tabable:false |
|
9105 |
horizontalLayout:#fit. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9106 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9107 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9108 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9109 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9110 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9111 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9112 |
|dialog| |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9113 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9114 |
dialog := Dialog new. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9115 |
dialog |
1401 | 9116 |
addRow:#('a1' 'b1' 'c1' 'd1') |
9117 |
fromX:0 |
|
9118 |
toX:1 |
|
9119 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9120 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9121 |
dialog |
1401 | 9122 |
addRow:#('a2' 'b2' 'c2' 'd2') |
9123 |
fromX:0 |
|
9124 |
toX:0.5 |
|
9125 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9126 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9127 |
dialog |
1401 | 9128 |
addRow:#('a3' 'b3' 'c3' 'd3') |
9129 |
fromX:0.5 |
|
9130 |
toX:1 |
|
9131 |
collect:[:label | Label label:label]. |
|
344
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9132 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9133 |
dialog addOkButton. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9134 |
dialog open. |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9135 |
" |
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9136 |
|
f0532d8a40f8
more examples; added #addComboBox
Claus Gittinger <cg@exept.de>
parents:
314
diff
changeset
|
9137 |
"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
|
9138 |
"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
|
9139 |
! |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9140 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9141 |
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
|
9142 |
"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
|
9143 |
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
|
9144 |
Advance y." |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9145 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9146 |
|helper component| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9147 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9148 |
helper := HorizontalPanelView new. |
792 | 9149 |
helper borderWidth:0. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9150 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9151 |
aCol do:[:el | |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9152 |
component := aBlock value:el. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9153 |
component resize. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9154 |
helper add:component. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9155 |
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
|
9156 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9157 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9158 |
helper resize. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9159 |
self addComponent:helper. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9160 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9161 |
width < helper preferredWidth ifTrue:[ |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9162 |
self width:helper preferredWidth. |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9163 |
"/ 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
|
9164 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9165 |
hLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9166 |
helper horizontalLayout:hLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9167 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9168 |
vLayout notNil ifTrue:[ |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9169 |
helper verticalLayout:vLayout. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9170 |
]. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9171 |
helper left:leftX asFloat; |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9172 |
right:rightX asFloat. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9173 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9174 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9175 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9176 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9177 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9178 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9179 |
addRow:#('a' 'b' 'c' 'd') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9180 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9181 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9182 |
collect:[:label | Label label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9183 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9184 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9185 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9186 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9187 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9188 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9189 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9190 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9191 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9192 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9193 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9194 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9195 |
addRow:#('one' 'two' 'three' 'four') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9196 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9197 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9198 |
collect:[:label | Button label:label] |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9199 |
tabable:false |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9200 |
horizontalLayout:#fit. |
739
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9201 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9202 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9203 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9204 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9205 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9206 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9207 |
|dialog| |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9208 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9209 |
dialog := Dialog new. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9210 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9211 |
addRow:#('a1' 'b1' 'c1' 'd1') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9212 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9213 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9214 |
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
|
9215 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9216 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9217 |
addRow:#('a2' 'b2' 'c2' 'd2') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9218 |
fromX:0 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9219 |
toX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9220 |
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
|
9221 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9222 |
dialog |
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9223 |
addRow:#('a3' 'b3' 'c3' 'd3') |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9224 |
fromX:0.5 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9225 |
toX:1 |
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9226 |
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
|
9227 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9228 |
dialog addOkButton. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9229 |
dialog open. |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9230 |
" |
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9231 |
|
67e04c0c38a7
fixed focus stuff (dont include hidden views in returned focusList)
Claus Gittinger <cg@exept.de>
parents:
735
diff
changeset
|
9232 |
"Created: 31.5.1996 / 20:45:31 / cg" |
792 | 9233 |
"Modified: 17.7.1996 / 12:06:08 / cg" |
76 | 9234 |
! ! |
9235 |
||
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9236 |
!DialogBox methodsFor:'explicit focus control'! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9237 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9238 |
focusOnOk |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9239 |
windowGroup focusView:okButton |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9240 |
|
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9241 |
"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
|
9242 |
! ! |
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9243 |
|
4227 | 9244 |
!DialogBox methodsFor:'initialization & release'! |
76 | 9245 |
|
9246 |
initialize |
|
9247 |
super initialize. |
|
9248 |
||
573 | 9249 |
"/ label := 'Dialog'. |
948 | 9250 |
acceptValue := ValueHolder newBoolean. |
76 | 9251 |
|
9252 |
acceptReturnAsOK := true. |
|
125 | 9253 |
acceptOnLeave := true. |
1757 | 9254 |
focusToOKOnLeave := DefaultFocusToOKOnLeave. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9255 |
hideOnAccept := true. |
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9256 |
autoAccept := true. |
76 | 9257 |
|
9258 |
buttonPanel := HorizontalPanelView in:self. |
|
118 | 9259 |
buttonPanel |
1757 | 9260 |
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
|
9261 |
bottomInset:ViewSpacing; |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9262 |
topInset:((font height + ViewSpacing) * 2) negated; |
1757 | 9263 |
borderWidth:0; |
9264 |
horizontalLayout:#spread. |
|
118 | 9265 |
|
2304
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9266 |
"/ 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
|
9267 |
buttonPanel reverseOrderIfOKAtLeft:true. |
c96b6b899023
button-roder reversal is now done exclusively in the buttonPanel
Claus Gittinger <cg@exept.de>
parents:
2299
diff
changeset
|
9268 |
|
122 | 9269 |
yPosition := ViewSpacing. |
312
008267b920d9
allow more control over the indent when adding components
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
9270 |
leftIndent := rightIndent := (ViewSpacing // 2). |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9271 |
needResize := true. |
76 | 9272 |
|
9273 |
" |
|
9274 |
|b| |
|
9275 |
b := DialogBox new. |
|
118 | 9276 |
b addAbortButton; |
9277 |
addOkButton; |
|
9278 |
showAtPointer |
|
76 | 9279 |
" |
9280 |
" |
|
9281 |
|b| |
|
9282 |
b := DialogBox new. |
|
118 | 9283 |
b addOkButton; |
9284 |
showAtPointer |
|
9285 |
" |
|
76 | 9286 |
" |
118 | 9287 |
|b| |
9288 |
b := DialogBox new. |
|
9289 |
b addTextLabel:'hello world'; |
|
9290 |
addOkButton; |
|
9291 |
showAtPointer |
|
9292 |
" |
|
9293 |
" |
|
9294 |
|b| |
|
9295 |
b := DialogBox new. |
|
9296 |
b addTextLabel:'hello world'; |
|
9297 |
addVerticalSpace:50; |
|
9298 |
addOkButton; |
|
9299 |
showAtPointer |
|
9300 |
" |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9301 |
|
1614 | 9302 |
"Modified: / 23.12.1997 / 10:05:24 / md" |
9303 |
"Modified: / 27.7.1998 / 20:16:37 / cg" |
|
76 | 9304 |
! |
9305 |
||
9306 |
reAdjustGeometry |
|
9307 |
"sent late in snapin processing - gives me a chance |
|
9308 |
to resize for changed font dimensions." |
|
9309 |
||
9310 |
super reAdjustGeometry. |
|
9311 |
okButton notNil ifTrue:[okButton resize]. |
|
9312 |
abortButton notNil ifTrue:[abortButton resize]. |
|
9313 |
self resize |
|
9314 |
! ! |
|
9315 |
||
197 | 9316 |
!DialogBox methodsFor:'private'! |
9317 |
||
9318 |
basicAddComponent:aComponent |
|
9319 |
"add a component, dont change its size" |
|
9320 |
||
9321 |
addedComponents isNil ifTrue:[ |
|
2126 | 9322 |
addedComponents := OrderedCollection new. |
197 | 9323 |
]. |
9324 |
addedComponents add:aComponent. |
|
9325 |
self addSubView:aComponent. |
|
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9326 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9327 |
needResize := true. |
3932
fa0f5fcfc64b
changed: #basicAddComponent:
Claus Gittinger <cg@exept.de>
parents:
3908
diff
changeset
|
9328 |
"/ 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
|
9329 |
preferredExtent := nil. |
197 | 9330 |
! |
9331 |
||
9332 |
hideAndEvaluate:aBlock |
|
9333 |
"if I am modal, make myself invisible and evaluate aBlock. |
|
9334 |
If nonModal, stay up, but also evaluate the block." |
|
9335 |
||
9336 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9337 |
self hide. |
197 | 9338 |
]. |
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9339 |
aBlock notNil ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9340 |
aBlock numArgs == 0 ifTrue:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9341 |
aBlock value |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9342 |
] ifFalse:[ |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9343 |
aBlock value:(self actionArgument) |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9344 |
] |
2673
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9345 |
]. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9346 |
|
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9347 |
(windowGroup isNil or:[windowGroup isModal not]) ifTrue:[ |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9348 |
self destroy. |
f7fe71653801
hideAndEvaluate - also support modeless operation
Claus Gittinger <cg@exept.de>
parents:
2672
diff
changeset
|
9349 |
]. |
197 | 9350 |
|
9351 |
"Modified: 5.9.1995 / 19:06:33 / claus" |
|
9352 |
! |
|
9353 |
||
2116 | 9354 |
preOpen |
9355 |
||
9356 |
"Created: / 4.2.2000 / 00:10:48 / cg" |
|
9357 |
! |
|
9358 |
||
197 | 9359 |
realize |
9360 |
"if any inputFields where added, activate the first one" |
|
9361 |
||
3944
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9362 |
verticalPanel notNil ifTrue:[ |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9363 |
verticalPanel extent:verticalPanel preferredExtent. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9364 |
preferredExtent := nil. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9365 |
self extent:(self preferredExtent). |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9366 |
]. |
d5ed8d618608
yPosition fixes when adding components in the aboutToOpen hook.
Claus Gittinger <cg@exept.de>
parents:
3935
diff
changeset
|
9367 |
|
1877
a46bf520f9c6
realize first, then assign focus
Claus Gittinger <cg@exept.de>
parents:
1843
diff
changeset
|
9368 |
super realize. |
3467 | 9369 |
|
9370 |
buttonPanel notNil ifTrue:[ |
|
9371 |
buttonPanel subViews do:[:eachButton | |
|
9372 |
eachButton canTab:true. |
|
9373 |
] |
|
9374 |
]. |
|
9375 |
||
197 | 9376 |
inputFieldGroup notNil ifTrue:[ |
1646 | 9377 |
inputFieldGroup activateFirstIfNoCurrent |
197 | 9378 |
]. |
1646 | 9379 |
|
9380 |
"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
|
9381 |
! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9382 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9383 |
resize |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9384 |
needResize ifTrue:[ |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9385 |
"/ verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9386 |
"/ verticalPanel extent:verticalPanel preferredExtent. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9387 |
"/ preferredExtent := nil. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9388 |
"/ self extent:(self preferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9389 |
"/ ]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9390 |
needResize := false. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9391 |
super resize |
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9392 |
] |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9393 |
|
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9394 |
"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
|
9395 |
"Modified: 27.1.1996 / 18:25:40 / cg" |
197 | 9396 |
! ! |
9397 |
||
120 | 9398 |
!DialogBox methodsFor:'queries'! |
118 | 9399 |
|
121 | 9400 |
accepted |
128 | 9401 |
"after the box has closed: |
9402 |
return true if accepted, false if canceled" |
|
125 | 9403 |
|
128 | 9404 |
^ acceptValue value |
121 | 9405 |
! |
9406 |
||
2116 | 9407 |
interfaceSpecFor:aSelector |
9408 |
"return an interface spec. |
|
9409 |
Notice - Dialog should be moved under AppModel so this becomes obsolete." |
|
9410 |
||
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9411 |
^ UISpecification from:(self specificationFor:aSelector) |
2116 | 9412 |
! |
9413 |
||
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9414 |
maxPreferredWidthOfAddedComponents |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9415 |
"helper for computing my preferred extent. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9416 |
That is the max component width" |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9417 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9418 |
^ (addedComponents ? #()) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9419 |
inject:0 |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9420 |
into:[:max :element | |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9421 |
|eExt prefWidth scale rel relX| |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9422 |
|
3612
1b624feb1ece
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3584
diff
changeset
|
9423 |
prefWidth := element preferredWidth. |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9424 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9425 |
"/ special (for your convenience) |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9426 |
"/ 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
|
9427 |
"/ 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
|
9428 |
|
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9429 |
(rel := element relativeExtent) notNil ifTrue:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9430 |
relX := rel x. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9431 |
(relX isNil or:[relX isInteger]) ifFalse:[ |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9432 |
prefWidth := (prefWidth * (1 / relX)) rounded |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9433 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9434 |
]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9435 |
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
|
9436 |
max max:(eExt + element leftInset + element rightInset)]. |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9437 |
! |
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9438 |
|
120 | 9439 |
positionOffset |
9440 |
"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
|
9441 |
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
|
9442 |
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
|
9443 |
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
|
9444 |
use my superclasses offset." |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9445 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9446 |
|idx butt buttons| |
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9447 |
|
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9448 |
buttonPanel notNil ifTrue:[ |
2332 | 9449 |
buttons := buttonPanel subViews. |
9450 |
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
|
9451 |
idx := buttons findFirst:[:b | b isDefault]. |
2332 | 9452 |
idx ~~ 0 ifTrue:[ |
9453 |
butt := buttons at:idx. |
|
9454 |
||
9455 |
"get our size (preferredExtent) and compute |
|
9456 |
origin and extent of buttonPanel and okButton. |
|
9457 |
This is normally done on view realization." |
|
9458 |
||
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9459 |
needResize ifTrue:[ self resize ]. |
2332 | 9460 |
buttonPanel |
9461 |
pixelOrigin:buttonPanel computeOrigin |
|
9462 |
extent:buttonPanel computeExtent. |
|
9463 |
buttonPanel setChildPositionsIfChanged. |
|
2732
9a96cfc123c0
Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents:
2718
diff
changeset
|
9464 |
^ (butt originRelativeTo:self) + (butt extent // 2). |
2332 | 9465 |
] |
9466 |
] |
|
118 | 9467 |
]. |
913 | 9468 |
|
953
050fba15277a
DialogBoxes positionOffset now handles all common cases
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
9469 |
^ super positionOffset |
912
310c4970e613
Fix #positionOffset to show 'senders' box with cursor on ok-button.
Stefan Vogel <sv@exept.de>
parents:
884
diff
changeset
|
9470 |
|
913 | 9471 |
"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
|
9472 |
"Modified: 16.1.1997 / 22:00:23 / cg" |
118 | 9473 |
! |
9474 |
||
130 | 9475 |
preferredExtent |
132 | 9476 |
"return my preferred extent. |
9477 |
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
|
9478 |
whichever is larger, by the sum of the component's heights." |
118 | 9479 |
|
120 | 9480 |
|w h p| |
118 | 9481 |
|
3756
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9482 |
"/ If I have an explicit preferredExtent.. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9483 |
explicitExtent notNil ifTrue:[ |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9484 |
^ explicitExtent |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9485 |
]. |
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9486 |
|
7a333fc722bd
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3736
diff
changeset
|
9487 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9488 |
preferredExtent notNil ifTrue:[ |
2801 | 9489 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9490 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
9491 |
|
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9492 |
h := yPosition + ViewSpacing. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9493 |
verticalPanel notNil ifTrue:[ |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9494 |
"/ 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
|
9495 |
"/ 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
|
9496 |
"/ do this now. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9497 |
verticalPanel extent:(verticalPanel computePreferredExtent). |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9498 |
h := h + verticalPanel height. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9499 |
]. |
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9500 |
|
120 | 9501 |
addedComponents notNil ifTrue:[ |
2803
9f75a923238d
refactored preferredWidth computation for subclass reuse
Claus Gittinger <cg@exept.de>
parents:
2801
diff
changeset
|
9502 |
w := self maxPreferredWidthOfAddedComponents. |
120 | 9503 |
] ifFalse:[ |
3618 | 9504 |
w := super preferredExtent x. |
120 | 9505 |
]. |
132 | 9506 |
w := w max:width. |
3934
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9507 |
|
d1d5bba8c902
box resizing and verticalPanel handling changed to allow
Claus Gittinger <cg@exept.de>
parents:
3932
diff
changeset
|
9508 |
subViews size ~~ 0 ifTrue:[ |
2801 | 9509 |
p := buttonPanel preferredExtent. |
9510 |
w := w max:p x. |
|
9511 |
h := h |
|
9512 |
+ p y |
|
9513 |
+ ViewSpacing. |
|
120 | 9514 |
]. |
118 | 9515 |
|
120 | 9516 |
"/ okButton isNil ifTrue:[ |
130 | 9517 |
"/ ^ super preferredExtent |
120 | 9518 |
"/ ]. |
130 | 9519 |
"/ p := buttonPanel preferredExtent. |
120 | 9520 |
"/ w := p x. |
9521 |
"/ h := ViewSpacing |
|
9522 |
"/ + p y |
|
9523 |
"/ + ViewSpacing. |
|
9524 |
"/ |
|
9525 |
^ w @ h |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9526 |
|
797 | 9527 |
"Modified: 19.7.1996 / 20:43:52 / cg" |
2379
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9528 |
! |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9529 |
|
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9530 |
specificationFor:aKey |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9531 |
"return an interface specs literal encoding. |
f16038a3eddc
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
2374
diff
changeset
|
9532 |
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
|
9533 |
|
2568 | 9534 |
^ ApplicationModel |
9535 |
specificationFor:aKey |
|
9536 |
application:self |
|
9537 |
onDevice:(self graphicsDevice) |
|
310
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9538 |
! ! |
4bbc8deffc8c
allow specification of the resizing behavior (better list-choosers)
Claus Gittinger <cg@exept.de>
parents:
307
diff
changeset
|
9539 |
|
197 | 9540 |
!DialogBox methodsFor:'user actions'! |
76 | 9541 |
|
197 | 9542 |
abortPressed |
9543 |
"sent by the cancel button; user pressed abort button |
|
9544 |
- hide myself and evaluate okAction" |
|
121 | 9545 |
|
197 | 9546 |
abortButton turnOffWithoutRedraw. |
9547 |
acceptValue value:false. |
|
121 | 9548 |
|
197 | 9549 |
"/ actually, only hides if I have been opened modal |
9550 |
self hideAndEvaluate:abortAction |
|
121 | 9551 |
! |
9552 |
||
2542
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9553 |
actionArgument |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9554 |
^ nil |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9555 |
! |
53fc213c8815
refactored action evaluation
Claus Gittinger <cg@exept.de>
parents:
2525
diff
changeset
|
9556 |
|
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9557 |
closeCancel |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9558 |
"closed via escape" |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9559 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9560 |
acceptValue value:false. |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9561 |
|
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9562 |
"/ actually, only hides if I have been opened modal |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9563 |
self hideAndEvaluate:abortAction |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9564 |
! |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9565 |
|
197 | 9566 |
doAccept |
9567 |
"let all components accept (i.e. update their model from the values), |
|
9568 |
then set my accept value to true. |
|
9569 |
This is confusing: this method was originally called #accept, |
|
9570 |
but renamed for compatibility with ST-80, where #accept returns the |
|
9571 |
accept-valueHolder (which looks like a bad name to me ...)." |
|
76 | 9572 |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9573 |
autoAccept ifTrue:[ |
1401 | 9574 |
addedComponents notNil ifTrue:[ |
9575 |
addedComponents do:[:aComponent | |
|
9576 |
(aComponent respondsTo:#accept) ifTrue:[ |
|
9577 |
aComponent accept |
|
9578 |
] |
|
9579 |
] |
|
9580 |
]. |
|
197 | 9581 |
]. |
9582 |
acceptValue value:true. |
|
469
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9583 |
|
1d86f97ab2e5
autoAccept as default; configurable
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
9584 |
"Modified: 4.3.1996 / 12:14:56 / cg" |
128 | 9585 |
! |
9586 |
||
197 | 9587 |
keyPress:aKey x:x y:y |
2700 | 9588 |
"return-key duplicates ok-function if acceptReturnAsOK is true" |
76 | 9589 |
|
490 | 9590 |
<resource: #keyboard (#Return)> |
9591 |
||
2392
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9592 |
|b| |
3863ab3759c6
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
2380
diff
changeset
|
9593 |
|
3809 | 9594 |
"/ oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has |
9595 |
"/ no one to inform about RETURN/ESCAPE. So the procesing here is still needed. |
|
9596 |
||
3808
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9597 |
(aKey == #Return) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9598 |
(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
|
9599 |
^ self okPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9600 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9601 |
(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
|
9602 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9603 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9604 |
(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
|
9605 |
b turnOnWithAction. b turnOffWithAction. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9606 |
^ self. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9607 |
] |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9608 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9609 |
|
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9610 |
(aKey == #Escape) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9611 |
(abortButton notNil) ifTrue:[ |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9612 |
^ self abortPressed |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9613 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9614 |
]. |
743af7e351c6
oops - for old-style DialogBoxes (wo. AppModel), the keyboardProcessor has
Claus Gittinger <cg@exept.de>
parents:
3805
diff
changeset
|
9615 |
|
197 | 9616 |
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
|
9617 |
|
490 | 9618 |
"Modified: 7.3.1996 / 13:15:09 / cg" |
76 | 9619 |
! |
9620 |
||
197 | 9621 |
lastFieldLeft |
9622 |
"if the dialog involves input fields, this is called |
|
9623 |
when the last field is left by Return-key or NextField-key" |
|
120 | 9624 |
|
197 | 9625 |
acceptOnLeave ifTrue:[ |
1401 | 9626 |
acceptReturnAsOK ifTrue:[ |
9627 |
focusToOKOnLeave ifTrue:[ |
|
9628 |
self focusOnOk. |
|
9629 |
^ self. |
|
9630 |
]. |
|
9631 |
self okPressed |
|
9632 |
] |
|
197 | 9633 |
]. |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9634 |
inputFieldGroup activateFirst |
357
732f59def851
care for acceptReturnAsOK being false and return being pressed
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
9635 |
|
551
91ed5dd2b915
shift focus to OK button on return - thats better
Claus Gittinger <cg@exept.de>
parents:
550
diff
changeset
|
9636 |
"Modified: 19.4.1996 / 17:09:02 / cg" |
76 | 9637 |
! |
9638 |
||
197 | 9639 |
okPressed |
9640 |
"sent by the okButton; user pressed ok-button |
|
9641 |
- make myself invisible and if an action was specified do it" |
|
128 | 9642 |
|
197 | 9643 |
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
|
9644 |
|
197 | 9645 |
self doAccept. |
9646 |
||
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9647 |
acceptCheck notNil ifTrue:[ |
302 | 9648 |
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
|
9649 |
]. |
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9650 |
|
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9651 |
hideOnAccept ifTrue:[ |
302 | 9652 |
"/ actually, only hides if I have been opened modal |
9653 |
self hideAndEvaluate:okAction. |
|
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9654 |
] ifFalse:[ |
302 | 9655 |
okAction value |
280
f7d45bfb6d13
fixed cursor-wrapping in multiple-editfield boxes; added acceptCheck-block
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
9656 |
] |
3584
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9657 |
! |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9658 |
|
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9659 |
openDialog |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9660 |
self showAtPointer. |
0ed199ba20a4
more construction (vw compatibility, for NET-IMAP dialogs)
Claus Gittinger <cg@exept.de>
parents:
3575
diff
changeset
|
9661 |
^ self accepted |
128 | 9662 |
! ! |
240 | 9663 |
|
846
75c5dc601522
added more configuration options to confirmWithCancel:
Claus Gittinger <cg@exept.de>
parents:
831
diff
changeset
|
9664 |
!DialogBox class methodsFor:'documentation'! |
240 | 9665 |
|
9666 |
version |
|
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
9667 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.319 2011-11-08 12:30:03 cg Exp $' |
4058
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9668 |
! |
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9669 |
|
6c30a8f944f5
added: #choose:fromList:values:buttons:values:lines:cancel:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
3944
diff
changeset
|
9670 |
version_CVS |
4330
9207417a6965
changed: #choose:fromList:values:initialSelection:buttons:values:default:lines:width:cancel:multiple:title:postBuildBlock:
Claus Gittinger <cg@exept.de>
parents:
4329
diff
changeset
|
9671 |
^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.319 2011-11-08 12:30:03 cg Exp $' |
240 | 9672 |
! ! |
2618 | 9673 |
|
498 | 9674 |
DialogBox initialize! |