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