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