author | Claus Gittinger <cg@exept.de> |
Thu, 27 Feb 2020 16:08:38 +0100 | |
changeset 4457 | 8c328436fba9 |
parent 4453 | d6a8138cfa26 |
child 4461 | eb7635490a02 |
permissions | -rw-r--r-- |
4288 | 1 |
"{ Encoding: utf8 }" |
2 |
||
366 | 3 |
" |
4 |
COPYRIGHT (c) 1996 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1373 | 14 |
"{ Package: 'stx:libview2' }" |
15 |
||
3445 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
366 | 18 |
ApplicationModel subclass:#SimpleDialog |
431 | 19 |
instanceVariableNames:'accept cancel close escapeIsCancel postBuildBlock postOpenBlock |
2500
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
20 |
preBuildBlock closeAllowedChannel acceptedValue' |
366 | 21 |
classVariableNames:'' |
22 |
poolDictionaries:'' |
|
23 |
category:'Interface-Framework' |
|
24 |
! |
|
25 |
||
26 |
!SimpleDialog class methodsFor:'documentation'! |
|
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 1996 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
||
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
1589 | 45 |
Use SimpleDialog to specify Dialogs with a windowSpec built by the GUI Builder. |
366 | 46 |
|
47 |
Notice: this class was implemented using protocol information |
|
48 |
from alpha testers and PD code - it may not be complete or compatible to |
|
49 |
the corresponding ST-80 class. If you encounter any incompatibilities, |
|
50 |
please forward a note to the ST/X team. |
|
51 |
||
4329 | 52 |
Hints: |
53 |
to provide a helpSpec, either add it to the builder's bindings; |
|
54 |
(I will fetch help also via: 'self aspectFor:#helpSpec') |
|
55 |
or define the dialog's masterApplication |
|
56 |
(I will ask it for help texts then) |
|
57 |
||
58 |
||
366 | 59 |
[author:] |
60 |
Claus Gittinger |
|
61 |
||
62 |
[see also:] |
|
63 |
StandardSystemView |
|
64 |
WindowGroup DeviceWorkstation DialogBox |
|
65 |
" |
|
66 |
! ! |
|
67 |
||
906 | 68 |
!SimpleDialog class methodsFor:'queries'! |
69 |
||
70 |
isVisualStartable |
|
1427 | 71 |
"return true, if this application can be started via #open. |
72 |
(to allow start of a change browser via double-click in the browser)" |
|
906 | 73 |
|
74 |
self == SimpleDialog ifTrue:[^false]. |
|
75 |
^super isVisualStartable |
|
76 |
! ! |
|
77 |
||
2019
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
78 |
!SimpleDialog methodsFor:'DialogBox compatibility'! |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
79 |
|
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
80 |
destroy |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
81 |
self closeRequest |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
82 |
! |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
83 |
|
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
84 |
hide |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
85 |
self window hide |
7ad3dee35894
protocol compatibility with DialogBox
Claus Gittinger <cg@exept.de>
parents:
1943
diff
changeset
|
86 |
! ! |
976
dd0045c9fdd7
must create the builder ... (sigh)
Claus Gittinger <cg@exept.de>
parents:
935
diff
changeset
|
87 |
|
431 | 88 |
!SimpleDialog methodsFor:'accessing'! |
89 |
||
90 |
accept |
|
2500
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
91 |
"return the valueholder which gets set to true by the accept button. |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
92 |
Also, when this valueHolder gets a true stuffed into it, the dialog is closed. |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
93 |
This valueHolder is also set to true, if the acceptValue get a value stored into." |
431 | 94 |
|
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
95 |
accept isNil ifTrue:[ |
3445 | 96 |
accept := ValueHolder with:false. |
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
97 |
]. |
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
98 |
|
431 | 99 |
^ accept |
605 | 100 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
101 |
"Modified: / 20.5.1998 / 20:51:05 / cg" |
431 | 102 |
! |
103 |
||
2500
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
104 |
acceptValue:something |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
105 |
"save something in acceptedValue (to be passed back to the opened of this dialog), |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
106 |
and set the accept-holder to true, which closes the dialog window. |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
107 |
This is similar to a regular accept, but allows for a particular return-value to be passed |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
108 |
back." |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
109 |
|
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
110 |
acceptedValue := something. |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
111 |
self closeAccept |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
112 |
! |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
113 |
|
1381 | 114 |
accepted |
115 |
"after the box has closed: |
|
116 |
return true if accepted, false if canceled" |
|
117 |
||
3259 | 118 |
^ accept value |
1381 | 119 |
! |
120 |
||
2500
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
121 |
acceptedValue |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
122 |
"an additional value which can be passed back to the one who opened a dialog" |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
123 |
|
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
124 |
^ acceptedValue |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
125 |
! |
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
126 |
|
431 | 127 |
bindings |
4329 | 128 |
"return my builder's bindings" |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
129 |
|
431 | 130 |
^ builder bindings |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
131 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
132 |
"Modified: / 20.5.1998 / 20:51:15 / cg" |
431 | 133 |
! |
134 |
||
135 |
cancel |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
136 |
"return the valueholder which gets set by the cancel button. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
137 |
Also, when this valueHolder gets a true stuffed into it, the |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
138 |
dialog is closed." |
431 | 139 |
|
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
140 |
cancel isNil ifTrue:[ |
3445 | 141 |
cancel := ValueHolder with:false. |
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
142 |
]. |
431 | 143 |
^ cancel |
605 | 144 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
145 |
"Modified: / 20.5.1998 / 20:51:02 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
146 |
! |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
147 |
|
431 | 148 |
escapeIsCancel |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
149 |
"return the escapeIsCancel setting" |
431 | 150 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
151 |
^ escapeIsCancel |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
152 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
153 |
"Modified: / 20.5.1998 / 20:52:44 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
154 |
! |
431 | 155 |
|
156 |
escapeIsCancel:something |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
157 |
"set/clear the escapeIsCancel option. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
158 |
If on, an ESC-key will be treated like a cancel action." |
431 | 159 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
160 |
escapeIsCancel := something. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
161 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
162 |
"Modified: / 20.5.1998 / 20:53:23 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
163 |
! |
431 | 164 |
|
165 |
postBuildBlock:something |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
166 |
"set postBuildBlock; if non-nil, this is evaluated after the build process" |
431 | 167 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
168 |
postBuildBlock := something. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
169 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
170 |
"Modified: / 20.5.1998 / 20:54:06 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
171 |
! |
431 | 172 |
|
173 |
postOpenBlock:something |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
174 |
"set the postBuildBlock; if non-nil, this is evaluated after the view is opened" |
431 | 175 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
176 |
postOpenBlock := something. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
177 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
178 |
"Modified: / 20.5.1998 / 20:54:23 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
179 |
! |
431 | 180 |
|
181 |
preBuildBlock:something |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
182 |
"set the preBuildBlock; if non-nil, this is evaluated before the view is constructed" |
431 | 183 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
184 |
preBuildBlock := something. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
185 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
186 |
"Modified: / 20.5.1998 / 20:54:41 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
187 |
! |
431 | 188 |
|
189 |
source:anApplication |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
190 |
"define the application which provides resources, aspects etc." |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
191 |
|
1067
5b39cef366fe
also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
192 |
builder source:anApplication. |
5b39cef366fe
also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
193 |
masterApplication isNil ifTrue:[ |
1440
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
194 |
anApplication ~~ self ifTrue:[ |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
195 |
masterApplication := anApplication |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
196 |
] |
1067
5b39cef366fe
also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
197 |
]. |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
198 |
|
1067
5b39cef366fe
also set the masterApplication when a simpleDialogs source
Claus Gittinger <cg@exept.de>
parents:
1053
diff
changeset
|
199 |
"Modified: / 8.9.1998 / 01:46:06 / cg" |
431 | 200 |
! ! |
201 |
||
4026 | 202 |
!SimpleDialog methodsFor:'accessing-channels'! |
203 |
||
204 |
closeAllowedChannel |
|
205 |
"return the value-provider which controls if close is allowed. |
|
206 |
This is initialized to true." |
|
207 |
||
208 |
^ closeAllowedChannel |
|
209 |
||
210 |
"Created: / 20.5.1998 / 21:52:32 / cg" |
|
211 |
"Modified: / 20.5.1998 / 21:53:18 / cg" |
|
212 |
! |
|
213 |
||
214 |
closeAllowedChannel:aValueHolderOrBlock |
|
215 |
"set a value-provider which controls if close is allowed." |
|
216 |
||
217 |
^ closeAllowedChannel |
|
218 |
||
219 |
"Created: / 20.5.1998 / 21:52:53 / cg" |
|
220 |
! |
|
221 |
||
222 |
closeChannel |
|
223 |
"return the closeChannel; If a true is stuffed into this valueHolder, |
|
224 |
I will close myself." |
|
225 |
||
226 |
^ close |
|
227 |
||
228 |
"Modified: / 20.5.1998 / 20:52:29 / cg" |
|
229 |
! ! |
|
230 |
||
1397 | 231 |
!SimpleDialog methodsFor:'accessing-window'! |
481 | 232 |
|
233 |
minWidth:nPixels |
|
3303 | 234 |
|w| |
481 | 235 |
|
236 |
w := builder window width. |
|
237 |
builder window width:(w max:nPixels). |
|
238 |
||
239 |
"/ box := builder window displayBox. |
|
240 |
"/ box width: (box width max: nPixels). |
|
241 |
"/ builder window displayBox: box |
|
242 |
||
243 |
"Modified: 3.3.1997 / 21:56:27 / cg" |
|
244 |
! ! |
|
245 |
||
431 | 246 |
!SimpleDialog methodsFor:'events'! |
247 |
||
248 |
closeAccept |
|
605 | 249 |
"accept was pressed. close the dialog" |
250 |
||
431 | 251 |
self requestForWindowClose ifTrue:[ |
1129 | 252 |
builder keyboardProcessor requestGlobalAutoAccept ifTrue:[ |
1943
0cff3328cb36
set acceptChannels valueHolder to true in closeAccept.
Claus Gittinger <cg@exept.de>
parents:
1881
diff
changeset
|
253 |
accept value:true. |
1129 | 254 |
self closeWindow |
255 |
] |
|
431 | 256 |
] |
605 | 257 |
|
258 |
"Modified: 17.6.1997 / 14:10:23 / cg" |
|
431 | 259 |
! |
260 |
||
261 |
closeCancel |
|
605 | 262 |
"cancel was pressed. close the dialog" |
263 |
||
431 | 264 |
self requestForWindowClose ifTrue:[ |
265 |
self closeWindow |
|
266 |
] |
|
605 | 267 |
|
268 |
"Modified: 17.6.1997 / 14:10:29 / cg" |
|
431 | 269 |
! |
270 |
||
271 |
closeWindow |
|
605 | 272 |
"close the dialog" |
273 |
||
1053 | 274 |
|c| |
275 |
||
276 |
c := self closeChannel. |
|
277 |
c retractInterestsFor:self. |
|
278 |
c value:true. |
|
3204 | 279 |
|
280 |
"/ must destroy instead of hide - otherwise there is no #release to |
|
281 |
"/ the controller (onChangeSend-dependency problem) |
|
282 |
"/ builder window destroy. "/ hide |
|
605 | 283 |
|
3204 | 284 |
"/ changed to use the general closeDownViews |
285 |
"/ (some want to redefine it and expect it to be called; it eventually also does a window destroy) |
|
286 |
self closeDownViews. |
|
287 |
||
288 |
"Modified (comment): / 31-07-2013 / 18:02:55 / cg" |
|
431 | 289 |
! |
290 |
||
291 |
requestForWindowClose |
|
1373 | 292 |
"the dialog is about to be closed - this method is invoked and may |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
293 |
return false to suppress the close. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
294 |
Here the value of closeAllowedChannel is returned, which is |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
295 |
set to true initially. |
1373 | 296 |
You may redefined this in a special dialog, and/or provide a boolean |
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
297 |
valueHolder or a boolean block via the #closeAllowedChannel: method." |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
298 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
299 |
^ closeAllowedChannel value |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
300 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
301 |
"Modified: / 20.5.1998 / 21:52:25 / cg" |
431 | 302 |
! ! |
303 |
||
713 | 304 |
!SimpleDialog methodsFor:'forced actions'! |
305 |
||
306 |
doAccept |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
307 |
"force accept" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
308 |
|
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
309 |
self accept value:true |
713 | 310 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
311 |
"Created: / 18.10.1997 / 05:18:09 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
312 |
"Modified: / 20.5.1998 / 21:53:35 / cg" |
713 | 313 |
! |
314 |
||
315 |
doCancel |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
316 |
"force cancel" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
317 |
|
1640
5bd912083327
Initialize accept and cancel valueHolders
Stefan Vogel <sv@exept.de>
parents:
1598
diff
changeset
|
318 |
self cancel value:true |
713 | 319 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
320 |
"Created: / 18.10.1997 / 05:18:22 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
321 |
"Modified: / 20.5.1998 / 21:53:40 / cg" |
713 | 322 |
! ! |
323 |
||
431 | 324 |
!SimpleDialog methodsFor:'initialization'! |
325 |
||
326 |
initialize |
|
3867 | 327 |
<modifier: #super> "must be called if redefined" |
328 |
||
935 | 329 |
accept := (ValueHolder with:false). |
330 |
close := (ValueHolder with:false). |
|
331 |
cancel := (ValueHolder with:false). |
|
978 | 332 |
self createBuilder. |
431 | 333 |
builder aspectAt:#accept put:accept. |
334 |
builder aspectAt:#close put:close. |
|
335 |
builder aspectAt:#cancel put:cancel. |
|
336 |
escapeIsCancel := true. |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
337 |
closeAllowedChannel := true |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
338 |
|
3867 | 339 |
"Modified: / 08-02-2017 / 00:34:07 / cg" |
476
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
340 |
! |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
341 |
|
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
342 |
initializeBuilderFor:aView |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
343 |
aView notNil ifTrue:[ |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
344 |
builder window:aView. |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
345 |
] |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
346 |
|
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
347 |
"Created: 3.3.1997 / 16:23:04 / cg" |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
348 |
! |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
349 |
|
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
350 |
initializeWindowFor:aView |
679 | 351 |
|v| |
476
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
352 |
|
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
353 |
(v := aView) isNil ifTrue:[ |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
354 |
v := ModalBox new. |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
355 |
]. |
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
356 |
|
481 | 357 |
builder setupWindowFor:v. |
476
628766c580c3
added dummy #initializeBuilderFor: and #initializeWindowFor:
Claus Gittinger <cg@exept.de>
parents:
466
diff
changeset
|
358 |
|
481 | 359 |
"Modified: 3.3.1997 / 20:39:46 / cg" |
431 | 360 |
! ! |
361 |
||
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
362 |
!SimpleDialog methodsFor:'opening-dialogInterface'! |
429 | 363 |
|
2877
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
364 |
allButOpenFor:anApplication interfaceSpec:aSpec withBindings:bindings |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
365 |
"open the dialog for some appModel from a given spec; |
3099 | 366 |
the bindings argument may provide overwriting bindings for the dialog. |
2877
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
367 |
Return true if accepted, false if canceled" |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
368 |
|
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
369 |
|app| |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
370 |
|
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
371 |
builder isNil ifTrue:[ self createBuilder ]. |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
372 |
|
2877
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
373 |
builder addBindings:bindings. |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
374 |
(app := anApplication) isNil ifTrue:[ |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
375 |
app := ApplicationModel new |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
376 |
]. |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
377 |
self source:app. |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
378 |
^ self allButOpenFrom:aSpec |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
379 |
|
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
380 |
"Created: / 05-11-2010 / 11:27:26 / cg" |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
381 |
! |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
382 |
|
431 | 383 |
allButOpenFrom:aSpec |
384 |
"create my views but do not open the main window" |
|
385 |
||
386 |
super allButOpenFrom:aSpec. |
|
387 |
self preOpen |
|
388 |
! |
|
389 |
||
4444 | 390 |
openDialogSpec:aSpec withBindings:bindings |
391 |
"open myself - return true if accepted" |
|
392 |
||
393 |
"/ Notice: redefined so that I open myself, instead of creating a new dialog |
|
394 |
"/ (which the inherited method would do) |
|
395 |
||
396 |
^ self openFor:(masterApplication ? self) spec:aSpec withBindings:bindings |
|
397 |
! |
|
398 |
||
429 | 399 |
openFor:anApplication interface:aSelector |
465 | 400 |
"open the dialog for some appModel from a given spec; |
401 |
Return true if accepted, false if canceled" |
|
402 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
462
diff
changeset
|
403 |
^ self openFor:anApplication interface:aSelector withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
462
diff
changeset
|
404 |
|
465 | 405 |
"Modified: 28.2.1997 / 16:22:08 / cg" |
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
462
diff
changeset
|
406 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
462
diff
changeset
|
407 |
|
4453 | 408 |
openFor:anApplication interface:anInterfaceSymbolOrSpecOrArray withBindings:bindings |
713 | 409 |
"open the dialog for some appModel from a given specSymbol; |
410 |
the application must provide an interfaceSpec for that symbol. |
|
411 |
The bindings argument may provide overwriting bindings for the |
|
412 |
dialog. |
|
413 |
Return true if accepted, false if canceled" |
|
414 |
||
4288 | 415 |
|spec| |
416 |
||
4453 | 417 |
(anInterfaceSymbolOrSpecOrArray isSymbol) ifTrue:[ |
418 |
spec := (anApplication interfaceSpecFor:anInterfaceSymbolOrSpecOrArray) |
|
4288 | 419 |
] ifFalse:[ |
4453 | 420 |
anInterfaceSymbolOrSpecOrArray isArray ifTrue:[ |
421 |
spec := anInterfaceSymbolOrSpecOrArray decodeAsLiteralArray |
|
422 |
] ifFalse:[ |
|
423 |
spec := anInterfaceSymbolOrSpecOrArray |
|
424 |
] |
|
4288 | 425 |
]. |
426 |
||
713 | 427 |
^ self |
428 |
openFor:anApplication |
|
4288 | 429 |
interfaceSpec:spec |
713 | 430 |
withBindings:bindings |
431 |
||
432 |
"Modified: 18.10.1997 / 04:43:13 / cg" |
|
433 |
! |
|
434 |
||
435 |
openFor:anApplication interfaceSpec:aSpec withBindings:bindings |
|
465 | 436 |
"open the dialog for some appModel from a given spec; |
437 |
the bindings argument may provide overwriting bindings for the |
|
438 |
dialog. |
|
439 |
Return true if accepted, false if canceled" |
|
440 |
||
2877
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
441 |
self allButOpenFor:anApplication interfaceSpec:aSpec withBindings:bindings. |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
442 |
self openDialog. |
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
443 |
^ accept value |
1491 | 444 |
|
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
445 |
"Created: / 07-07-2011 / 16:52:04 / cg" |
429 | 446 |
! |
447 |
||
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
448 |
openFor:anApplication spec:aSpec withBindings:bindings |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
449 |
"open the dialog for some appModel from a given spec. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
450 |
The bindings argument may provide overwriting bindings for the |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
451 |
dialog. |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
452 |
Return true if accepted, false if canceled" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
453 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
454 |
^ self |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
455 |
openFor:anApplication |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
456 |
interfaceSpec:aSpec |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
457 |
withBindings:bindings |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
458 |
|
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
459 |
"Modified: / 18.10.1997 / 04:43:13 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
460 |
"Created: / 20.5.1998 / 20:28:29 / cg" |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
461 |
! |
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
462 |
|
429 | 463 |
openFrom:anInterfaceSpec |
466 | 464 |
"open the dialog from a given spec; |
465 |
return true if accepted, false if canceled" |
|
466 |
||
429 | 467 |
self allButOpenFrom:anInterfaceSpec. |
468 |
self openDialog. |
|
431 | 469 |
^ accept value |
470 |
||
466 | 471 |
"Modified: 28.2.1997 / 16:40:36 / cg" |
431 | 472 |
! |
473 |
||
1441 | 474 |
openInterface:aSymbol |
475 |
"open a standard interface. |
|
476 |
Redefined to return the accept value instead of the builder." |
|
477 |
||
3493 | 478 |
self accept setValue:false. |
3422 | 479 |
|
1441 | 480 |
super openInterfaceModal:aSymbol. |
2500
d146fa50819b
allow for an acceptValue to be returned
Claus Gittinger <cg@exept.de>
parents:
2441
diff
changeset
|
481 |
acceptedValue notNil ifTrue:[^ acceptedValue]. |
1441 | 482 |
^ accept value. |
483 |
||
484 |
"Created: / 23.1.1998 / 18:19:57 / cg" |
|
485 |
"Modified: / 20.5.1998 / 20:21:28 / cg" |
|
486 |
! |
|
487 |
||
3180 | 488 |
openInterface:aSymbol at:position |
489 |
"open a standard interface. |
|
490 |
Redefined to return the accept value instead of the builder." |
|
491 |
||
492 |
super openInterfaceModal:aSymbol at:position. |
|
493 |
acceptedValue notNil ifTrue:[^ acceptedValue]. |
|
494 |
^ accept value. |
|
495 |
||
496 |
"Created: / 23.1.1998 / 18:19:57 / cg" |
|
497 |
"Modified: / 20.5.1998 / 20:21:28 / cg" |
|
498 |
! |
|
499 |
||
3495 | 500 |
openModelessFor:anApplication interfaceSpec:aSpec withBindings:bindings |
501 |
"open the dialog for some appModel from a given spec; |
|
502 |
the bindings argument may provide overwriting bindings for the |
|
503 |
dialog. |
|
504 |
Return immediately, not blocking the caller" |
|
505 |
||
506 |
self allButOpenFor:anApplication interfaceSpec:aSpec withBindings:bindings. |
|
507 |
self openDialogModeless |
|
508 |
! |
|
509 |
||
510 |
openModelessFor:anApplication spec:aSpec withBindings:bindings |
|
511 |
"open the dialog for some appModel from a given spec. |
|
512 |
The bindings argument may provide overwriting bindings for the |
|
513 |
dialog. |
|
514 |
Return immediately (i.e non-blocking the caller)" |
|
515 |
||
516 |
self |
|
517 |
openModelessFor:anApplication |
|
518 |
interfaceSpec:aSpec |
|
519 |
withBindings:bindings |
|
520 |
! |
|
521 |
||
1441 | 522 |
openSpec:aWindowSpec |
523 |
"open a window spec. |
|
524 |
Redefned to open modal and to return the accept value instead |
|
525 |
of the builder." |
|
526 |
||
527 |
super openSpecModal:aWindowSpec. |
|
528 |
^ accept value. |
|
529 |
||
530 |
"Modified: / 22.4.1998 / 11:59:05 / cg" |
|
531 |
"Created: / 20.5.1998 / 20:21:17 / cg" |
|
532 |
! |
|
533 |
||
1440
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
534 |
openSpec:anInterfaceSpec withBindings:bindings |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
535 |
"open the dialog with a given spec; |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
536 |
The bindings argument is mandatory and provides aspect bindings for the |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
537 |
dialog. |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
538 |
Return true if accepted, false if canceled" |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
539 |
|
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
540 |
^ self |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
541 |
openFor:self |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
542 |
interfaceSpec:anInterfaceSpec |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
543 |
withBindings:bindings |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
544 |
! |
7a0b8cc86e87
added #openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
1427
diff
changeset
|
545 |
|
713 | 546 |
postBuildWith:aBuilder |
3970 | 547 |
"this is sent after the dialog's widgets have been created |
713 | 548 |
(but before the dialog is opened). |
549 |
If a postBuildBlock was set, evaluate it here." |
|
550 |
||
551 |
postBuildBlock notNil ifTrue:[ |
|
1551
f3428747591f
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
552 |
postBuildBlock valueWithOptionalArgument:aBuilder |
713 | 553 |
]. |
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
554 |
builder source ~= self ifTrue:[ |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
555 |
"/ I was opened as dialogInterface for another application; |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
556 |
"/ inform it that I am ready now |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
557 |
builder source postBuildDialogWith:aBuilder |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
558 |
]. |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
559 |
|
713 | 560 |
super postBuildWith:aBuilder |
561 |
||
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
562 |
"Created: / 18-10-1997 / 05:17:12 / cg" |
3970 | 563 |
"Modified (comment): / 03-08-2017 / 14:39:04 / cg" |
713 | 564 |
! |
565 |
||
566 |
postOpenWith:aBuilder |
|
3970 | 567 |
"this is sent after the dialog's main window is opened. |
713 | 568 |
If a postOpenBlock was set, evaluate it here." |
569 |
||
570 |
postOpenBlock notNil ifTrue:[ |
|
1551
f3428747591f
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
571 |
postOpenBlock valueWithOptionalArgument:aBuilder |
713 | 572 |
]. |
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
573 |
builder source ~= self ifTrue:[ |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
574 |
"/ I was opened as dialogInterface for another application; |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
575 |
"/ inform it that I am ready now |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
576 |
builder source postOpenDialogWith:aBuilder |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
577 |
]. |
713 | 578 |
super postOpenWith:aBuilder |
579 |
||
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
580 |
"Created: / 18-10-1997 / 05:15:48 / cg" |
3970 | 581 |
"Modified (comment): / 03-08-2017 / 14:39:08 / cg" |
713 | 582 |
! |
583 |
||
584 |
preBuildWith:aBuilder |
|
3970 | 585 |
"this is sent before the dialog's widgets are created. |
713 | 586 |
If a preBuildBlock was set, evaluate it here." |
587 |
||
588 |
preBuildBlock notNil ifTrue:[ |
|
1551
f3428747591f
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
589 |
preBuildBlock valueWithOptionalArgument:aBuilder |
713 | 590 |
]. |
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
591 |
builder source ~= self ifTrue:[ |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
592 |
"/ I was opened as dialogInterface for another application; |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
593 |
"/ inform it that I am ready now |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
594 |
builder source preBuildDialogWith:aBuilder |
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
595 |
]. |
713 | 596 |
super preBuildWith:aBuilder |
597 |
||
2922
ff84e43f9c94
special postBuildDialog & postOpenDialog hooks for apps opening
Claus Gittinger <cg@exept.de>
parents:
2877
diff
changeset
|
598 |
"Created: / 18-10-1997 / 15:02:27 / cg" |
3970 | 599 |
"Modified (comment): / 03-08-2017 / 14:39:11 / cg" |
713 | 600 |
! |
601 |
||
431 | 602 |
preOpen |
605 | 603 |
"arrange for #closeAccept & #closeCancel to be invoked when |
604 |
either accept or close is triggered |
|
605 |
(usually the models of corresponding buttons)" |
|
606 |
||
431 | 607 |
accept onChangeSend:#closeAccept to:self. |
608 |
cancel onChangeSend:#closeCancel to:self. |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
609 |
close onChangeSend:#closeWindow to:self. |
429 | 610 |
|
932
f7b0ce4cc1d1
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
906
diff
changeset
|
611 |
"Modified: / 20.5.1998 / 20:49:26 / cg" |
3299 | 612 |
! |
613 |
||
614 |
preOpenWith:aBuilder |
|
3970 | 615 |
"this is sent after the dialog's main window is opened. |
3299 | 616 |
If a postOpenBlock was set, evaluate it here." |
617 |
||
618 |
builder source ~= self ifTrue:[ |
|
619 |
"/ I was opened as dialogInterface for another application; |
|
620 |
"/ inform it that I am ready now |
|
621 |
builder source preOpenDialogWith:aBuilder |
|
622 |
]. |
|
623 |
super preOpenWith:aBuilder |
|
624 |
||
625 |
"Created: / 05-03-2014 / 18:47:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3970 | 626 |
"Modified (comment): / 03-08-2017 / 14:39:15 / cg" |
429 | 627 |
! ! |
628 |
||
366 | 629 |
!SimpleDialog methodsFor:'queries'! |
630 |
||
631 |
defaultWindowType |
|
632 |
"SimpleDialogs come up modal, by default" |
|
633 |
||
634 |
^ #dialog |
|
635 |
||
636 |
"Modified: 14.2.1997 / 22:17:20 / cg" |
|
3205 | 637 |
! |
638 |
||
639 |
shouldRememberLastExtent |
|
3208 | 640 |
(self accepted) ifFalse:[^ false]. |
641 |
^ super shouldRememberLastExtent |
|
3205 | 642 |
|
643 |
"Created: / 31-07-2013 / 18:06:12 / cg" |
|
366 | 644 |
! ! |
645 |
||
646 |
!SimpleDialog class methodsFor:'documentation'! |
|
647 |
||
3205 | 648 |
version |
3493 | 649 |
^ '$Header$' |
3205 | 650 |
! |
651 |
||
2877
2ab7a4fa2b3d
added: #allButOpenFor:interfaceSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
652 |
version_CVS |
3493 | 653 |
^ '$Header$' |
366 | 654 |
! ! |
3099 | 655 |