author | Claus Gittinger <cg@exept.de> |
Wed, 16 Feb 2000 22:42:27 +0100 | |
changeset 1350 | cf8c3c79df78 |
parent 1349 | fb1270fff111 |
child 1358 | 3870ff2d5ce3 |
permissions | -rw-r--r-- |
50 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
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 |
" |
|
12 |
||
13 |
Model subclass:#ApplicationModel |
|
588
106b7def4d65
added a handle for a master application (for subApps)
Claus Gittinger <cg@exept.de>
parents:
521
diff
changeset
|
14 |
instanceVariableNames:'builder resources device masterApplication' |
389 | 15 |
classVariableNames:'DefaultLabels DefaultVisuals' |
142
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
16 |
poolDictionaries:'' |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
17 |
category:'Interface-Framework' |
50 | 18 |
! |
19 |
||
138 | 20 |
ApplicationModel class instanceVariableNames:'ClassResources' |
21 |
||
22 |
" |
|
1332
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
23 |
No other class instance variables are inherited by this class. |
138 | 24 |
" |
25 |
! |
|
52 | 26 |
|
361 | 27 |
!ApplicationModel class methodsFor:'documentation'! |
50 | 28 |
|
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
Since many ST-80 classes are subclasses of ApplicationModel, this class |
|
46 |
is provided here to allow easier porting of ST-80 code. |
|
57 | 47 |
|
429 | 48 |
It does not (currently) provide all functionality and is NOT |
63 | 49 |
compatible to the corresponding ST80 class; therefore, manual |
50 | 50 |
changes have to be made to get those applications to run under ST/X. |
57 | 51 |
(but at least, this enables you to fileIn that code and have a superclass |
78 | 52 |
for them) |
53 |
||
54 |
As time goes by, ST/X applications are going to be converted to |
|
330
d7ce98930ad3
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
313
diff
changeset
|
55 |
become subclasses of this abstract class - see Launcher for a |
78 | 56 |
first concrete example. |
57 |
||
215 | 58 |
|
78 | 59 |
ApplicationModel is prepared to build a view from a windowSpec, as |
215 | 60 |
created by the windowBuilder. If your subclass does not provide such |
78 | 61 |
a spec, you should at least redefine: |
62 |
||
215 | 63 |
#openInterface - to create a topview and open it |
78 | 64 |
|
65 |
you may want to redefine: |
|
66 |
||
215 | 67 |
#closeRequest - to catch window closing |
68 |
#focusSequence - to define a sequence for focus-stepping |
|
78 | 69 |
|
50 | 70 |
|
215 | 71 |
Once the interfaceBuilder is finished & released, subclasses can |
72 |
alternatively provide the spec via a #windowSpec method. |
|
73 |
||
52 | 74 |
The classResources have been put into this class to allow ST/X |
57 | 75 |
applications (which used to be subclasses of StandardSystemView) |
76 |
to migrate smoothly into ApplicationModels (which is better design ...). |
|
52 | 77 |
|
78 |
||
215 | 79 |
[Instance variables:] |
80 |
resources ResourcePack language string translation |
|
81 |
||
82 |
builder WindowBuilder a builder who knows how to create |
|
83 |
a window hierarchy from a specification |
|
78 | 84 |
|
85 |
||
86 |
Notice: this class was implemented using protocol information |
|
87 |
from alpha testers and PD code - it may not be complete or compatible to |
|
88 |
the corresponding ST-80 class. If you encounter any incompatibilities, |
|
89 |
please forward a note to the ST/X team. |
|
215 | 90 |
|
91 |
||
221 | 92 |
[author:] |
93 |
Claus Gittinger |
|
94 |
||
215 | 95 |
[see also:] |
96 |
StandardSystemView |
|
97 |
WindowGroup DeviceWorkstation |
|
50 | 98 |
" |
99 |
! ! |
|
100 |
||
361 | 101 |
!ApplicationModel class methodsFor:'initialization'! |
52 | 102 |
|
103 |
initialize |
|
104 |
self == ApplicationModel ifTrue:[ |
|
389 | 105 |
Smalltalk addDependent:self |
106 |
]. |
|
107 |
DefaultLabels isNil ifTrue:[ |
|
108 |
DefaultLabels := IdentityDictionary new |
|
109 |
]. |
|
110 |
DefaultVisuals isNil ifTrue:[ |
|
111 |
DefaultVisuals := IdentityDictionary new |
|
112 |
]. |
|
52 | 113 |
|
114 |
" |
|
115 |
ApplicationModel initialize |
|
116 |
" |
|
389 | 117 |
|
118 |
"Modified: 28.1.1997 / 12:31:38 / cg" |
|
52 | 119 |
! ! |
120 |
||
361 | 121 |
!ApplicationModel class methodsFor:'instance creation'! |
52 | 122 |
|
123 |
new |
|
215 | 124 |
"return a new initialized instance" |
125 |
||
1110 | 126 |
^ super basicNew basicInitialize initialize |
215 | 127 |
|
128 |
"Modified: 24.4.1996 / 09:42:14 / cg" |
|
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
129 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
130 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
131 |
onDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
132 |
"return a new initialized instance, which shall open its interface |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
133 |
on aDevice." |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
134 |
|
1110 | 135 |
^ (super basicNew basicInitialize |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
136 |
setDevice:aDevice) initialize |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
137 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
138 |
"Modified: 24.4.1996 / 09:42:14 / cg" |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
139 |
"Created: 5.7.1996 / 12:19:15 / cg" |
52 | 140 |
! ! |
141 |
||
421 | 142 |
!ApplicationModel class methodsFor:'accessing'! |
143 |
||
144 |
application |
|
145 |
^ self |
|
146 |
||
147 |
! ! |
|
148 |
||
599 | 149 |
!ApplicationModel class methodsFor:'active help'! |
150 |
||
151 |
helpSpec |
|
152 |
^ IdentityDictionary new. |
|
153 |
! ! |
|
154 |
||
421 | 155 |
!ApplicationModel class methodsFor:'bindings'! |
156 |
||
157 |
actionFor:aKey |
|
158 |
"sent by the builder to ask for an actionBlock for |
|
159 |
a Button. The argument, aKey comes from an UI-spec |
|
160 |
for a buttons #action property. |
|
161 |
Here, a corresponding message is sent to myself, |
|
162 |
which ought to be defined in the application subclass. |
|
163 |
Alternatively, a subclass may redefine this method, to provide |
|
164 |
actionBlocks from a Dictionary or whatever. |
|
165 |
Typically, a block is returned there." |
|
166 |
||
167 |
^ nil |
|
168 |
||
169 |
||
170 |
! |
|
171 |
||
715 | 172 |
actionFor:aKey withValue:aValue |
173 |
"sent by the builder to ask for an actionBlock for |
|
174 |
a Button which passes a value to the actionMethod. |
|
175 |
The argument, aKey comes from an UI-spec |
|
176 |
for a buttons #action property. |
|
177 |
Here, a corresponding message is sent to myself, |
|
178 |
which ought to be defined in the application subclass. |
|
179 |
Alternatively, a subclass may redefine this method, to provide |
|
180 |
actionBlocks from a Dictionary or whatever. |
|
181 |
Typically, a block is returned there." |
|
182 |
||
183 |
^ nil |
|
184 |
||
185 |
||
186 |
! |
|
187 |
||
421 | 188 |
aspectFor:aKey |
189 |
"sent by the builder to ask for an aspect (a data model). |
|
190 |
The argument, aKey comes from an UI-spec |
|
191 |
for a components #aspect property. |
|
192 |
Here, a corresponding message is sent to myself, |
|
193 |
which ought to be defined in the application subclass. |
|
194 |
Alternatively, a subclass may redefine this method, to provide |
|
195 |
holders from a Dictionary or whatever. |
|
196 |
Typically, a valueHolder is returned there." |
|
197 |
||
723 | 198 |
^ self perform:aKey |
421 | 199 |
|
723 | 200 |
"/ ^ nil |
201 |
||
202 |
"Modified: / 27.10.1997 / 13:43:12 / cg" |
|
421 | 203 |
! |
204 |
||
205 |
clientFor:aKey |
|
206 |
"sent by the builder to ask for an application provided |
|
207 |
subcanvas's application. |
|
208 |
The argument, aKey comes from an UI-spec |
|
209 |
for a subcanvas's #client property. |
|
210 |
Here, a corresponding message is sent to myself, |
|
211 |
which ought to be defined in the application subclass. |
|
212 |
Alternatively, a subclass may redefine this method, to provide |
|
213 |
appModels from a Dictionary or whatever. |
|
214 |
Typically, an applicationModel is returned there." |
|
215 |
||
216 |
^ nil |
|
217 |
||
218 |
! |
|
219 |
||
220 |
componentFor:aKey |
|
221 |
"sent by the builder to ask for an application provided |
|
222 |
component. |
|
223 |
The argument, aKey comes from an UI-spec |
|
224 |
for a viewHolders #view property. |
|
225 |
Here, a corresponding message is sent to myself, |
|
226 |
which ought to be defined in the application subclass. |
|
227 |
Alternatively, a subclass may redefine this method, to provide |
|
228 |
holders from a Dictionary or whatever. |
|
229 |
Typically, a view is returned there." |
|
230 |
||
427 | 231 |
(self respondsTo:aKey) ifTrue:[ |
232 |
^ self perform:aKey |
|
233 |
]. |
|
234 |
^ nil |
|
421 | 235 |
! |
236 |
||
237 |
labelFor:aKey |
|
238 |
"sent by the builder to ask for an application provided |
|
239 |
label for a component. |
|
240 |
The argument, aKey comes from an UI-spec |
|
241 |
for a components #label property. |
|
242 |
Here, a corresponding message is sent to myself, |
|
243 |
which ought to be defined in the application subclass. |
|
244 |
Alternatively, a subclass may redefine this method, to provide |
|
245 |
labels from a Dictionary or whatever. |
|
246 |
Typically, a string is returned there." |
|
247 |
||
248 |
(self application respondsTo:aKey) ifTrue:[ |
|
249 |
^ self application perform:aKey |
|
250 |
]. |
|
251 |
^ self application labelAt:aKey ifAbsent:nil |
|
252 |
||
253 |
! |
|
254 |
||
255 |
listFor:aKey |
|
256 |
"sent by the builder to ask for an application provided |
|
257 |
holder for a list. |
|
258 |
The argument, aKey comes from an UI-spec |
|
259 |
for a listWidgets #list property. |
|
260 |
Here, a corresponding message is sent to myself, |
|
261 |
which ought to be defined in the application subclass. |
|
262 |
Alternatively, a subclass may redefine this method, to provide |
|
263 |
holders from a Dictionary or whatever. |
|
264 |
Typically, a list-holding model (SelectionInList) is returned there." |
|
265 |
||
483 | 266 |
|app| |
421 | 267 |
|
483 | 268 |
(app := self application) notNil ifTrue:[ |
269 |
(app respondsTo:aKey) ifTrue:[ |
|
270 |
^ app perform:aKey |
|
271 |
] |
|
272 |
]. |
|
273 |
^ nil. |
|
274 |
||
275 |
"Modified: 4.3.1997 / 00:53:03 / cg" |
|
421 | 276 |
! |
277 |
||
278 |
menuFor:aKey |
|
279 |
"sent by the builder to ask for an application provided |
|
280 |
holder for a menu. |
|
281 |
The argument, aKey comes from an UI-spec |
|
282 |
for a widgets #menu property. |
|
283 |
Here, a corresponding message is sent to myself, |
|
284 |
which ought to be defined in the application subclass. |
|
285 |
Alternatively, a subclass may redefine this method, to provide |
|
286 |
holders from a Dictionary or whatever. |
|
287 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
288 |
||
289 |
^ self application perform:aKey |
|
290 |
||
291 |
! |
|
292 |
||
293 |
specificationFor:aKey |
|
294 |
"sent by the builder to ask for an application provided |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
295 |
specification for a subcanvas or subspecification. |
421 | 296 |
The argument, aKey comes from an UI-spec |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
297 |
for a subcanvases #specification property (minorKey). |
421 | 298 |
Here, a corresponding message is sent to myself, |
299 |
which ought to be defined in the application subclass. |
|
300 |
Alternatively, a subclass may redefine this method, to provide |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
301 |
interfaceSpecifications from a Dictionary or whatever. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
302 |
Typically, an interfaceSpecification is returned there." |
421 | 303 |
|
304 |
^ self application perform:aKey |
|
305 |
||
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
306 |
"Modified: / 5.2.1998 / 00:21:57 / stefan" |
421 | 307 |
! |
308 |
||
309 |
visualFor:aKey |
|
310 |
"sent by the builder to ask for an application provided |
|
311 |
image or element for a label. |
|
312 |
The argument, aKey comes from an UI-spec |
|
313 |
for a widgets #label property, if LabelIsImage is turned on. |
|
314 |
Here, a corresponding message is sent to myself, |
|
315 |
which ought to be defined in the application subclass. |
|
316 |
Alternatively, a subclass may redefine this method, to provide |
|
317 |
images from a Dictionary or whatever. |
|
318 |
Typically, an image is returned there." |
|
319 |
||
320 |
(self application respondsTo:aKey) ifTrue:[ |
|
321 |
^ self application perform:aKey |
|
322 |
]. |
|
323 |
^ self application visualAt:aKey ifAbsent:nil |
|
324 |
||
325 |
||
326 |
! ! |
|
327 |
||
361 | 328 |
!ApplicationModel class methodsFor:'change & update'! |
52 | 329 |
|
302 | 330 |
update:something with:aParameter from:changedObject |
69 | 331 |
"flush resources on language changes" |
332 |
||
52 | 333 |
something == #Language ifTrue:[ |
302 | 334 |
"flush resources on language changes" |
335 |
self flushAllClassResources |
|
52 | 336 |
] |
302 | 337 |
|
338 |
"Created: 15.6.1996 / 15:13:29 / cg" |
|
52 | 339 |
! ! |
340 |
||
421 | 341 |
!ApplicationModel class methodsFor:'defaults'! |
342 |
||
1194
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
343 |
defaultIcon |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
344 |
^ nil |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
345 |
! |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
346 |
|
421 | 347 |
labelAt:aKey |
348 |
^ nil |
|
349 |
! |
|
350 |
||
351 |
labelAt:aKey ifAbsent:aBlock |
|
352 |
^ aBlock value |
|
353 |
! |
|
354 |
||
355 |
labelAt:aKey put:aValue |
|
356 |
"/ not yet implemented |
|
357 |
! |
|
358 |
||
359 |
labels |
|
360 |
"/ not yet implemented |
|
361 |
^ nil |
|
362 |
! |
|
363 |
||
364 |
visualAt:aKey |
|
365 |
^ nil |
|
366 |
! |
|
367 |
||
368 |
visualAt:aKey ifAbsent:aBlock |
|
369 |
^ aBlock value |
|
370 |
! |
|
371 |
||
372 |
visualAt:aKey put:aValue |
|
373 |
"/ not yet implemented |
|
374 |
! |
|
375 |
||
376 |
visuals |
|
377 |
"/ not yet implemented |
|
378 |
^ nil |
|
379 |
! ! |
|
380 |
||
361 | 381 |
!ApplicationModel class methodsFor:'queries'! |
63 | 382 |
|
383 |
interfaceSpecFor:aSelector |
|
69 | 384 |
"return an interface spec" |
385 |
||
421 | 386 |
^ UISpecification from:(self application specificationFor:aSelector) |
723 | 387 |
! |
388 |
||
389 |
isVisualStartable |
|
390 |
"return true, if this application can be started via #open" |
|
391 |
||
392 |
(self == ApplicationModel) ifTrue:[^ false "I am abstract"]. |
|
866
69fc17d99254
also allow for non-windowSpec applications to be opened via dbl-click
Claus Gittinger <cg@exept.de>
parents:
852
diff
changeset
|
393 |
((self respondsTo:#open) or:[self class implements:#openInterface]) ifFalse:[^ false]. |
69fc17d99254
also allow for non-windowSpec applications to be opened via dbl-click
Claus Gittinger <cg@exept.de>
parents:
852
diff
changeset
|
394 |
"/ (self respondsTo:#windowSpec) ifFalse:[^ false]. |
723 | 395 |
^ true |
396 |
||
397 |
"Created: / 27.10.1997 / 16:38:02 / cg" |
|
866
69fc17d99254
also allow for non-windowSpec applications to be opened via dbl-click
Claus Gittinger <cg@exept.de>
parents:
852
diff
changeset
|
398 |
"Modified: / 14.3.1998 / 16:30:50 / cg" |
63 | 399 |
! ! |
400 |
||
361 | 401 |
!ApplicationModel class methodsFor:'resources'! |
52 | 402 |
|
403 |
classResources |
|
404 |
"if not already loaded, get the classes resourcePack |
|
405 |
and return it" |
|
406 |
||
407 |
ClassResources isNil ifTrue:[ |
|
408 |
ClassResources := ResourcePack for:self. |
|
409 |
]. |
|
410 |
^ ClassResources |
|
411 |
! |
|
412 |
||
413 |
classResources:aResourcePack |
|
414 |
"allow setting of the classResources" |
|
415 |
||
416 |
ClassResources := aResourcePack |
|
417 |
! |
|
418 |
||
419 |
flushAllClassResources |
|
420 |
"flush all classes resource translations. |
|
421 |
Needed after a resource file / language setting has changed." |
|
422 |
||
423 |
ResourcePack flushCachedResourcePacks. |
|
424 |
self flushClassResources. |
|
425 |
self allSubclassesDo:[:aClass | |
|
426 |
aClass flushClassResources. |
|
427 |
] |
|
428 |
! |
|
429 |
||
430 |
flushClassResources |
|
431 |
"flush classes resource string translations. |
|
432 |
Needed whenever a resource file / language setting has changed" |
|
433 |
||
434 |
ClassResources := nil. |
|
63 | 435 |
! |
436 |
||
921
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
437 |
resources |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
438 |
"return the applications resources - thats a ResourcePack containing |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
439 |
language strings" |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
440 |
|
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
441 |
^ self classResources |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
442 |
|
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
443 |
"Created: / 19.5.1998 / 20:14:00 / cg" |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
444 |
! |
69a82d996936
added #resources for commin interface with instances
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
445 |
|
63 | 446 |
updateClassResources |
447 |
"update my classResources" |
|
448 |
||
449 |
ClassResources := nil. |
|
450 |
self classResources |
|
52 | 451 |
! ! |
452 |
||
361 | 453 |
!ApplicationModel class methodsFor:'startup'! |
138 | 454 |
|
455 |
open |
|
456 |
"create an instance of the application and open its view" |
|
457 |
||
240 | 458 |
^ self new open |
138 | 459 |
|
460 |
" |
|
361 | 461 |
Launcher open |
138 | 462 |
" |
240 | 463 |
|
361 | 464 |
"Modified: 13.1.1997 / 20:54:50 / cg" |
138 | 465 |
! |
466 |
||
428 | 467 |
openAt:aLocation |
468 |
"create an instance of the application and open its view |
|
469 |
at some position." |
|
470 |
||
471 |
^ self new openAt:aLocation |
|
472 |
||
473 |
"Modified: 14.2.1997 / 20:28:41 / cg" |
|
474 |
! |
|
475 |
||
476 |
openDialogInterface:anInterfaceSymbol |
|
477 |
"create an instance of the application and open a view as |
|
478 |
specified by anInterfaceSymbol." |
|
479 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
480 |
^ self openDialogInterface:anInterfaceSymbol withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
481 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
482 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
483 |
"Created: 14.2.1997 / 20:33:10 / cg" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
484 |
"Modified: 28.2.1997 / 14:07:36 / cg" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
485 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
486 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
487 |
openDialogInterface:anInterfaceSymbol withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
488 |
"create an instance of the application and open a view as |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
489 |
specified by anInterfaceSymbol." |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
490 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
491 |
^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings |
428 | 492 |
|
493 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
494 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
495 |
"Created: 28.2.1997 / 14:07:24 / cg" |
428 | 496 |
! |
497 |
||
1305
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
498 |
openDialogInterfaceSpec:anInterfaceSpec |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
499 |
"create an instance of the application and open a view as |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
500 |
specified by the given spec." |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
501 |
|
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
502 |
^ self new |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
503 |
openDialogInterfaceSpec:anInterfaceSpec |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
504 |
withBindings:nil |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
505 |
! |
fd53dd6c4f4a
added #openDialogInterfaceSpec:
Claus Gittinger <cg@exept.de>
parents:
1302
diff
changeset
|
506 |
|
1152 | 507 |
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings |
508 |
"create an instance of the application and open a view as |
|
509 |
specified by the given spec." |
|
510 |
||
511 |
^ self new |
|
512 |
openDialogInterfaceSpec:anInterfaceSpec |
|
513 |
withBindings:bindings |
|
514 |
||
515 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
516 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
517 |
"Created: 28.2.1997 / 14:07:24 / cg" |
|
518 |
! |
|
519 |
||
933
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
520 |
openDialogSpec:aSpec |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
521 |
"create an instance of the application and open a view as |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
522 |
specified by aSpec." |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
523 |
|
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
524 |
^ self openDialogSpec:aSpec withBindings:nil |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
525 |
|
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
526 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
527 |
"Modified: / 28.2.1997 / 14:07:36 / cg" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
528 |
"Created: / 20.5.1998 / 20:27:08 / cg" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
529 |
! |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
530 |
|
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
531 |
openDialogSpec:aSpec withBindings:bindings |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
532 |
"create an instance of the application and open a view as |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
533 |
specified by the spec." |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
534 |
|
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
535 |
^ self new openDialogSpec:aSpec withBindings:bindings |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
536 |
|
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
537 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
538 |
"Modified: / 13.1.1997 / 20:55:02 / cg" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
539 |
"Created: / 20.5.1998 / 20:26:37 / cg" |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
540 |
! |
36d38398b0c0
allow opening an interface by spec.
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
541 |
|
138 | 542 |
openInterface:anInterfaceSymbol |
543 |
"create an instance of the application and open a view as |
|
544 |
specified by anInterfaceSymbol." |
|
545 |
||
361 | 546 |
^ self new openInterface:anInterfaceSymbol |
138 | 547 |
|
548 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
361 | 549 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
138 | 550 |
! |
551 |
||
428 | 552 |
openInterface:anInterfaceSymbol at:aPoint |
553 |
"create an instance of the application and open a view as |
|
554 |
specified by anInterfaceSymbol." |
|
555 |
||
556 |
^ self new openInterface:anInterfaceSymbol at:aPoint |
|
557 |
||
558 |
"Modified: 14.2.1997 / 20:28:47 / cg" |
|
559 |
! |
|
560 |
||
657 | 561 |
openModal |
562 |
"create an instance of the application and open its view modal" |
|
563 |
||
564 |
^ self new openModal |
|
565 |
! |
|
566 |
||
138 | 567 |
openOn:anApplicationModel |
215 | 568 |
"send an open message to the argument, anApplicationModel. |
569 |
I dont really understand what this method is useful for ..." |
|
138 | 570 |
|
361 | 571 |
^ anApplicationModel open |
215 | 572 |
|
361 | 573 |
"Modified: 13.1.1997 / 20:55:05 / cg" |
138 | 574 |
! |
575 |
||
576 |
openOnDevice:aDevice |
|
577 |
"create an instance of the application and open its view |
|
215 | 578 |
on ANOTHER device. |
579 |
For more info, read the document on multiple display |
|
580 |
support and the documentation of the DeviceWorkstation class." |
|
138 | 581 |
|
361 | 582 |
^ (self onDevice:aDevice) open |
215 | 583 |
|
361 | 584 |
" |
585 |
Launcher openOnDevice:Display |
|
586 |
" |
|
587 |
||
588 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
685 | 589 |
! |
590 |
||
1279 | 591 |
openOnXScreenNamed:aScreenName |
592 |
"create an instance of the application and open its view |
|
593 |
on some X display screen. The argument aScreenName must be |
|
594 |
a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0'). |
|
595 |
For more info, read the document on multiple display |
|
596 |
support and the documentation of the DeviceWorkstation class." |
|
597 |
||
598 |
|newDevice someScreen| |
|
599 |
||
600 |
newDevice := XWorkstation new. |
|
601 |
newDevice := newDevice initializeFor:aScreenName. |
|
602 |
newDevice isNil ifTrue:[ |
|
1286 | 603 |
Screen current notNil ifTrue:[ |
604 |
self warn:('Could not open display: ' , aScreenName). |
|
605 |
] ifFalse:[ |
|
606 |
('Could not open display: ' , aScreenName) errorPrintCR |
|
607 |
]. |
|
1279 | 608 |
^ nil. |
609 |
]. |
|
610 |
newDevice startDispatch. |
|
611 |
(someScreen := Screen current) isNil ifTrue:[ |
|
612 |
someScreen := Screen default. |
|
613 |
]. |
|
614 |
someScreen notNil ifTrue:[ |
|
615 |
newDevice keyboardMap:(someScreen keyboardMap). |
|
616 |
newDevice buttonTranslation:(someScreen buttonTranslation). |
|
617 |
]. |
|
618 |
"/ arrange for it to finish its event dispatch loop, |
|
619 |
"/ when the last view on it is closed. |
|
620 |
newDevice exitOnLastClose:true. |
|
621 |
||
622 |
^ (self onDevice:newDevice) open |
|
623 |
||
624 |
" |
|
625 |
Launcher openOnXScreenNamed:'sgi:0' |
|
626 |
" |
|
627 |
||
628 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
629 |
! |
|
630 |
||
685 | 631 |
openWithSpec:aSpecSymbol |
632 |
"ST80 compatibility: |
|
633 |
mhmh - what is the difference to #openInterface ?" |
|
634 |
||
635 |
^ self openInterface:aSpecSymbol |
|
636 |
||
637 |
"Modified: 29.8.1997 / 01:16:52 / cg" |
|
138 | 638 |
! ! |
639 |
||
640 |
!ApplicationModel methodsFor:'accessing'! |
|
641 |
||
421 | 642 |
application |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
643 |
"application knows about interfaceSpecs, menuSpecs etc. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
644 |
Usually this is my class. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
645 |
This may be redefined in subclasses" |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
646 |
|
421 | 647 |
^ self class |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
648 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
649 |
"Modified: / 5.2.1998 / 00:45:21 / stefan" |
421 | 650 |
! |
651 |
||
138 | 652 |
builder |
653 |
"return the applications builder; this one has more information |
|
654 |
about views, components etc." |
|
655 |
||
656 |
^ builder |
|
657 |
! |
|
658 |
||
659 |
builder:aBuilder |
|
660 |
"set the applications builder. Normally, you should not set it |
|
661 |
directly, but depend on the default builder, as created when the application |
|
662 |
was created." |
|
663 |
||
664 |
builder := aBuilder |
|
665 |
! |
|
666 |
||
667 |
focusSequence |
|
668 |
"return a focusSequence for stepping through the applications views. |
|
669 |
The builder usually keeps track of so-called 'tabable' views. |
|
670 |
Stepping is done with the FocusNext/FocusPrevius keys, which are |
|
671 |
typically bound to Meta-CursorUp/Meta-CursorDown. |
|
730 | 672 |
(unless the focus is currently attached to a textEditing view, |
673 |
tabbing is also possible via the tab-key) |
|
138 | 674 |
Subclasses which do not use the builder (but instead build their view |
675 |
programmatically) should redefine this method to return a collection of |
|
730 | 676 |
views which defines that sequence. |
677 |
Notice, that the focuse sequence is asked for at the time of the tabbing |
|
678 |
(not only during startup of the view) - so dynamically adding/removing |
|
679 |
components is possible." |
|
138 | 680 |
|
681 |
builder notNil ifTrue:[ |
|
730 | 682 |
^ builder focusSequence |
138 | 683 |
]. |
684 |
^ nil |
|
730 | 685 |
|
686 |
"Modified: / 31.10.1997 / 19:11:14 / cg" |
|
138 | 687 |
! |
688 |
||
594 | 689 |
masterApplication |
690 |
"return the value of the instance variable 'masterApplication' (automatically generated)" |
|
691 |
||
692 |
^ masterApplication! |
|
693 |
||
694 |
masterApplication:something |
|
695 |
"set the value of the instance variable 'masterApplication' (automatically generated)" |
|
696 |
||
852 | 697 |
something == self ifTrue:[ |
698 |
self halt:'an application cannot be its own masterApplication'. |
|
699 |
^ self |
|
700 |
]. |
|
701 |
masterApplication := something. |
|
702 |
! |
|
594 | 703 |
|
138 | 704 |
resources |
705 |
"return the applications resources - thats a ResourcePack containing |
|
706 |
language strings" |
|
707 |
||
708 |
^ resources |
|
709 |
! |
|
710 |
||
711 |
window |
|
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
712 |
"return my topWindow - or nil, if I have no window (yet)" |
138 | 713 |
|
1209 | 714 |
|win| |
715 |
||
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
716 |
builder isNil ifTrue:[^ nil]. |
1209 | 717 |
(win := builder window) notNil ifTrue:[ |
718 |
^ win |
|
719 |
]. |
|
720 |
masterApplication notNil ifTrue:[ |
|
721 |
"/ is that true ? |
|
722 |
^ masterApplication window |
|
723 |
]. |
|
724 |
^ nil. |
|
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
725 |
|
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
726 |
"Modified: / 18.9.1998 / 15:18:19 / cg" |
138 | 727 |
! |
728 |
||
187 | 729 |
window:aTopView |
1211
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
730 |
"set my topWindow. |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
731 |
As a side effect, this creates a dummy builder if non has yet |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
732 |
been built. This prevents non-GUI-Painter apps from failing later, |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
733 |
when the builder is accessed." |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
734 |
|
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
735 |
builder isNil ifTrue:[ |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
736 |
self createBuilder |
f09ce6b9b03d
create a dummy builder when the window is set.
Claus Gittinger <cg@exept.de>
parents:
1209
diff
changeset
|
737 |
]. |
187 | 738 |
builder window:aTopView |
739 |
||
740 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
741 |
! |
|
742 |
||
138 | 743 |
windowGroup |
744 |
"return the applications windowGroup" |
|
745 |
||
657 | 746 |
|w| |
747 |
||
1066
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
748 |
builder notNil ifTrue:[ |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
749 |
(w := builder window) notNil ifTrue:[ |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
750 |
^ w windowGroup |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
751 |
]. |
657 | 752 |
]. |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
753 |
masterApplication notNil ifTrue:[ |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
754 |
^ masterApplication windowGroup |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
755 |
]. |
657 | 756 |
^ nil |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
757 |
|
1066
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
758 |
"Modified: / 7.9.1998 / 23:37:00 / cg" |
138 | 759 |
! ! |
760 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
761 |
!ApplicationModel methodsFor:'binding access'! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
762 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
763 |
actionFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
764 |
"sent by the builder to ask for an actionBlock for |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
765 |
a Button. The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
766 |
for a buttons #action property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
767 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
768 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
769 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
770 |
actionBlocks from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
771 |
Typically, a block is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
772 |
|
594 | 773 |
(self selfResponsibleFor:aKey) ifTrue:[ |
723 | 774 |
^ [self perform:aKey] "/ could use: MessageSend receiver:self selector:aKey |
594 | 775 |
]. |
776 |
^ masterApplication actionFor:aKey |
|
723 | 777 |
|
778 |
"Modified: / 28.10.1997 / 20:34:51 / cg" |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
779 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
780 |
|
715 | 781 |
actionFor:aKey withValue:aValue |
782 |
"sent by the builder to ask for an actionBlock for |
|
783 |
a Button which passes a value. |
|
784 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
|
785 |
Here, a corresponding message is sent to myself, |
|
786 |
which ought to be defined in the application subclass. |
|
787 |
Alternatively, a subclass may redefine this method, to provide |
|
788 |
actionBlocks from a Dictionary or whatever. |
|
789 |
Typically, a block is returned there." |
|
790 |
||
791 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
792 |
^ [self perform:aKey with:aValue] |
|
793 |
]. |
|
794 |
^ masterApplication actionFor:aKey withValue:aValue |
|
795 |
! |
|
796 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
797 |
aspectFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
798 |
"sent by the builder to ask for an aspect (a data model). |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
799 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
800 |
for a components #aspect property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
801 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
802 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
803 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
804 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
805 |
Typically, a valueHolder is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
806 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
807 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
808 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
809 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
810 |
^ masterApplication aspectFor:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
811 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
812 |
"Modified: / 18.6.1998 / 20:33:23 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
813 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
814 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
815 |
clientFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
816 |
"sent by the builder to ask for an application provided |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
817 |
subcanvas's application. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
818 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
819 |
for a subcanvas's #client property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
820 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
821 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
822 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
823 |
appModels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
824 |
Typically, an applicationModel is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
825 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
826 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
827 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
828 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
829 |
^ masterApplication clientFor:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
830 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
831 |
"Modified: / 18.6.1998 / 20:33:30 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
832 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
833 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
834 |
componentFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
835 |
"sent by the builder to ask for an application provided |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
836 |
component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
837 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
838 |
for a viewHolders #view property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
839 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
840 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
841 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
842 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
843 |
Typically, a view is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
844 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
845 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
846 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
847 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
848 |
^ masterApplication componentFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
849 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
850 |
"Modified: / 18.6.1998 / 20:33:36 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
851 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
852 |
|
594 | 853 |
helpTextFor:aComponent |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
854 |
"activeHelp interface: return some help text for a widget component" |
594 | 855 |
|
614 | 856 |
|key cls| |
599 | 857 |
|
594 | 858 |
builder notNil ifTrue:[ |
599 | 859 |
cls := self class. |
860 |
||
861 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
862 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
|
614 | 863 |
^ self helpTextForKey:key |
599 | 864 |
] |
865 |
] |
|
594 | 866 |
]. |
614 | 867 |
masterApplication notNil ifTrue:[ |
868 |
^ masterApplication helpTextFor:aComponent |
|
869 |
]. |
|
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
870 |
^ nil |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
871 |
|
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
872 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
614 | 873 |
! |
594 | 874 |
|
614 | 875 |
helpTextForKey:aKey |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
876 |
"activeHelp interface: return some help text for a key |
1332
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
877 |
key is the symbol associated with some widget or menu item. |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
878 |
(from my helpSpec); return a language variant (if available)" |
614 | 879 |
|
880 |
|cls helpText| |
|
881 |
||
882 |
cls := self class. |
|
883 |
||
884 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
885 |
helpText := (cls helpSpec) at:aKey ifAbsent:nil |
|
886 |
]. |
|
599 | 887 |
(masterApplication notNil and:[helpText isNil]) ifTrue:[ |
614 | 888 |
helpText := masterApplication helpTextForKey:aKey |
599 | 889 |
]. |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
890 |
"/ translate. |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
891 |
resources notNil ifTrue:[ |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
892 |
^ resources string:helpText |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
893 |
]. |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
894 |
^ helpText |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
895 |
|
1332
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
896 |
"Modified: / 4.2.2000 / 15:30:16 / cg" |
594 | 897 |
! |
898 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
899 |
labelFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
900 |
"sent by the builder to ask for an application provided |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
901 |
label for a component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
902 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
903 |
for a components #label property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
904 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
905 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
906 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
907 |
labels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
908 |
Typically, a string is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
909 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
910 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
911 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
912 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
913 |
^ masterApplication labelFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
914 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
915 |
"Modified: / 18.6.1998 / 20:33:42 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
916 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
917 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
918 |
listFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
919 |
"sent by the builder to ask for an application provided |
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
920 |
holder for a list (for example, a popUpLists list). |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
921 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
922 |
for a listWidgets #list property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
923 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
924 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
925 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
926 |
holders from a Dictionary or whatever. |
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
927 |
Typically, a list-holding model (SelectionInList) is returned there. |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
928 |
If the instance does not provide a value, a corresponding aspect |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
929 |
is asked for. If that fails as well, the app class is asked as a last |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
930 |
chance." |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
931 |
|
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
932 |
|a| |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
933 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
934 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
935 |
^ self perform:aKey |
421 | 936 |
]. |
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
937 |
a := self aspectFor:aKey. |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
938 |
a notNil ifTrue:[ |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
939 |
^ a |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
940 |
]. |
421 | 941 |
^ self application listFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
942 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
943 |
"Modified: / 18.6.1998 / 20:33:50 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
944 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
945 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
946 |
menuFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
947 |
"sent by the builder to ask for an application provided |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
948 |
holder for a menu. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
949 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
950 |
for a widgets #menu property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
951 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
952 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
953 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
954 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
955 |
Typically, a menu or a menu-holding valueHolder is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
956 |
|
849 | 957 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
958 |
^ self perform:aKey |
421 | 959 |
]. |
849 | 960 |
^ masterApplication menuFor:aKey |
421 | 961 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
962 |
"Modified: / 18.6.1998 / 20:33:56 / cg" |
421 | 963 |
! |
964 |
||
965 |
specificationFor:aKey |
|
966 |
"sent by the builder to ask for an application provided |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
967 |
specification for a subcanvas or subspecification. |
421 | 968 |
The argument, aKey comes from an UI-spec |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
969 |
for a subcanvases #specification property (minorKey). |
421 | 970 |
Here, a corresponding message is sent to myself, |
971 |
which ought to be defined in the application subclass. |
|
972 |
Alternatively, a subclass may redefine this method, to provide |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
973 |
interfaceSpecifications from a Dictionary or whatever. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
974 |
Typically, an interfaceSpecification is returned there." |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
975 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
976 |
|app| |
421 | 977 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
978 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
979 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
980 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
981 |
((app := self application) respondsTo:aKey) ifTrue:[ |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
982 |
^ app perform:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
983 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
984 |
^ masterApplication specificationFor:aKey |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
985 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
986 |
"Modified: / 5.2.1998 / 00:31:39 / stefan" |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
987 |
"Modified: / 18.6.1998 / 20:34:02 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
988 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
989 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
990 |
visualFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
991 |
"sent by the builder to ask for an application provided |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
992 |
image or element for a label. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
993 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
994 |
for a widgets #label property, if LabelIsImage is turned on. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
995 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
996 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
997 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
998 |
images from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
999 |
Typically, an image is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1000 |
|
421 | 1001 |
^ self application visualFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1002 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1003 |
! ! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1004 |
|
1332
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1005 |
!ApplicationModel methodsFor:'change & update'! |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1006 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1007 |
delayedUpdate:something with:aParameter from:changedObject |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1008 |
"support for delayed updates - |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1009 |
subclasses which invoke #enqueueDelayedUpdate:with:from: |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1010 |
must also redefine this method, and perform the actual update there." |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1011 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1012 |
self subclassResponsibility |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1013 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1014 |
"Created: / 4.2.2000 / 14:31:36 / cg" |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1015 |
! |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1016 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1017 |
enqueueDelayedUpdate:something with:aParameter from:changedObject |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1018 |
"support for delayed updates - to be invoked from a concrete classes |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1019 |
#update:with:from: method. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1020 |
This will enqueue a delayed update, and resend #delayedUpdate:with:from: |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1021 |
whenever the receiver is handling events. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1022 |
Especially useful, if many updates arrive at high frequenc, to avoid |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1023 |
multiple redraws." |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1024 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1025 |
|window sensor argList| |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1026 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1027 |
(window := self window) notNil ifTrue:[ |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1028 |
sensor := window sensor. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1029 |
]. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1030 |
sensor isNil ifTrue:[ |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1031 |
"/ already closed, or not yet open |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1032 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1033 |
^ self delayedUpdate:something with:aParameter from:changedObject |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1034 |
]. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1035 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1036 |
"/ |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1037 |
"/ if such an update is already in the queue, ignore it. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1038 |
"/ Otherwise push it as an event, to be handled when I am back |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1039 |
"/ |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1040 |
argList := Array with:something |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1041 |
with:aParameter |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1042 |
with:changedObject. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1043 |
(sensor |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1044 |
hasEvent:#delayedUpdate:with:from: |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1045 |
for:self |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1046 |
withArguments:argList) ifTrue:[ |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1047 |
^ self |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1048 |
]. |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1049 |
sensor |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1050 |
pushUserEvent:#delayedUpdate:with:from: |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1051 |
for:self |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1052 |
withArguments:argList |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1053 |
|
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1054 |
"Created: / 4.2.2000 / 14:31:47 / cg" |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1055 |
"Modified: / 5.2.2000 / 00:01:54 / cg" |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1056 |
! ! |
504987f6065c
support for delayed update - it may be of general interest
Claus Gittinger <cg@exept.de>
parents:
1330
diff
changeset
|
1057 |
|
428 | 1058 |
!ApplicationModel methodsFor:'component manipulations'! |
1059 |
||
1060 |
components:aSymbolOrArray do:aBlock |
|
1061 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
1062 |
||
1063 |
|coll| |
|
1064 |
||
1065 |
aSymbolOrArray isSymbol ifTrue:[ |
|
1066 |
"/ a single components name |
|
1067 |
coll := Array with:aSymbolOrArray |
|
1068 |
] ifFalse:[ |
|
1069 |
coll := aSymbolOrArray |
|
1070 |
]. |
|
1071 |
coll do:[:aSymbol | |
|
1072 |
|component| |
|
1073 |
||
500 | 1074 |
(component := self componentFor:aSymbol) isNil ifFalse:[ |
428 | 1075 |
aBlock value:component |
1076 |
] |
|
1077 |
] |
|
1078 |
||
500 | 1079 |
"Modified: 26.3.1997 / 16:23:14 / cg" |
428 | 1080 |
! |
1081 |
||
1082 |
disable:aSymbolOrArray |
|
1083 |
"disable the components whose id's are aSymbolOrArray." |
|
1084 |
||
1085 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
1086 |
||
1087 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
1088 |
! |
|
1089 |
||
1090 |
enable:aSymbolOrArray |
|
1091 |
"enables the component(s) identified by aSymbolOrArray." |
|
1092 |
||
1093 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
1094 |
||
1095 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
1096 |
! |
|
1097 |
||
1098 |
invalidate:aSymbolOrArray |
|
1099 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
1100 |
||
1101 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
1102 |
||
1103 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
1104 |
! |
|
1105 |
||
1106 |
makeInvisible:aSymbolOrArray |
|
1107 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
1108 |
||
1109 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
1110 |
||
1111 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
1112 |
! |
|
1113 |
||
1114 |
makeReadOnly:aSymbolOrArray |
|
1115 |
"make all components identified by aSymbolOrArray read only |
|
1116 |
(for editText components)." |
|
1117 |
||
1118 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
1119 |
||
1120 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
1121 |
! |
|
1122 |
||
1123 |
makeVisible:aSymbolOrArray |
|
1124 |
"makes the components whose id's are aSymbolOrArray visible" |
|
1125 |
||
1126 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
1127 |
||
1128 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
1129 |
! |
|
1130 |
||
1131 |
makeWritable:aSymbolOrArray |
|
1132 |
"make all components identified by aSymbolOrArray writable |
|
1133 |
(for editText components)." |
|
1134 |
||
1135 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
1136 |
||
1137 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
1138 |
! ! |
|
1139 |
||
901 | 1140 |
!ApplicationModel methodsFor:'copying'! |
1141 |
||
1142 |
postCopy |
|
1143 |
builder := device := nil. |
|
1144 |
||
1145 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
1146 |
! ! |
|
1147 |
||
428 | 1148 |
!ApplicationModel methodsFor:'drag & drop'! |
1149 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1150 |
canDrop:aCollectionOfDropObjects in:aComponent |
428 | 1151 |
"drop manager asked if a drop is possible |
1152 |
- should be redefined by apps which can do it, to return true" |
|
1153 |
||
1154 |
^ false |
|
1155 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1156 |
"Modified: 11.4.1997 / 12:42:47 / cg" |
428 | 1157 |
! |
1158 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1159 |
drop:aCollectionOfDropObjects in:aComponent at:aPoint |
428 | 1160 |
"drop manager wants to drop. |
1161 |
This is ony sent, if #canDrop:in: returned true. |
|
1162 |
Must be redefined in apps which return true to #canDrop." |
|
1163 |
||
1164 |
self subclassResponsibility |
|
1165 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1166 |
"Modified: 11.4.1997 / 12:43:19 / cg" |
428 | 1167 |
! ! |
1168 |
||
429 | 1169 |
!ApplicationModel methodsFor:'easy bindings'! |
1170 |
||
730 | 1171 |
registerInterestIn:aValueModel using:aSelectorOrArray |
429 | 1172 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
1173 |
aSelectorOrArray can be one of three things: |
|
1174 |
||
1175 |
1) nil in which case no interest is registered |
|
1176 |
2) a selector in which case the receiver is understood to be self |
|
1177 |
3) an Array in which case the size is two where the first element is the |
|
713 | 1178 |
message to be sent and the second element is the receiver." |
429 | 1179 |
|
730 | 1180 |
aSelectorOrArray isNil ifTrue:[^ aValueModel]. |
429 | 1181 |
|
713 | 1182 |
(aSelectorOrArray isArray) ifTrue:[ |
730 | 1183 |
aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2) |
429 | 1184 |
] ifFalse: [ |
1185 |
aValueModel onChangeSend:aSelectorOrArray to:self |
|
1186 |
]. |
|
1187 |
^aValueModel |
|
1188 |
||
730 | 1189 |
"Modified: / 31.10.1997 / 18:19:44 / cg" |
429 | 1190 |
! |
1191 |
||
1192 |
valueHolderFor:aSelector initialValue:anObject |
|
1193 |
"Return a ValueHolder on anObject." |
|
1194 |
||
1195 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
1196 |
||
1197 |
||
1198 |
! |
|
1199 |
||
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1200 |
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1201 |
"Return a ValueHolder on anObject. aSelectorOrArrayOrNil is the change information |
429 | 1202 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
1203 |
If it is a Symbol, then it is the change message and the interested object is understood |
|
1204 |
to be the reciever. If it is an Array, then the first element is the change message and |
|
1205 |
the second element is the interested object. " |
|
1206 |
||
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1207 |
|holder| |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1208 |
|
713 | 1209 |
(builder bindings includesKey:aSelector) ifFalse:[ |
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1210 |
holder := ValueHolder with:anObject. |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1211 |
builder aspectAt:aSelector put:holder. |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1212 |
aSelectorOrArrayOrNil notNil ifTrue:[ |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1213 |
^ self registerInterestIn:holder using:aSelectorOrArrayOrNil |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1214 |
]. |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1215 |
^ holder |
429 | 1216 |
]. |
713 | 1217 |
^ builder aspectAt:aSelector |
429 | 1218 |
|
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1219 |
"Modified: / 21.5.1998 / 03:31:28 / cg" |
429 | 1220 |
! ! |
1221 |
||
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1222 |
!ApplicationModel methodsFor:'help'! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1223 |
|
1194
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1224 |
openAboutThisApplication |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1225 |
"opens an about box for this application." |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1226 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1227 |
|rev box myClass clsRev image msg| |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1228 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1229 |
rev := ''. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1230 |
myClass := self class. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1231 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1232 |
(clsRev := myClass revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1233 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1234 |
msg := '\' withCRs , myClass name asBoldText, rev. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1235 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1236 |
AboutBox isNil ifTrue:[ |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1237 |
"/ this handles bad installations of ST/X, |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1238 |
"/ where the AboutBox is missing. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1239 |
"/ (May vanish in the future) |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1240 |
^ self information:msg |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1241 |
]. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1242 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1243 |
box := AboutBox title:msg. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1244 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1245 |
image := self class defaultIcon. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1246 |
image notNil ifTrue:[ |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1247 |
box image:image |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1248 |
]. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1249 |
box label:'About This Application'. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1250 |
box autoHideAfter:10 with:[]. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1251 |
box showAtPointer. |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1252 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1253 |
|
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1254 |
! |
38f0d0580956
provide a default about dialog
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1255 |
|
1214 | 1256 |
openHelpViewOnFile:pathToHelpText |
1257 |
"open a help viewer (as opened by the help buttons). |
|
1258 |
The argument is a relative path within the help directory |
|
1259 |
(but a file under the current directory is tried first)" |
|
1260 |
||
1261 |
self withWaitCursorDo:[ |
|
1262 |
HTMLDocumentView openFullOnHelpFile:pathToHelpText |
|
1263 |
] |
|
1264 |
||
1265 |
! |
|
1266 |
||
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1267 |
showActiveHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1268 |
"This is invoked from the activeHelp event listener, to display some popup-help |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1269 |
for a component. If false is returned, the help manager will pop up |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1270 |
some active help bubble; if true is returned, it will assume that the |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1271 |
help text has been already displayed and will not do any further actions. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1272 |
Here, we accept the help text, and push an event into out own input |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1273 |
queue, so that the help text will be displayed asyncronously by myself, |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1274 |
vis the #showHelp:for: method. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1275 |
This can be redefined in concrete classes to handle active help differently." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1276 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1277 |
|wg mySensor| |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1278 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1279 |
self showingHelp ifFalse: [ |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1280 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1281 |
]. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1282 |
|
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1283 |
"/ masterApplication notNil ifTrue:[ |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1284 |
"/ (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[ |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1285 |
"/ ^ true |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1286 |
"/ ] |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1287 |
"/ ]. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1288 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1289 |
"/ NEW: push it into the event queue, to have it displayed |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1290 |
"/ syncronously with other events. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1291 |
"/ (also any errors are reported as occurring in my context; |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1292 |
"/ instead of occurring in the activeHelp context). |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1293 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1294 |
(wg := self windowGroup) notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1295 |
mySensor := wg sensor. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1296 |
mySensor notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1297 |
mySensor flushEventsFor:self withType:#showHelp:for:. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1298 |
mySensor |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1299 |
pushUserEvent:#showHelp:for: for:self |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1300 |
withArguments:(Array with:aHelpText with:view). |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1301 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1302 |
] |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1303 |
]. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1304 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1305 |
"/ mhmh - can this happen ? |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1306 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1307 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1308 |
|
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1309 |
"Modified: / 21.8.1998 / 16:00:37 / cg" |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1310 |
! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1311 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1312 |
showHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1313 |
"actual method which is supposed to display the help text. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1314 |
Should be redefined in concrete classes, to put the help text |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1315 |
into some info label, or the windows title bar. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1316 |
Here, the help text is ignored." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1317 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1318 |
masterApplication notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1319 |
masterApplication showHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1320 |
]. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1321 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1322 |
"Modified: / 31.7.1998 / 19:13:59 / cg" |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1323 |
! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1324 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1325 |
showingHelp |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1326 |
"return true, if the activeHelp manager should invoke my #showHelp:for: |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1327 |
method, when the mouse pointer is moved over my widgets. |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1328 |
The default here is true, however, the #showHelp:for: methods are empty. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1329 |
These should be redefined to put the help text into some info label, |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1330 |
or into the views title bar. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1331 |
You may also redefine the showingHelp/showingHelp: methods, to |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1332 |
remember the flag setting." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1333 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1334 |
^ true |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1335 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1336 |
"Modified: / 31.7.1998 / 17:55:31 / cg" |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1337 |
! ! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1338 |
|
52 | 1339 |
!ApplicationModel methodsFor:'initialization'! |
1340 |
||
138 | 1341 |
addTopViewsToCurrentProject |
1342 |
"add all of my topViews to the current projects list of views. |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1343 |
This allows hiding views on a per-project basis. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1344 |
Applications which do not want to be switched with projects |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1345 |
(such as the Launcher), may redefine this to a noop." |
85 | 1346 |
|
138 | 1347 |
self windowGroup topViews do:[:aView | |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1348 |
aView addToCurrentProject |
138 | 1349 |
] |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1350 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1351 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
85 | 1352 |
! |
1353 |
||
63 | 1354 |
basicInitialize |
69 | 1355 |
"initialize the application. |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1356 |
Since ST-80 applications seem commonly to redefine #initialize |
69 | 1357 |
without doing a super initialize, the real initialization is |
1358 |
done here ..." |
|
1359 |
||
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1360 |
device := Screen current. |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1361 |
|
72 | 1362 |
"claus: I wanted to delay the creation & assignment of the |
1363 |
builder till later, to allow setting to another builder. |
|
1364 |
however, some ST-80 code accesses the builder right after instance |
|
1365 |
creation ..." |
|
1366 |
||
1367 |
"/ " |
|
1368 |
"/ Create a windowBuilder to have someone around which |
|
1369 |
"/ understands the builder protocol. Since UIBuilder is not present |
|
1370 |
"/ in all systems, this allows operation without one (unless a spec |
|
1371 |
"/ is read later ...) |
|
1372 |
"/ " |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1373 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1374 |
"/ changed - cg; create the builder later. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1375 |
"/ some apps (RefactoringBrowser) depend on this being set |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1376 |
"/ late. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1377 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1378 |
"/ builder := self builderClass new. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1379 |
"/ builder notNil ifTrue:[builder application:self]. |
52 | 1380 |
resources := self class classResources. |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1381 |
|
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1382 |
"Modified: / 20.6.1998 / 11:53:36 / cg" |
138 | 1383 |
! |
1384 |
||
63 | 1385 |
initialize |
83 | 1386 |
"nothing done here; |
1387 |
but can be redefined in concrete applications" |
|
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1388 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1389 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1390 |
setDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1391 |
"set the device (i.e. some Screen), where the application |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1392 |
shall open its view(s). |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1393 |
The default device (if not set here) will be the current screen." |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1394 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1395 |
device := aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1396 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1397 |
"Created: 5.7.1996 / 12:01:40 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1398 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
138 | 1399 |
! ! |
1400 |
||
1401 |
!ApplicationModel methodsFor:'misc'! |
|
1402 |
||
928 | 1403 |
information:aString |
1404 |
"like Objects information, but translates the string via the |
|
1405 |
resourcePack, thus giving a translated string automatically" |
|
1406 |
||
1407 |
super information:(resources string:aString) withCRs |
|
1408 |
||
1409 |
"Created: / 20.5.1998 / 03:48:43 / cg" |
|
1410 |
! |
|
1411 |
||
287 | 1412 |
restoreCursors |
1413 |
"restore the original cursors in all of my views" |
|
1414 |
||
1415 |
^ self window windowGroup restoreCursors |
|
1416 |
||
1417 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
1418 |
! |
|
1419 |
||
1420 |
showCursor:aCursor |
|
1421 |
"set all of my views cursor to aCursor. |
|
1422 |
It can be restored with #restoreCursor." |
|
1423 |
||
1424 |
^ self window windowGroup showCursor:aCursor |
|
1425 |
||
1426 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
1427 |
! |
|
1428 |
||
925
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1429 |
warn:aString |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1430 |
"like Objects warn, but translates the string via the |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1431 |
resourcePack, thus giving a translated string automatically" |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1432 |
|
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1433 |
super warn:(resources string:aString) withCRs |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1434 |
|
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1435 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1436 |
! |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1437 |
|
1349
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1438 |
warn:aString with:arg |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1439 |
"like Objects warn, but translates the string via the |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1440 |
resourcePack, thus giving a translated string automatically" |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1441 |
|
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1442 |
super warn:(resources string:aString with:arg) withCRs |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1443 |
|
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1444 |
! |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1445 |
|
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1446 |
warn:aString with:arg1 with:arg2 |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1447 |
"like Objects warn, but translates the string via the |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1448 |
resourcePack, thus giving a translated string automatically" |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1449 |
|
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1450 |
super warn:(resources string:aString with:arg1 with:arg2) withCRs |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1451 |
|
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1452 |
! |
fb1270fff111
added #warn:with: and #warn:with:with:
Claus Gittinger <cg@exept.de>
parents:
1337
diff
changeset
|
1453 |
|
1350 | 1454 |
warn:aString with:arg1 with:arg2 with:arg3 |
1455 |
"like Objects warn, but translates the string via the |
|
1456 |
resourcePack, thus giving a translated string automatically" |
|
1457 |
||
1458 |
super warn:(resources string:aString with:arg1 with:arg2 with:arg3) withCRs |
|
1459 |
||
1460 |
! |
|
1461 |
||
138 | 1462 |
withCursor:aCursor do:aBlock |
1463 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
1464 |
Return the value of aBlock." |
|
1465 |
||
1075
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1466 |
|w ret| |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1467 |
|
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1468 |
w := self window. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1469 |
w notNil ifTrue:[ |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1470 |
^ w withCursor:aCursor do:aBlock |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1471 |
]. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1472 |
aCursor showWhile:[ret := aBlock value]. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1473 |
^ ret. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1474 |
|
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1475 |
"Modified: / 23.9.1998 / 17:00:25 / cg" |
63 | 1476 |
! |
1477 |
||
142
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1478 |
withExecuteCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1479 |
"evaluate aBlock, showing an executeCursor in my topView and all of its subviews. |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1480 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1481 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1482 |
^ self withCursor:(Cursor execute) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1483 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1484 |
"Created: 14.12.1995 / 20:57:03 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1485 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1486 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1487 |
withReadCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1488 |
"evaluate aBlock, showing a readCursor in my topView and all of its subviews. |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1489 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1490 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1491 |
^ self withCursor:(Cursor read) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1492 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1493 |
"Created: 14.12.1995 / 20:56:47 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1494 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1495 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1496 |
|
138 | 1497 |
withWaitCursorDo:aBlock |
1498 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
1499 |
Return the value of aBlock." |
|
63 | 1500 |
|
138 | 1501 |
^ self withCursor:Cursor wait do:aBlock |
52 | 1502 |
! ! |
57 | 1503 |
|
428 | 1504 |
!ApplicationModel methodsFor:'opening'! |
1505 |
||
1115 | 1506 |
allButOpen |
1507 |
"create my views from the windowSpec, but do not open the main window." |
|
1508 |
||
1509 |
^ self allButOpenInterface:#windowSpec. |
|
1510 |
||
1511 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
|
1512 |
! |
|
1513 |
||
63 | 1514 |
allButOpenFrom:aSpec |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1515 |
"create my views but do not open the main window. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1516 |
The argument is a spec which defines the interface." |
69 | 1517 |
|
723 | 1518 |
|realBuilder window| |
71 | 1519 |
|
72 | 1520 |
"/ DISABLED; see comment in basicInitialize |
1521 |
"/ |
|
1522 |
"/ " |
|
1523 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1524 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1525 |
"/ a UIBuilder .... |
|
1526 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1527 |
"/ if not needed. |
|
1528 |
"/ " |
|
1529 |
"/ realBuilder := UIBuilder new. |
|
1530 |
"/ builder := realBuilder. |
|
1531 |
"/ builder application:self. |
|
1532 |
"/ builder bindings:builder bindings. |
|
71 | 1533 |
|
901 | 1534 |
builder isNil ifTrue:[ |
978 | 1535 |
self createBuilder. |
901 | 1536 |
]. |
1537 |
||
63 | 1538 |
self preBuildWith:builder. |
1539 |
builder buildFromSpec:aSpec. |
|
723 | 1540 |
window := builder window. |
1541 |
window model:self. |
|
1542 |
(window respondsTo:#application:) ifTrue:[ |
|
1543 |
window application:self. |
|
472 | 1544 |
]. |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1545 |
self showingHelp ifTrue: [ActiveHelp startFor: self]. |
63 | 1546 |
self postBuildWith:builder. |
723 | 1547 |
|
978 | 1548 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
63 | 1549 |
! |
57 | 1550 |
|
138 | 1551 |
allButOpenInterface:aSymbol |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1552 |
"create my views but do not open the main window. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1553 |
The argument specifies a selector of a method, |
1115 | 1554 |
which when sent to myself should return a spec. |
1555 |
Notice, this returns the windowBuilder." |
|
138 | 1556 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1557 |
self allButOpenFrom:(self interfaceSpecFor:aSymbol). |
138 | 1558 |
^ builder |
770
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1559 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1560 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
138 | 1561 |
! |
1562 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1563 |
buildSubCanvas:spec withBuilder:aBuilder |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1564 |
"build a subcanvases spec into aSubcanvas" |
786 | 1565 |
|
1330 | 1566 |
|sameApp prevSpec prevSource specToBuild| |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1567 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1568 |
builder isNil ifTrue:[ |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1569 |
builder := aBuilder. |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1570 |
aBuilder isNil ifTrue:[ |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1571 |
self createBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1572 |
] |
1205
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1573 |
] ifFalse:[ |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1574 |
prevSpec := aBuilder spec. |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1575 |
prevSource := aBuilder source. |
786 | 1576 |
]. |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1577 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1578 |
aBuilder source:self. |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1579 |
|
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1580 |
"/ if the subcanvases appModel is NOT the same as |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1581 |
"/ the topApp, it must be pre/post-built. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1582 |
"/ Otherwise, we invoke pre/post-builtAsSubcanvas. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1583 |
"/ which provides a hook for redefinition in concrete appModels. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1584 |
"/ This avoids invoking pre/postBuild twice for subCanvases which |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1585 |
"/ have the topApp as appModel. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1586 |
|
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1587 |
sameApp := aBuilder application == aBuilder window topView application. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1588 |
sameApp ifTrue:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1589 |
self preBuildAsSubcanvasWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1590 |
] ifFalse:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1591 |
self preBuildWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1592 |
]. |
1330 | 1593 |
|
1594 |
"/ subapps should not build the menu and other fullSpec stuff. |
|
1224
52c9d0e95138
when building a fullSpec for existing view,
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
1595 |
spec class == FullSpec ifTrue:[ |
1330 | 1596 |
specToBuild := spec component. |
1224
52c9d0e95138
when building a fullSpec for existing view,
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
1597 |
] ifFalse:[ |
1330 | 1598 |
specToBuild := spec. |
1224
52c9d0e95138
when building a fullSpec for existing view,
Claus Gittinger <cg@exept.de>
parents:
1217
diff
changeset
|
1599 |
]. |
1330 | 1600 |
aBuilder buildFromSpec:specToBuild. |
1601 |
||
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1602 |
sameApp ifTrue:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1603 |
self postBuildAsSubcanvasWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1604 |
] ifFalse:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1605 |
self postBuildWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1606 |
]. |
1205
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1607 |
|
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1608 |
prevSpec notNil ifTrue:[ |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1609 |
"/ restore state in builder if original builder was used |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1610 |
aBuilder spec:prevSpec. |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1611 |
aBuilder source:prevSource. |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1612 |
]. |
a631dc401a71
remember builders old spec&source, when reused to build a
tm
parents:
1194
diff
changeset
|
1613 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1614 |
^ aBuilder |
435 | 1615 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1616 |
"Created: / 18.6.1998 / 20:08:45 / cg" |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1617 |
"Modified: / 8.7.1998 / 18:30:46 / cg" |
138 | 1618 |
! |
1619 |
||
69 | 1620 |
open |
1621 |
"open a standard interface" |
|
1622 |
||
240 | 1623 |
^ self openInterface |
1624 |
||
1625 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
69 | 1626 |
! |
1627 |
||
428 | 1628 |
openAt:aPoint |
1629 |
"open a standard interface at some point" |
|
1630 |
||
1631 |
^ self openInterfaceAt:aPoint |
|
1632 |
||
1633 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1634 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
1635 |
! |
|
1636 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1637 |
openDialog |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1638 |
"open the window - assumes that the builder has already setup |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1639 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1640 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1641 |
^ builder openDialog. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1642 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1643 |
"Modified: 14.2.1997 / 20:32:52 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1644 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1645 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1646 |
openDialogInterface:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1647 |
"open a dialog" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1648 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1649 |
^ self openDialogInterface:aSelector withBindings:nil |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1650 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1651 |
"Modified: 28.2.1997 / 14:08:01 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1652 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1653 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1654 |
openDialogInterface:aSelector withBindings:bindings |
1152 | 1655 |
"open a dialog, given a spec-selector" |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1656 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1657 |
^ SimpleDialog new |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1658 |
openFor:self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1659 |
interface:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1660 |
withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1661 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1662 |
"Created: / 28.2.1997 / 14:07:45 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1663 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1664 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1665 |
|
1152 | 1666 |
openDialogInterfaceSpec:aSpec withBindings:bindings |
1667 |
"open a dialog, given a spec" |
|
1668 |
||
1669 |
^ SimpleDialog new |
|
1670 |
openFor:self |
|
1671 |
interfaceSpec:aSpec |
|
1672 |
withBindings:bindings |
|
1673 |
||
1674 |
"Created: / 28.2.1997 / 14:07:45 / cg" |
|
1675 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
|
1676 |
! |
|
1677 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1678 |
openDialogSpec:aSpec withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1679 |
"open a dialog" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1680 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1681 |
^ SimpleDialog new |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1682 |
openFor:self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1683 |
spec:aSpec |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1684 |
withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1685 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1686 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1687 |
"Created: / 20.5.1998 / 20:27:56 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1688 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1689 |
|
63 | 1690 |
openInterface |
428 | 1691 |
"open a standard interface. |
215 | 1692 |
|
78 | 1693 |
Subclasses which do not have an interfaceSpec |
215 | 1694 |
should redefine this method and create & open their view(s) there. |
330
d7ce98930ad3
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
313
diff
changeset
|
1695 |
(see Launcher as an example)." |
69 | 1696 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1697 |
^ self openInterface:#windowSpec |
215 | 1698 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1699 |
"Modified: / 9.9.1996 / 22:39:23 / stefan" |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1700 |
"Modified: / 23.1.1998 / 18:16:50 / cg" |
57 | 1701 |
! |
1702 |
||
63 | 1703 |
openInterface:aSymbol |
215 | 1704 |
"open a specific interface. |
1705 |
The argument, aSymbol specifies which interface. The concrete |
|
1706 |
application subclass must provide a method with that name, |
|
1707 |
which must return an interfaceSpec. This is forwarded to |
|
1708 |
the builder to create the views. |
|
69 | 1709 |
Typically, applications only use one interface, |
78 | 1710 |
returned by the #windowSpec method." |
69 | 1711 |
|
85 | 1712 |
self allButOpenInterface:aSymbol. |
428 | 1713 |
self openWindow. |
63 | 1714 |
^ builder |
215 | 1715 |
|
428 | 1716 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
1717 |
! |
|
1718 |
||
1719 |
openInterface:aSymbol at:aLocation |
|
1720 |
"open a specific interface. |
|
1721 |
||
1722 |
The argument, aSymbol specifies which interface. The concrete |
|
1723 |
application subclass must provide a method with that name, |
|
1724 |
which must return an interfaceSpec. This is forwarded to |
|
1725 |
the builder to create the views. |
|
1726 |
Typically, applications only use one interface, |
|
1727 |
returned by the #windowSpec method." |
|
1728 |
||
1729 |
self allButOpenInterface:aSymbol. |
|
1730 |
self openWindowAt:aLocation. |
|
1731 |
^ builder |
|
1732 |
||
1733 |
"Created: 14.2.1997 / 20:19:44 / cg" |
|
1734 |
! |
|
1735 |
||
1736 |
openInterfaceAt:aLocation |
|
1737 |
"open a standard interface." |
|
1738 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1739 |
^ self openInterface:#windowSpec at:aLocation |
428 | 1740 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1741 |
"Created: / 14.2.1997 / 20:18:20 / cg" |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1742 |
"Modified: / 23.1.1998 / 18:17:13 / cg" |
63 | 1743 |
! |
1744 |
||
657 | 1745 |
openInterfaceModal |
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1746 |
"open a standard interface as a modal dialog. |
657 | 1747 |
|
1748 |
Subclasses which do not have an interfaceSpec |
|
1749 |
should redefine this method and create & open their view(s) there. |
|
1750 |
(see Launcher as an example)." |
|
1751 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1752 |
^ self openInterfaceModal:#windowSpec |
657 | 1753 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1754 |
"Modified: / 9.9.1996 / 22:39:23 / stefan" |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1755 |
"Modified: / 23.1.1998 / 18:17:17 / cg" |
657 | 1756 |
! |
1757 |
||
1758 |
openInterfaceModal:aSymbol |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1759 |
"open a specific interface as a modal dialog. |
657 | 1760 |
The argument, aSymbol specifies which interface. The concrete |
1761 |
application subclass must provide a method with that name, |
|
1762 |
which must return an interfaceSpec. This is forwarded to |
|
1763 |
the builder to create the views. |
|
1764 |
Typically, applications only use one interface, |
|
1765 |
returned by the #windowSpec method." |
|
1766 |
||
1767 |
self allButOpenInterface:aSymbol. |
|
1768 |
self openWindowModal. |
|
1769 |
^ builder |
|
1770 |
||
1771 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
1772 |
! |
|
1773 |
||
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1774 |
openInterfaceModal:aSymbol at:location |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1775 |
"open a specific interface modal at some screen location. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1776 |
The argument, aSymbol specifies which interface. The concrete |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1777 |
application subclass must provide a method with that name, |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1778 |
which must return an interfaceSpec. This is forwarded to |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1779 |
the builder to create the views. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1780 |
Typically, applications only use one interface, |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1781 |
returned by the #windowSpec method." |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1782 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1783 |
self allButOpenInterface:aSymbol. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1784 |
self openWindowModalAt:location. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1785 |
^ builder |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1786 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1787 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1788 |
! |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1789 |
|
657 | 1790 |
openModal |
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1791 |
"open a standard interface as a modal dialog" |
657 | 1792 |
|
1793 |
^ self openInterfaceModal |
|
1794 |
||
1795 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1796 |
! |
|
1797 |
||
362 | 1798 |
openOnDevice:aDevice |
1799 |
"open a standard interface on some other device" |
|
1800 |
||
1801 |
self setDevice:aDevice. |
|
1802 |
^ self open |
|
1803 |
||
1804 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
1805 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
1806 |
! |
|
1807 |
||
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1808 |
openSpec:anInterfaceSpec |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1809 |
"open a view as specified in anInterfaceSpec." |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1810 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1811 |
self allButOpenFrom:anInterfaceSpec. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1812 |
self openWindow. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1813 |
^ builder |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1814 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1815 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1816 |
"Created: / 20.5.1998 / 20:08:51 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1817 |
! |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1818 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1819 |
openSpecModal:anInterfaceSpec |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1820 |
"open an interface spec modal" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1821 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1822 |
self allButOpenFrom:anInterfaceSpec. |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1823 |
self openWindowModal. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1824 |
^ builder |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1825 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1826 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1827 |
"Created: / 20.5.1998 / 20:20:21 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1828 |
! |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1829 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1830 |
openWindow |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1831 |
"open the window - assumes that the builder has already setup |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1832 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1833 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1834 |
builder openWindow. |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1835 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1836 |
"Created: 14.2.1997 / 20:20:39 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1837 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1838 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1839 |
openWindowAt:aLocation |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1840 |
"open the window - assumes that the builder has already setup |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1841 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1842 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1843 |
builder openWindowAt:aLocation. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1844 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1845 |
"Created: 14.2.1997 / 20:20:55 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1846 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1847 |
|
1118
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1848 |
openWindowAtCenter |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1849 |
"open the window centered on the screen |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1850 |
- assumes that the builder has already setup the interface." |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1851 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1852 |
builder openWindowAt:#center |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1853 |
|
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1854 |
"Created: 14.2.1997 / 20:20:55 / cg" |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1855 |
! |
67eb0839e703
added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
1856 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1857 |
openWindowModal |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1858 |
"open the window - assumes that the builder has already setup |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1859 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1860 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1861 |
"/ builder openDialog. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1862 |
builder |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1863 |
openAt:nil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1864 |
withExtent:nil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1865 |
andType:#dialog |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1866 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1867 |
"Created: 14.2.1997 / 20:20:39 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1868 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1869 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1870 |
openWindowModalAt:aLocation |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1871 |
"open the window modal - assumes that the builder has already setup |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1872 |
the interface." |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1873 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1874 |
builder openDialogAt:aLocation. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1875 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1876 |
"Created: 14.2.1997 / 20:20:55 / cg" |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1877 |
! |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1878 |
|
1252
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1879 |
postApplicationProcessCreate:newProcess windowGroup:newGroup |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1880 |
"this is sent whenever a new application is launched from this app, |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1881 |
which forks its own windowGroup process. Allows for process group management, |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1882 |
or process-global exception handlers to be installed. |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1883 |
Nothing done here - to be redefined in concrete applications" |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1884 |
|
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1885 |
! |
485fcf345324
added a hook to allow interception of new-sub-application
ca
parents:
1242
diff
changeset
|
1886 |
|
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1887 |
postBuildAsSubcanvasWith:aBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1888 |
"this is sent after an interface is built from a spec as subcanvas. |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1889 |
Can be redefined in subclasses for additional setup after |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1890 |
the subcanvas view has been built, but not yet opened." |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1891 |
|
1242
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1892 |
|sameApp| |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1893 |
|
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1894 |
sameApp := aBuilder application == aBuilder window topView application. |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1895 |
|
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1896 |
"/ If I am opened as subcanvas in another application |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1897 |
"/ then treat this like a regular open. |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1898 |
"/ otherwise ignore it. |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1899 |
sameApp ifFalse:[ |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1900 |
self postBuildWith:aBuilder. |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1901 |
] |
d36371e70ea5
Call postBuild on subcanvases (cg)
Stefan Vogel <sv@exept.de>
parents:
1224
diff
changeset
|
1902 |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1903 |
"Modified: / 8.7.1998 / 18:28:55 / cg" |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1904 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1905 |
|
138 | 1906 |
postBuildWith:aBuilder |
1907 |
"this is sent after an interface is built from a spec. |
|
657 | 1908 |
Can be redefined in subclasses for additional setup after |
1909 |
the view has been built, but not yet opened." |
|
138 | 1910 |
! |
1911 |
||
1912 |
postOpenWith:aBuilder |
|
1913 |
"this is sent after the applications main window is opened. |
|
730 | 1914 |
Can be redefined in subclasses for actions after opening the view." |
1915 |
||
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1916 |
|
138 | 1917 |
! |
1918 |
||
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1919 |
preBuildAsSubcanvasWith:aBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1920 |
"this is sent before an interface is built from a spec as a subcanvas. |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1921 |
Can be redefined for apps which need to be informed about that." |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1922 |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1923 |
"Modified: / 8.7.1998 / 18:29:34 / cg" |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1924 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1925 |
|
138 | 1926 |
preBuildWith:aBuilder |
1927 |
"this is sent before an interface is built from a spec. |
|
1928 |
Can be redefined in subclasses. |
|
1929 |
mhmh - what should this do here ?" |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1930 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1931 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1932 |
!ApplicationModel methodsFor:'private'! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1933 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1934 |
builderClass |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1935 |
"return the UIBuilder class for me. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1936 |
This method can be redefined if (eventually) there are |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1937 |
spec readers for other UI languages (motif UIL ?)" |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1938 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1939 |
^ UIBuilder |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1940 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1941 |
"Created: / 19.6.1998 / 01:39:26 / cg" |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1942 |
"Modified: / 19.6.1998 / 01:45:24 / cg" |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1943 |
! |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1944 |
|
978 | 1945 |
createBuilder |
1946 |
builder isNil ifTrue:[ |
|
1947 |
builder := self builderClass new. |
|
1948 |
builder application:self. |
|
1949 |
] |
|
1950 |
||
1951 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
|
1952 |
! |
|
1953 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1954 |
opened:whichTopView |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1955 |
"the topView has been opened. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1956 |
This is sent by my topView when its really open |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1957 |
(i.e. finally visible)" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1958 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1959 |
self addTopViewsToCurrentProject. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1960 |
self postOpenWith:builder |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1961 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1962 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1963 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1964 |
selfResponsibleFor:aKey |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1965 |
^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]]) |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1966 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1967 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1968 |
!ApplicationModel methodsFor:'queries'! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1969 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1970 |
defaultWindowType |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1971 |
"Applications come up non-modal, by default" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1972 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1973 |
^ #normal |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1974 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1975 |
"Created: 17.1.1997 / 19:57:34 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1976 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1977 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1978 |
graphicsDevice |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1979 |
"return the device I want to open my views on. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1980 |
The default (if not created with #onDevice:) is the currently |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1981 |
active screen." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1982 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1983 |
^ device |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1984 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1985 |
"Created: 5.7.1996 / 17:51:31 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1986 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1987 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1988 |
interfaceSpecFor:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1989 |
"return an interface spec. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1990 |
Here, the query is forwarded to my class. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1991 |
Can be refefined in subclasses which want to provide per-instance specs." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1992 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1993 |
^ self class interfaceSpecFor:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1994 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1995 |
"Created: / 25.1.1998 / 19:45:12 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1996 |
"Modified: / 25.1.1998 / 19:47:09 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1997 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1998 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1999 |
processName |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2000 |
"return a name to be shown for me in the process monitor" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2001 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2002 |
self class == ApplicationModel ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2003 |
^ 'Application' |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2004 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2005 |
^ self class nameWithoutPrefix |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2006 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2007 |
"Modified: / 4.12.1997 / 12:39:14 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2008 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2009 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2010 |
resolveClassNamed:something inClass:aClass |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2011 |
"return the class from something, a class, symbol, string or nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2012 |
first we are looking in the namespace of the application, than of the |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2013 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2014 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2015 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2016 |
^ Smalltalk resolveName:something inClass:aClass. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2017 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2018 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2019 |
resolveName:something |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2020 |
"return the class from something, a class, symbol, string or nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2021 |
first we are looking in the namespace of the application, than of the |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2022 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2023 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2024 |
^ self resolveName:something inClass:self class |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2025 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2026 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2027 |
resolveName:something inClass:aClass |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2028 |
"return the class from something, a class, symbol, string or nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2029 |
first we are looking in the namespace of the application, than of the |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2030 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2031 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2032 |
|cls| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2033 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2034 |
aClass notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2035 |
(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2036 |
^ cls |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2037 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2038 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2039 |
masterApplication notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2040 |
^ masterApplication resolveName:something |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2041 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2042 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2043 |
^ nil |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2044 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2045 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2046 |
topApplication |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2047 |
"return the top-master application" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2048 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2049 |
masterApplication isNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2050 |
^ self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2051 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2052 |
^ masterApplication topApplication |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2053 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2054 |
"Created: / 6.6.1998 / 19:40:42 / cg" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2055 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2056 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2057 |
!ApplicationModel methodsFor:'startup / release'! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2058 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2059 |
close |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2060 |
"this is sent by my topView when about to be closed |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2061 |
by the program (not by the windowManager). |
1217 | 2062 |
Notice, that we get a closeRequest message if closed by the windowManager, |
2063 |
which can be rejected by the app (or confirmed via a dialog) |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2064 |
Could be redefined in subclasses." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2065 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2066 |
self closeDownViews |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2067 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2068 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2069 |
closeDownViews |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2070 |
"close down the applications view(s)" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2071 |
|
1254 | 2072 |
|wg wgProcess views| |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2073 |
|
1217 | 2074 |
self release. |
1264 | 2075 |
ActiveHelp stopFor:self. |
1254 | 2076 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2077 |
(wg := self windowGroup) notNil ifTrue:[ |
1254 | 2078 |
wgProcess := wg process. |
2079 |
(Processor activeProcess ~~ wgProcess |
|
2080 |
and:[wgProcess notNil]) ifTrue:[ |
|
2081 |
wgProcess terminate |
|
2082 |
] ifFalse:[ |
|
1302
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2083 |
wg closeDownViews. |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2084 |
"/ views := wg topViews. |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2085 |
"/ views notNil ifTrue:[ |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2086 |
"/ views copy do:[:aView | |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2087 |
"/ aView notNil ifTrue:[aView destroy] |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2088 |
"/ ] |
7c8ae7afab5e
use windowgroups closeDownViews method
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
2089 |
"/ ]. |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2090 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2091 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2092 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2093 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2094 |
closeRequest |
1217 | 2095 |
"this is sent by my topView when about to be closed by the windowManager. |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2096 |
Could be redefined in subclasses to suppress close or confirm." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2097 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2098 |
|sav| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2099 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2100 |
"/ In multiView apps, tell my master. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2101 |
"/ (but not if I am a modal reincarnation) |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2102 |
(masterApplication notNil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2103 |
and:[self window isModal not]) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2104 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2105 |
"/ temporary clear my masterApplication to prevent |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2106 |
"/ endless recursion, in case the master sends me |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2107 |
"/ a closeRequest (although, it is supposed to |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2108 |
"/ send me a closeDownViews ...) |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2109 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2110 |
sav := masterApplication. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2111 |
masterApplication := nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2112 |
sav closeRequestFor:(self window). |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2113 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2114 |
"/ restore - in case master did not want me to close ... |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2115 |
masterApplication := sav. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2116 |
] ifFalse:[ |
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2117 |
"/ ST/X does close-check by redefining this message without |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2118 |
"/ a supersend; |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2119 |
"/ VW does it by returning false from requestForWindowClose |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2120 |
"/ sigh. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2121 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2122 |
self requestForWindowClose ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2123 |
self closeDownViews |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2124 |
] |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2125 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2126 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2127 |
"Modified: / 19.6.1998 / 01:37:17 / cg" |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2128 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2129 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2130 |
closeRequestFor:aTopView |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2131 |
"this is sent by any of my topViews when about to be closed by the |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2132 |
windowmanager. For backward compatibility with single-view applications, |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2133 |
this is forwarded here to a simple (non topView-specific) closeRequest, |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2134 |
effectively closing all of my views. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2135 |
MultiView applications should redefine this method if closing of individual |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2136 |
views closing is to be caught and/or should not close all of them." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2137 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2138 |
|sav| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2139 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2140 |
"/ In multiView apps, tell my master. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2141 |
"/ (but not if I am a modal reincarnation) |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2142 |
(masterApplication notNil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
2143 |
and:[self window isModal not]) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2144 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2145 |
"/ temporary clear my masterApplication to prevent |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2146 |
"/ endless recursion, in case the master sends me |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2147 |
"/ a closeRequest (although, it is supposed to |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2148 |
"/ send me a closeDownViews ...) |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2149 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2150 |
sav := masterApplication. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2151 |
masterApplication := nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2152 |
sav closeRequestFor:(self window). |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2153 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2154 |
"/ restore - in case master did not want me to close ... |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2155 |
masterApplication := sav. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2156 |
] ifFalse:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2157 |
self closeRequest |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2158 |
] |
138 | 2159 |
! |
2160 |
||
1132
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2161 |
doAccept |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2162 |
"this is invoked by the Return-Key (if returnIsOK) or |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2163 |
the ok-button (if any), IFF the application has been |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2164 |
opened modal (i.e. as a dialog)." |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2165 |
|
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2166 |
|kp| |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2167 |
|
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2168 |
"/ the following is a bad kludge - |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2169 |
"/ actually, modal apps should inherit from SimpleDialog |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2170 |
"/ (then, things would be clean) |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2171 |
"/ However, it may be useful, to open some app (which is normally |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2172 |
"/ modeless) as a modal one as well. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2173 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2174 |
"/ to remember the accept vs. cancel case. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2175 |
"/ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2176 |
self window isModal ifTrue:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2177 |
"/ mhmh - is this a good idea ? |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2178 |
(self respondsTo:#accept) ifTrue:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2179 |
self accept |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2180 |
] ifFalse:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2181 |
self closeRequest. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2182 |
]. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2183 |
^ self |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2184 |
]. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2185 |
|
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2186 |
^ self "/ nothing done here ... |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2187 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2188 |
|
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2189 |
doCancel |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2190 |
"this is invoked by the Escape-Key (if escapeIsCancel) or |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2191 |
the cancel-button (if any), IFF the application has been |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2192 |
opened modal (i.e. as a dialog)." |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2193 |
|
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2194 |
"/ the following is a bad kludge - |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2195 |
"/ actually, modal apps should inherit from SimpleDialog |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2196 |
"/ (then, things would be clean) |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2197 |
"/ However, it may be useful, to open some app (which is normally |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2198 |
"/ modeless) as a modal one as well. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2199 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2200 |
"/ to remember the accept vs. cancel case. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2201 |
"/ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2202 |
self window isModal ifTrue:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2203 |
"/ mhmh - is this a good idea ? |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2204 |
(self respondsTo:#cancel) ifTrue:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2205 |
self cancel |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2206 |
] ifFalse:[ |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2207 |
self closeRequest. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2208 |
]. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2209 |
^ self |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2210 |
]. |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2211 |
^ self "/ nothing done here ... |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2212 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2213 |
|
1217 | 2214 |
releaseAsSubCanvas |
1337
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2215 |
"a subcanvas is closed or switching to a new application. |
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2216 |
Can be redefined to perform a self release in this case." |
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2217 |
|
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2218 |
"/ used to self release here, |
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2219 |
"/ but that is incompatible to VW (RefactoryBrowser). |
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2220 |
"/ Therefore, if you need it, you MUST now redefine |
cdd4197b4661
releaseAsSubCanvas no longer does an automatic release.
Claus Gittinger <cg@exept.de>
parents:
1332
diff
changeset
|
2221 |
"/ this method. |
1217 | 2222 |
! |
2223 |
||
69 | 2224 |
restarted |
287 | 2225 |
"sent by my topWindow, when restarted from an image. |
69 | 2226 |
Nothing done here, but can be redefined to perform any actions |
2227 |
required to reset the application after an image-restart. |
|
2228 |
(for example: check if application files are still around, restart |
|
287 | 2229 |
subprocesses etc.)." |
2230 |
||
2231 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
63 | 2232 |
! |
57 | 2233 |
|
63 | 2234 |
saveAndTerminateRequest |
2235 |
"some windowManagers send this to shut down an application |
|
2236 |
and have it save its state for restart. |
|
2237 |
Can be redefined in subclasses" |
|
2238 |
||
2239 |
self closeRequest |
|
437 | 2240 |
! |
2241 |
||
2242 |
saveAndTerminateRequestFor:aTopView |
|
2243 |
"some windowManagers send this to shut down an application |
|
2244 |
and have it save its state for restart. |
|
2245 |
Can be redefined in subclasses" |
|
2246 |
||
2247 |
self saveAndTerminateRequest |
|
57 | 2248 |
! ! |
72 | 2249 |
|
85 | 2250 |
!ApplicationModel methodsFor:'window events'! |
2251 |
||
1253 | 2252 |
dispatchEvent:event |
2253 |
"dispatch a user-pushed event. |
|
2254 |
This allows for events for an appModel to be pushed into the event queue |
|
2255 |
the same way as events for a view are pushable." |
|
2256 |
||
2257 |
^ self |
|
1290 | 2258 |
dispatchEvent:event |
1253 | 2259 |
withFocusOn:nil |
2260 |
delegate:true |
|
2261 |
||
2262 |
! |
|
2263 |
||
983 | 2264 |
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
1253 | 2265 |
"dispatch a user-pushed event. |
983 | 2266 |
This allows for events for an appModel to be pushed into the event queue |
2267 |
the same way as events for a view are pushable." |
|
2268 |
||
2269 |
self perform:evType withArguments:evArgs |
|
2270 |
||
2271 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
2272 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
2273 |
! |
|
2274 |
||
1290 | 2275 |
dispatchEvent:ev type:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
2276 |
"dispatch a user-pushed event. |
|
2277 |
This allows for events for an appModel to be pushed into the event queue |
|
2278 |
the same way as events for a view are pushable." |
|
2279 |
||
2280 |
self perform:evType withArguments:evArgs |
|
2281 |
||
2282 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
2283 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
2284 |
! |
|
2285 |
||
2286 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
1253 | 2287 |
"dispatch a user-pushed event. |
2288 |
This allows for events for an appModel to be pushed into the event queue |
|
2289 |
the same way as events for a view are pushable." |
|
2290 |
||
2291 |
^ self |
|
1290 | 2292 |
dispatchEvent:event |
2293 |
withFocusOn:focusViewOrNil |
|
2294 |
delegate:true |
|
2295 |
||
2296 |
||
2297 |
! |
|
2298 |
||
2299 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
2300 |
"dispatch a user-pushed event. |
|
2301 |
This allows for events for an appModel to be pushed into the event queue |
|
2302 |
the same way as events for a view are pushable." |
|
2303 |
||
2304 |
^ self |
|
2305 |
dispatchEvent:event |
|
2306 |
type:event type |
|
1253 | 2307 |
arguments:(event arguments) |
2308 |
withFocusOn:focusViewOrNil |
|
1290 | 2309 |
delegate:doDelegate |
1253 | 2310 |
|
2311 |
||
2312 |
! |
|
2313 |
||
967
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2314 |
noticeOfWindowClose:aWindow |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2315 |
"sent when a topView has been closed. |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2316 |
Can be redefined in subclasses for cleanup." |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2317 |
|
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2318 |
^ self |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2319 |
|
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2320 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2321 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2322 |
! |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
2323 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2324 |
requestForWindowClose |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2325 |
"the applicationWindow wants to know, if a close |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2326 |
is ok. Return false if not." |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2327 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2328 |
|w k| |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2329 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2330 |
builder notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2331 |
(w := builder window) notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2332 |
(k := w keyboardProcessor) notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2333 |
^ k requestForWindowClose |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2334 |
] |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2335 |
] |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2336 |
]. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2337 |
^ true |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2338 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2339 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2340 |
"Created: / 19.6.1998 / 01:34:58 / cg" |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2341 |
! |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
2342 |
|
144 | 2343 |
showActivity:someMessage |
215 | 2344 |
"some activityNotification shalt be communicated to |
2345 |
the user. Forwarded from the topView and ignored here. |
|
2346 |
Can be redefined in concrete applications to show the |
|
2347 |
message either in some infoView (infoLabel as in Windows) |
|
2348 |
or in the title area (as done in the browsers)" |
|
2349 |
||
144 | 2350 |
^ self |
2351 |
||
2352 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
215 | 2353 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
144 | 2354 |
! |
2355 |
||
85 | 2356 |
windowEvent:anEvent from:anApplicationWindow |
215 | 2357 |
"dummy: windowEvent forwarding is not yet implemented" |
2358 |
||
85 | 2359 |
^ self |
215 | 2360 |
|
2361 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
85 | 2362 |
! ! |
2363 |
||
361 | 2364 |
!ApplicationModel class methodsFor:'documentation'! |
72 | 2365 |
|
138 | 2366 |
version |
1350 | 2367 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.128 2000-02-16 21:42:27 cg Exp $' |
81 | 2368 |
! ! |
138 | 2369 |
ApplicationModel initialize! |