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