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