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