author | ca |
Wed, 25 Feb 1998 15:31:49 +0100 | |
changeset 849 | 7e234a4ccaf6 |
parent 825 | 98429ad39f5d |
child 852 | 671df0a6277d |
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 |
||
63 | 129 |
^ super new 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 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
138 |
^ (super new basicInitialize |
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 |
||
346 |
labelAt:aKey |
|
347 |
^ nil |
|
348 |
! |
|
349 |
||
350 |
labelAt:aKey ifAbsent:aBlock |
|
351 |
^ aBlock value |
|
352 |
! |
|
353 |
||
354 |
labelAt:aKey put:aValue |
|
355 |
"/ not yet implemented |
|
356 |
! |
|
357 |
||
358 |
labels |
|
359 |
"/ not yet implemented |
|
360 |
^ nil |
|
361 |
! |
|
362 |
||
363 |
visualAt:aKey |
|
364 |
^ nil |
|
365 |
! |
|
366 |
||
367 |
visualAt:aKey ifAbsent:aBlock |
|
368 |
^ aBlock value |
|
369 |
! |
|
370 |
||
371 |
visualAt:aKey put:aValue |
|
372 |
"/ not yet implemented |
|
373 |
! |
|
374 |
||
375 |
visuals |
|
376 |
"/ not yet implemented |
|
377 |
^ nil |
|
378 |
! ! |
|
379 |
||
361 | 380 |
!ApplicationModel class methodsFor:'queries'! |
63 | 381 |
|
382 |
interfaceSpecFor:aSelector |
|
69 | 383 |
"return an interface spec" |
384 |
||
421 | 385 |
^ UISpecification from:(self application specificationFor:aSelector) |
723 | 386 |
! |
387 |
||
388 |
isVisualStartable |
|
389 |
"return true, if this application can be started via #open" |
|
390 |
||
391 |
(self == ApplicationModel) ifTrue:[^ false "I am abstract"]. |
|
392 |
(self respondsTo:#windowSpec) ifFalse:[^ false]. |
|
393 |
(self respondsTo:#open) ifFalse:[^ false]. |
|
394 |
^ true |
|
395 |
||
396 |
"Created: / 27.10.1997 / 16:38:02 / cg" |
|
397 |
"Modified: / 27.10.1997 / 16:46:08 / cg" |
|
63 | 398 |
! ! |
399 |
||
361 | 400 |
!ApplicationModel class methodsFor:'resources'! |
52 | 401 |
|
402 |
classResources |
|
403 |
"if not already loaded, get the classes resourcePack |
|
404 |
and return it" |
|
405 |
||
406 |
ClassResources isNil ifTrue:[ |
|
407 |
ClassResources := ResourcePack for:self. |
|
408 |
]. |
|
409 |
^ ClassResources |
|
410 |
! |
|
411 |
||
412 |
classResources:aResourcePack |
|
413 |
"allow setting of the classResources" |
|
414 |
||
415 |
ClassResources := aResourcePack |
|
416 |
! |
|
417 |
||
418 |
flushAllClassResources |
|
419 |
"flush all classes resource translations. |
|
420 |
Needed after a resource file / language setting has changed." |
|
421 |
||
422 |
ResourcePack flushCachedResourcePacks. |
|
423 |
self flushClassResources. |
|
424 |
self allSubclassesDo:[:aClass | |
|
425 |
aClass flushClassResources. |
|
426 |
] |
|
427 |
! |
|
428 |
||
429 |
flushClassResources |
|
430 |
"flush classes resource string translations. |
|
431 |
Needed whenever a resource file / language setting has changed" |
|
432 |
||
433 |
ClassResources := nil. |
|
63 | 434 |
! |
435 |
||
436 |
updateClassResources |
|
437 |
"update my classResources" |
|
438 |
||
439 |
ClassResources := nil. |
|
440 |
self classResources |
|
52 | 441 |
! ! |
442 |
||
361 | 443 |
!ApplicationModel class methodsFor:'startup'! |
138 | 444 |
|
445 |
open |
|
446 |
"create an instance of the application and open its view" |
|
447 |
||
240 | 448 |
^ self new open |
138 | 449 |
|
450 |
" |
|
361 | 451 |
Launcher open |
138 | 452 |
" |
240 | 453 |
|
361 | 454 |
"Modified: 13.1.1997 / 20:54:50 / cg" |
138 | 455 |
! |
456 |
||
428 | 457 |
openAt:aLocation |
458 |
"create an instance of the application and open its view |
|
459 |
at some position." |
|
460 |
||
461 |
^ self new openAt:aLocation |
|
462 |
||
463 |
"Modified: 14.2.1997 / 20:28:41 / cg" |
|
464 |
! |
|
465 |
||
466 |
openDialogInterface:anInterfaceSymbol |
|
467 |
"create an instance of the application and open a view as |
|
468 |
specified by anInterfaceSymbol." |
|
469 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
470 |
^ self openDialogInterface:anInterfaceSymbol withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
471 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
472 |
"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
|
473 |
"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
|
474 |
"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
|
475 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
476 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
477 |
openDialogInterface:anInterfaceSymbol withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
478 |
"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
|
479 |
specified by anInterfaceSymbol." |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
480 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
481 |
^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings |
428 | 482 |
|
483 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
484 |
"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
|
485 |
"Created: 28.2.1997 / 14:07:24 / cg" |
428 | 486 |
! |
487 |
||
138 | 488 |
openInterface:anInterfaceSymbol |
489 |
"create an instance of the application and open a view as |
|
490 |
specified by anInterfaceSymbol." |
|
491 |
||
361 | 492 |
^ self new openInterface:anInterfaceSymbol |
138 | 493 |
|
494 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
361 | 495 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
138 | 496 |
! |
497 |
||
428 | 498 |
openInterface:anInterfaceSymbol at:aPoint |
499 |
"create an instance of the application and open a view as |
|
500 |
specified by anInterfaceSymbol." |
|
501 |
||
502 |
^ self new openInterface:anInterfaceSymbol at:aPoint |
|
503 |
||
504 |
"Modified: 14.2.1997 / 20:28:47 / cg" |
|
505 |
! |
|
506 |
||
657 | 507 |
openModal |
508 |
"create an instance of the application and open its view modal" |
|
509 |
||
510 |
^ self new openModal |
|
511 |
! |
|
512 |
||
138 | 513 |
openOn:anApplicationModel |
215 | 514 |
"send an open message to the argument, anApplicationModel. |
515 |
I dont really understand what this method is useful for ..." |
|
138 | 516 |
|
361 | 517 |
^ anApplicationModel open |
215 | 518 |
|
361 | 519 |
"Modified: 13.1.1997 / 20:55:05 / cg" |
138 | 520 |
! |
521 |
||
522 |
openOnDevice:aDevice |
|
523 |
"create an instance of the application and open its view |
|
215 | 524 |
on ANOTHER device. |
525 |
For more info, read the document on multiple display |
|
526 |
support and the documentation of the DeviceWorkstation class." |
|
138 | 527 |
|
361 | 528 |
^ (self onDevice:aDevice) open |
215 | 529 |
|
361 | 530 |
" |
531 |
Launcher openOnDevice:Display |
|
532 |
" |
|
533 |
||
534 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
685 | 535 |
! |
536 |
||
537 |
openWithSpec:aSpecSymbol |
|
538 |
"ST80 compatibility: |
|
539 |
mhmh - what is the difference to #openInterface ?" |
|
540 |
||
541 |
^ self openInterface:aSpecSymbol |
|
542 |
||
543 |
"Modified: 29.8.1997 / 01:16:52 / cg" |
|
138 | 544 |
! ! |
545 |
||
546 |
!ApplicationModel methodsFor:'accessing'! |
|
547 |
||
421 | 548 |
application |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
549 |
"application knows about interfaceSpecs, menuSpecs etc. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
550 |
Usually this is my class. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
551 |
This may be redefined in subclasses" |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
552 |
|
421 | 553 |
^ self class |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
554 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
555 |
"Modified: / 5.2.1998 / 00:45:21 / stefan" |
421 | 556 |
! |
557 |
||
138 | 558 |
builder |
559 |
"return the applications builder; this one has more information |
|
560 |
about views, components etc." |
|
561 |
||
562 |
^ builder |
|
563 |
! |
|
564 |
||
565 |
builder:aBuilder |
|
566 |
"set the applications builder. Normally, you should not set it |
|
567 |
directly, but depend on the default builder, as created when the application |
|
568 |
was created." |
|
569 |
||
570 |
builder := aBuilder |
|
571 |
! |
|
572 |
||
573 |
focusSequence |
|
574 |
"return a focusSequence for stepping through the applications views. |
|
575 |
The builder usually keeps track of so-called 'tabable' views. |
|
576 |
Stepping is done with the FocusNext/FocusPrevius keys, which are |
|
577 |
typically bound to Meta-CursorUp/Meta-CursorDown. |
|
730 | 578 |
(unless the focus is currently attached to a textEditing view, |
579 |
tabbing is also possible via the tab-key) |
|
138 | 580 |
Subclasses which do not use the builder (but instead build their view |
581 |
programmatically) should redefine this method to return a collection of |
|
730 | 582 |
views which defines that sequence. |
583 |
Notice, that the focuse sequence is asked for at the time of the tabbing |
|
584 |
(not only during startup of the view) - so dynamically adding/removing |
|
585 |
components is possible." |
|
138 | 586 |
|
587 |
builder notNil ifTrue:[ |
|
730 | 588 |
^ builder focusSequence |
138 | 589 |
]. |
590 |
^ nil |
|
730 | 591 |
|
592 |
"Modified: / 31.10.1997 / 19:11:14 / cg" |
|
138 | 593 |
! |
594 |
||
594 | 595 |
masterApplication |
596 |
"return the value of the instance variable 'masterApplication' (automatically generated)" |
|
597 |
||
598 |
^ masterApplication! |
|
599 |
||
600 |
masterApplication:something |
|
601 |
"set the value of the instance variable 'masterApplication' (automatically generated)" |
|
602 |
||
603 |
masterApplication := something.! |
|
604 |
||
138 | 605 |
resources |
606 |
"return the applications resources - thats a ResourcePack containing |
|
607 |
language strings" |
|
608 |
||
609 |
^ resources |
|
610 |
! |
|
611 |
||
612 |
window |
|
613 |
"return my topWindow" |
|
614 |
||
615 |
^ builder window |
|
616 |
! |
|
617 |
||
187 | 618 |
window:aTopView |
619 |
"set my topWindow" |
|
620 |
||
621 |
builder window:aTopView |
|
622 |
||
623 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
624 |
! |
|
625 |
||
138 | 626 |
windowGroup |
627 |
"return the applications windowGroup" |
|
628 |
||
657 | 629 |
|w| |
630 |
||
631 |
(w := builder window) notNil ifTrue:[ |
|
632 |
^ w windowGroup |
|
633 |
]. |
|
634 |
^ nil |
|
138 | 635 |
! ! |
636 |
||
594 | 637 |
!ApplicationModel methodsFor:'active help'! |
638 |
||
639 |
showHelp:aHelpText for:view |
|
640 |
"hook to allow an application to display active help |
|
641 |
texts in its own info area. |
|
642 |
This method may be redefined in a concrete application. |
|
643 |
If it returns false, the ActiveHelp manager will popup a |
|
644 |
bubble with the help text." |
|
645 |
||
599 | 646 |
masterApplication notNil ifTrue:[ |
647 |
^ masterApplication showHelp:aHelpText for:view |
|
648 |
]. |
|
594 | 649 |
^ false |
650 |
||
651 |
! ! |
|
652 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
653 |
!ApplicationModel methodsFor:'binding access'! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
654 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
655 |
actionFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
656 |
"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
|
657 |
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
|
658 |
for a buttons #action property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
659 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
660 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
661 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
662 |
actionBlocks from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
663 |
Typically, a block is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
664 |
|
594 | 665 |
(self selfResponsibleFor:aKey) ifTrue:[ |
723 | 666 |
^ [self perform:aKey] "/ could use: MessageSend receiver:self selector:aKey |
594 | 667 |
]. |
668 |
^ masterApplication actionFor:aKey |
|
723 | 669 |
|
670 |
"Modified: / 28.10.1997 / 20:34:51 / cg" |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
671 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
672 |
|
715 | 673 |
actionFor:aKey withValue:aValue |
674 |
"sent by the builder to ask for an actionBlock for |
|
675 |
a Button which passes a value. |
|
676 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
|
677 |
Here, a corresponding message is sent to myself, |
|
678 |
which ought to be defined in the application subclass. |
|
679 |
Alternatively, a subclass may redefine this method, to provide |
|
680 |
actionBlocks from a Dictionary or whatever. |
|
681 |
Typically, a block is returned there." |
|
682 |
||
683 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
684 |
^ [self perform:aKey with:aValue] |
|
685 |
]. |
|
686 |
^ masterApplication actionFor:aKey withValue:aValue |
|
687 |
! |
|
688 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
689 |
aspectFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
690 |
"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
|
691 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
692 |
for a components #aspect property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
693 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
694 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
695 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
696 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
697 |
Typically, a valueHolder is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
698 |
|
594 | 699 |
(self selfResponsibleFor:aKey) ifTrue:[ |
700 |
^ self perform:aKey |
|
701 |
]. |
|
702 |
^ masterApplication aspectFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
703 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
704 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
705 |
clientFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
706 |
"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
|
707 |
subcanvas's application. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
708 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
709 |
for a subcanvas's #client property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
710 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
711 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
712 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
713 |
appModels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
714 |
Typically, an applicationModel is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
715 |
|
594 | 716 |
(self selfResponsibleFor:aKey) ifTrue:[ |
717 |
^ self perform:aKey |
|
718 |
]. |
|
719 |
^ masterApplication clientFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
720 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
721 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
722 |
componentFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
723 |
"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
|
724 |
component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
725 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
726 |
for a viewHolders #view property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
727 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
728 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
729 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
730 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
731 |
Typically, a view is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
732 |
|
849 | 733 |
(self selfResponsibleFor:aKey) ifTrue:[ |
421 | 734 |
^ self perform:aKey |
849 | 735 |
]. |
736 |
^ masterApplication componentFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
737 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
738 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
739 |
|
594 | 740 |
helpTextFor:aComponent |
741 |
"activeHelp interface: return some help text for a component" |
|
742 |
||
614 | 743 |
|key cls| |
599 | 744 |
|
594 | 745 |
builder notNil ifTrue:[ |
599 | 746 |
cls := self class. |
747 |
||
748 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
749 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
|
614 | 750 |
^ self helpTextForKey:key |
599 | 751 |
] |
752 |
] |
|
594 | 753 |
]. |
614 | 754 |
masterApplication notNil ifTrue:[ |
755 |
^ masterApplication helpTextFor:aComponent |
|
756 |
]. |
|
757 |
^ nil |
|
758 |
! |
|
594 | 759 |
|
614 | 760 |
helpTextForKey:aKey |
761 |
"activeHelp interface: return some help text for a key" |
|
762 |
||
763 |
|cls helpText| |
|
764 |
||
765 |
cls := self class. |
|
766 |
||
767 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
768 |
helpText := (cls helpSpec) at:aKey ifAbsent:nil |
|
769 |
]. |
|
599 | 770 |
(masterApplication notNil and:[helpText isNil]) ifTrue:[ |
614 | 771 |
helpText := masterApplication helpTextForKey:aKey |
599 | 772 |
]. |
773 |
^ helpText |
|
594 | 774 |
! |
775 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
776 |
labelFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
777 |
"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
|
778 |
label for a component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
779 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
780 |
for a components #label property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
781 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
782 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
783 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
784 |
labels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
785 |
Typically, a string is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
786 |
|
659 | 787 |
(self selfResponsibleFor:aKey) ifTrue:[ |
788 |
^ self perform:aKey |
|
789 |
]. |
|
790 |
^ masterApplication labelFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
791 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
792 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
793 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
794 |
listFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
795 |
"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
|
796 |
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
|
797 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
798 |
for a listWidgets #list property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
799 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
800 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
801 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
802 |
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
|
803 |
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
|
804 |
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
|
805 |
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
|
806 |
chance." |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
807 |
|
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
808 |
|a| |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
809 |
|
421 | 810 |
(self respondsTo:aKey) ifTrue:[ |
811 |
^ self perform:aKey |
|
812 |
]. |
|
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
813 |
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
|
814 |
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
|
815 |
^ a |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
816 |
]. |
421 | 817 |
^ self application listFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
818 |
|
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
819 |
"Modified: 17.6.1997 / 13:13:35 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
820 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
821 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
822 |
menuFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
823 |
"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
|
824 |
holder for a menu. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
825 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
826 |
for a widgets #menu property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
827 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
828 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
829 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
830 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
831 |
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
|
832 |
|
849 | 833 |
(self selfResponsibleFor:aKey) ifTrue:[ |
421 | 834 |
^ self perform:aKey |
835 |
]. |
|
849 | 836 |
^ masterApplication menuFor:aKey |
421 | 837 |
|
838 |
! |
|
839 |
||
840 |
specificationFor:aKey |
|
841 |
"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
|
842 |
specification for a subcanvas or subspecification. |
421 | 843 |
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
|
844 |
for a subcanvases #specification property (minorKey). |
421 | 845 |
Here, a corresponding message is sent to myself, |
846 |
which ought to be defined in the application subclass. |
|
847 |
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
|
848 |
interfaceSpecifications from a Dictionary or whatever. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
849 |
Typically, an interfaceSpecification is returned there." |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
850 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
851 |
|app| |
421 | 852 |
|
594 | 853 |
(self selfResponsibleFor:aKey) ifTrue:[ |
854 |
^ self perform:aKey |
|
855 |
]. |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
856 |
((app := self application) respondsTo:aKey) ifTrue:[ |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
857 |
^ app perform:aKey |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
858 |
]. |
594 | 859 |
^ masterApplication specificationFor:aKey |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
860 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
861 |
"Modified: / 5.2.1998 / 00:31:39 / stefan" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
862 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
863 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
864 |
visualFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
865 |
"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
|
866 |
image or element for a label. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
867 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
868 |
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
|
869 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
870 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
871 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
872 |
images from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
873 |
Typically, an image is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
874 |
|
421 | 875 |
^ self application visualFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
876 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
877 |
! ! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
878 |
|
428 | 879 |
!ApplicationModel methodsFor:'component manipulations'! |
880 |
||
881 |
components:aSymbolOrArray do:aBlock |
|
882 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
883 |
||
884 |
|coll| |
|
885 |
||
886 |
aSymbolOrArray isSymbol ifTrue:[ |
|
887 |
"/ a single components name |
|
888 |
coll := Array with:aSymbolOrArray |
|
889 |
] ifFalse:[ |
|
890 |
coll := aSymbolOrArray |
|
891 |
]. |
|
892 |
coll do:[:aSymbol | |
|
893 |
|component| |
|
894 |
||
500 | 895 |
(component := self componentFor:aSymbol) isNil ifFalse:[ |
428 | 896 |
aBlock value:component |
897 |
] |
|
898 |
] |
|
899 |
||
500 | 900 |
"Modified: 26.3.1997 / 16:23:14 / cg" |
428 | 901 |
! |
902 |
||
903 |
disable:aSymbolOrArray |
|
904 |
"disable the components whose id's are aSymbolOrArray." |
|
905 |
||
906 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
907 |
||
908 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
909 |
! |
|
910 |
||
911 |
enable:aSymbolOrArray |
|
912 |
"enables the component(s) identified by aSymbolOrArray." |
|
913 |
||
914 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
915 |
||
916 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
917 |
! |
|
918 |
||
919 |
invalidate:aSymbolOrArray |
|
920 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
921 |
||
922 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
923 |
||
924 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
925 |
! |
|
926 |
||
927 |
makeInvisible:aSymbolOrArray |
|
928 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
929 |
||
930 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
931 |
||
932 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
933 |
! |
|
934 |
||
935 |
makeReadOnly:aSymbolOrArray |
|
936 |
"make all components identified by aSymbolOrArray read only |
|
937 |
(for editText components)." |
|
938 |
||
939 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
940 |
||
941 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
942 |
! |
|
943 |
||
944 |
makeVisible:aSymbolOrArray |
|
945 |
"makes the components whose id's are aSymbolOrArray visible" |
|
946 |
||
947 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
948 |
||
949 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
950 |
! |
|
951 |
||
952 |
makeWritable:aSymbolOrArray |
|
953 |
"make all components identified by aSymbolOrArray writable |
|
954 |
(for editText components)." |
|
955 |
||
956 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
957 |
||
958 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
959 |
! ! |
|
960 |
||
961 |
!ApplicationModel methodsFor:'drag & drop'! |
|
962 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
963 |
canDrop:aCollectionOfDropObjects in:aComponent |
428 | 964 |
"drop manager asked if a drop is possible |
965 |
- should be redefined by apps which can do it, to return true" |
|
966 |
||
967 |
^ false |
|
968 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
969 |
"Modified: 11.4.1997 / 12:42:47 / cg" |
428 | 970 |
! |
971 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
972 |
drop:aCollectionOfDropObjects in:aComponent at:aPoint |
428 | 973 |
"drop manager wants to drop. |
974 |
This is ony sent, if #canDrop:in: returned true. |
|
975 |
Must be redefined in apps which return true to #canDrop." |
|
976 |
||
977 |
self subclassResponsibility |
|
978 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
979 |
"Modified: 11.4.1997 / 12:43:19 / cg" |
428 | 980 |
! ! |
981 |
||
429 | 982 |
!ApplicationModel methodsFor:'easy bindings'! |
983 |
||
730 | 984 |
registerInterestIn:aValueModel using:aSelectorOrArray |
429 | 985 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
986 |
aSelectorOrArray can be one of three things: |
|
987 |
||
988 |
1) nil in which case no interest is registered |
|
989 |
2) a selector in which case the receiver is understood to be self |
|
990 |
3) an Array in which case the size is two where the first element is the |
|
713 | 991 |
message to be sent and the second element is the receiver." |
429 | 992 |
|
730 | 993 |
aSelectorOrArray isNil ifTrue:[^ aValueModel]. |
429 | 994 |
|
713 | 995 |
(aSelectorOrArray isArray) ifTrue:[ |
730 | 996 |
aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2) |
429 | 997 |
] ifFalse: [ |
998 |
aValueModel onChangeSend:aSelectorOrArray to:self |
|
999 |
]. |
|
1000 |
^aValueModel |
|
1001 |
||
730 | 1002 |
"Modified: / 31.10.1997 / 18:19:44 / cg" |
429 | 1003 |
! |
1004 |
||
1005 |
valueHolderFor:aSelector initialValue:anObject |
|
1006 |
"Return a ValueHolder on anObject." |
|
1007 |
||
1008 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
1009 |
||
1010 |
||
1011 |
! |
|
1012 |
||
730 | 1013 |
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArray |
429 | 1014 |
"Return a ValueHolder on anObject. aSelectorOrArray is the change information |
1015 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
|
1016 |
If it is a Symbol, then it is the change message and the interested object is understood |
|
1017 |
to be the reciever. If it is an Array, then the first element is the change message and |
|
1018 |
the second element is the interested object. " |
|
1019 |
||
713 | 1020 |
(builder bindings includesKey:aSelector) ifFalse:[ |
429 | 1021 |
^ self registerInterestIn:(ValueHolder with:anObject) using:aSelectorOrArray |
1022 |
]. |
|
713 | 1023 |
^ builder aspectAt:aSelector |
429 | 1024 |
|
730 | 1025 |
"Modified: / 31.10.1997 / 18:20:31 / cg" |
429 | 1026 |
! ! |
1027 |
||
52 | 1028 |
!ApplicationModel methodsFor:'initialization'! |
1029 |
||
138 | 1030 |
addTopViewsToCurrentProject |
1031 |
"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
|
1032 |
This allows hiding views on a per-project basis. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1033 |
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
|
1034 |
(such as the Launcher), may redefine this to a noop." |
85 | 1035 |
|
138 | 1036 |
self windowGroup topViews do:[:aView | |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1037 |
aView addToCurrentProject |
138 | 1038 |
] |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1039 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1040 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
85 | 1041 |
! |
1042 |
||
63 | 1043 |
basicInitialize |
69 | 1044 |
"initialize the application. |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1045 |
Since ST-80 applications seem commonly to redefine #initialize |
69 | 1046 |
without doing a super initialize, the real initialization is |
1047 |
done here ..." |
|
1048 |
||
52 | 1049 |
super initialize. |
72 | 1050 |
|
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1051 |
device := Screen current. |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1052 |
|
72 | 1053 |
"claus: I wanted to delay the creation & assignment of the |
1054 |
builder till later, to allow setting to another builder. |
|
1055 |
however, some ST-80 code accesses the builder right after instance |
|
1056 |
creation ..." |
|
1057 |
||
1058 |
"/ " |
|
1059 |
"/ Create a windowBuilder to have someone around which |
|
1060 |
"/ understands the builder protocol. Since UIBuilder is not present |
|
1061 |
"/ in all systems, this allows operation without one (unless a spec |
|
1062 |
"/ is read later ...) |
|
1063 |
"/ " |
|
85 | 1064 |
builder := self createBuilder. |
78 | 1065 |
builder notNil ifTrue:[builder application:self]. |
52 | 1066 |
resources := self class classResources. |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1067 |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1068 |
"Modified: 17.1.1997 / 19:41:59 / cg" |
63 | 1069 |
! |
1070 |
||
138 | 1071 |
createBuilder |
1072 |
"create a UI Builder for me. |
|
1073 |
This method can be redefined if (eventually) there are |
|
1074 |
spec readers for other UI languages (motif UIL ?)" |
|
1075 |
||
1076 |
|cls| |
|
1077 |
||
1078 |
(cls := UIBuilder) isNil ifTrue:[ |
|
1079 |
(cls := WindowBuilder) isNil ifTrue:[ |
|
1080 |
^ nil |
|
1081 |
] |
|
1082 |
]. |
|
1083 |
^ cls new |
|
1084 |
! |
|
1085 |
||
63 | 1086 |
initialize |
83 | 1087 |
"nothing done here; |
1088 |
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
|
1089 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1090 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1091 |
setDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1092 |
"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
|
1093 |
shall open its view(s). |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1094 |
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
|
1095 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1096 |
device := aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1097 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1098 |
"Created: 5.7.1996 / 12:01:40 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1099 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
138 | 1100 |
! ! |
1101 |
||
1102 |
!ApplicationModel methodsFor:'misc'! |
|
1103 |
||
287 | 1104 |
restoreCursors |
1105 |
"restore the original cursors in all of my views" |
|
1106 |
||
1107 |
^ self window windowGroup restoreCursors |
|
1108 |
||
1109 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
1110 |
! |
|
1111 |
||
1112 |
showCursor:aCursor |
|
1113 |
"set all of my views cursor to aCursor. |
|
1114 |
It can be restored with #restoreCursor." |
|
1115 |
||
1116 |
^ self window windowGroup showCursor:aCursor |
|
1117 |
||
1118 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
1119 |
! |
|
1120 |
||
138 | 1121 |
withCursor:aCursor do:aBlock |
1122 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
1123 |
Return the value of aBlock." |
|
1124 |
||
1125 |
^ self window withCursor:aCursor do:aBlock |
|
63 | 1126 |
! |
1127 |
||
142
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1128 |
withExecuteCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1129 |
"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
|
1130 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1131 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1132 |
^ self withCursor:(Cursor execute) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1133 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1134 |
"Created: 14.12.1995 / 20:57:03 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1135 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1136 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1137 |
withReadCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1138 |
"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
|
1139 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1140 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1141 |
^ self withCursor:(Cursor read) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1142 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1143 |
"Created: 14.12.1995 / 20:56:47 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1144 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1145 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1146 |
|
138 | 1147 |
withWaitCursorDo:aBlock |
1148 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
1149 |
Return the value of aBlock." |
|
63 | 1150 |
|
138 | 1151 |
^ self withCursor:Cursor wait do:aBlock |
52 | 1152 |
! ! |
57 | 1153 |
|
428 | 1154 |
!ApplicationModel methodsFor:'opening'! |
1155 |
||
1156 |
openDialog |
|
1157 |
"open the window - assumes that the builder has already setup |
|
1158 |
the interface." |
|
1159 |
||
432 | 1160 |
^ builder openDialog. |
428 | 1161 |
|
1162 |
"Modified: 14.2.1997 / 20:32:52 / cg" |
|
1163 |
! |
|
1164 |
||
429 | 1165 |
openDialogInterface:aSelector |
1166 |
"open a dialog" |
|
1167 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1168 |
^ self openDialogInterface:aSelector withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1169 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1170 |
"Modified: 28.2.1997 / 14:08:01 / cg" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1171 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1172 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1173 |
openDialogInterface:aSelector withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1174 |
"open a dialog" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1175 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1176 |
^ SimpleDialog new |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1177 |
openFor:self |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1178 |
interface:aSelector |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1179 |
withBindings:bindings |
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
1180 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1181 |
"Created: / 28.2.1997 / 14:07:45 / cg" |
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1182 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
429 | 1183 |
! |
1184 |
||
428 | 1185 |
openWindow |
1186 |
"open the window - assumes that the builder has already setup |
|
1187 |
the interface." |
|
1188 |
||
438 | 1189 |
builder open. |
428 | 1190 |
|
1191 |
"Created: 14.2.1997 / 20:20:39 / cg" |
|
1192 |
! |
|
1193 |
||
1194 |
openWindowAt:aLocation |
|
1195 |
"open the window - assumes that the builder has already setup |
|
1196 |
the interface." |
|
1197 |
||
1198 |
builder openWindowAt:aLocation. |
|
1199 |
||
1200 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
657 | 1201 |
! |
1202 |
||
1203 |
openWindowModal |
|
1204 |
"open the window - assumes that the builder has already setup |
|
1205 |
the interface." |
|
1206 |
||
1207 |
builder openModal. |
|
1208 |
||
1209 |
"Created: 14.2.1997 / 20:20:39 / cg" |
|
428 | 1210 |
! ! |
1211 |
||
1212 |
!ApplicationModel methodsFor:'private'! |
|
1213 |
||
1214 |
opened |
|
1215 |
"the topView has been opened. |
|
1216 |
This is sent by my topView when its really open |
|
1217 |
(i.e. finally visible)" |
|
1218 |
||
1219 |
self addTopViewsToCurrentProject. |
|
1220 |
self postOpenWith:builder |
|
1221 |
||
1222 |
"Modified: 14.2.1997 / 20:26:16 / cg" |
|
594 | 1223 |
! |
1224 |
||
1225 |
selfResponsibleFor:aKey |
|
1226 |
^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]]) |
|
428 | 1227 |
! ! |
1228 |
||
71 | 1229 |
!ApplicationModel methodsFor:'queries'! |
1230 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1231 |
defaultWindowType |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1232 |
"Applications come up non-modal, by default" |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1233 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1234 |
^ #normal |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1235 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1236 |
"Created: 17.1.1997 / 19:57:34 / cg" |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1237 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1238 |
|
313
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1239 |
graphicsDevice |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1240 |
"return the device I want to open my views on. |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1241 |
The default (if not created with #onDevice:) is the currently |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1242 |
active screen." |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1243 |
|
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1244 |
^ device |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1245 |
|
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1246 |
"Created: 5.7.1996 / 17:51:31 / cg" |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1247 |
! |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1248 |
|
770
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1249 |
interfaceSpecFor:aSelector |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1250 |
"return an interface spec. |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1251 |
Here, the query is forwarded to my class. |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1252 |
Can be refefined in subclasses which want to provide per-instance specs." |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1253 |
|
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1254 |
^ self class interfaceSpecFor:aSelector |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1255 |
|
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1256 |
"Created: / 25.1.1998 / 19:45:12 / cg" |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1257 |
"Modified: / 25.1.1998 / 19:47:09 / cg" |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1258 |
! |
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1259 |
|
71 | 1260 |
processName |
1261 |
"return a name to be shown for me in the process monitor" |
|
1262 |
||
746
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1263 |
self class == ApplicationModel ifTrue:[ |
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1264 |
^ 'Application' |
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1265 |
]. |
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1266 |
^ self class nameWithoutPrefix |
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1267 |
|
8e84030fcec8
default processname is name of app-class
Claus Gittinger <cg@exept.de>
parents:
730
diff
changeset
|
1268 |
"Modified: / 4.12.1997 / 12:39:14 / cg" |
706 | 1269 |
! |
1270 |
||
1271 |
resolveClassNamed:something inClass:aClass |
|
1272 |
"return the class from something, a class, symbol, string or nil. |
|
1273 |
first we are looking in the namespace of the application, than of the |
|
1274 |
current namespace and than in Smalltalk |
|
1275 |
" |
|
1276 |
||
1277 |
^ Smalltalk resolveName:something inClass:aClass. |
|
1278 |
! |
|
1279 |
||
1280 |
resolveName:something |
|
1281 |
"return the class from something, a class, symbol, string or nil. |
|
1282 |
first we are looking in the namespace of the application, than of the |
|
1283 |
current namespace and than in Smalltalk |
|
1284 |
" |
|
1285 |
^ self resolveName:something inClass:self class |
|
1286 |
! |
|
1287 |
||
1288 |
resolveName:something inClass:aClass |
|
1289 |
"return the class from something, a class, symbol, string or nil. |
|
1290 |
first we are looking in the namespace of the application, than of the |
|
1291 |
current namespace and than in Smalltalk |
|
1292 |
" |
|
711 | 1293 |
|cls| |
706 | 1294 |
|
711 | 1295 |
aClass notNil ifTrue:[ |
1296 |
(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[ |
|
1297 |
^ cls |
|
1298 |
]. |
|
1299 |
||
1300 |
masterApplication notNil ifTrue:[ |
|
1301 |
^ masterApplication resolveName:something |
|
1302 |
] |
|
1303 |
]. |
|
1304 |
^ nil |
|
71 | 1305 |
! ! |
1306 |
||
428 | 1307 |
!ApplicationModel methodsFor:'startup / release'! |
57 | 1308 |
|
63 | 1309 |
allButOpenFrom:aSpec |
69 | 1310 |
"create my views but do not open the main window" |
1311 |
||
723 | 1312 |
|realBuilder window| |
71 | 1313 |
|
72 | 1314 |
"/ DISABLED; see comment in basicInitialize |
1315 |
"/ |
|
1316 |
"/ " |
|
1317 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1318 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1319 |
"/ a UIBuilder .... |
|
1320 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1321 |
"/ if not needed. |
|
1322 |
"/ " |
|
1323 |
"/ realBuilder := UIBuilder new. |
|
1324 |
"/ builder := realBuilder. |
|
1325 |
"/ builder application:self. |
|
1326 |
"/ builder bindings:builder bindings. |
|
71 | 1327 |
|
63 | 1328 |
self preBuildWith:builder. |
1329 |
builder buildFromSpec:aSpec. |
|
723 | 1330 |
window := builder window. |
1331 |
window model:self. |
|
1332 |
(window respondsTo:#application:) ifTrue:[ |
|
1333 |
window application:self. |
|
472 | 1334 |
]. |
63 | 1335 |
self postBuildWith:builder. |
723 | 1336 |
|
1337 |
"Modified: / 26.10.1997 / 12:51:12 / cg" |
|
63 | 1338 |
! |
57 | 1339 |
|
138 | 1340 |
allButOpenInterface:aSymbol |
1341 |
"create my views but do not open the main window" |
|
1342 |
||
1343 |
|spec| |
|
1344 |
||
770
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1345 |
spec := self interfaceSpecFor:aSymbol. |
138 | 1346 |
self allButOpenFrom:spec. |
1347 |
^ builder |
|
770
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1348 |
|
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1349 |
"Modified: / 25.1.1998 / 19:45:29 / cg" |
138 | 1350 |
! |
1351 |
||
1352 |
close |
|
1353 |
"this is sent by my topView when about to be closed |
|
1354 |
by the program (not by the windowManager). |
|
1355 |
Could be redefined in subclasses." |
|
1356 |
||
1357 |
self closeDownViews |
|
1358 |
! |
|
1359 |
||
1360 |
closeDownViews |
|
435 | 1361 |
"close down the applications view(s)" |
138 | 1362 |
|
1363 |
|wg views| |
|
1364 |
||
1365 |
(wg := self windowGroup) notNil ifTrue:[ |
|
435 | 1366 |
views := wg topViews. |
1367 |
views notNil ifTrue:[ |
|
1368 |
views copy do:[:aView | |
|
1369 |
aView notNil ifTrue:[aView destroy] |
|
1370 |
] |
|
1371 |
] |
|
138 | 1372 |
] |
1373 |
! |
|
1374 |
||
1375 |
closeRequest |
|
482
c357e80669e9
close -> closeRequest leads to a cycle with ST-80 apps;
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
1376 |
"this is sent by my topView when about to be closed |
786 | 1377 |
by the windowManager. |
482
c357e80669e9
close -> closeRequest leads to a cycle with ST-80 apps;
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
1378 |
Could be redefined in subclasses to suppress close or confirm." |
138 | 1379 |
|
786 | 1380 |
|sav| |
1381 |
||
1382 |
masterApplication notNil ifTrue:[ |
|
1383 |
||
1384 |
"/ temporary clear my masterApplication to prevent |
|
1385 |
"/ endless recursion, in case the master sends me |
|
1386 |
"/ a closeRequest (although, it is supposed to |
|
1387 |
"/ send me a closeDownViews ...) |
|
1388 |
||
1389 |
sav := masterApplication. |
|
1390 |
masterApplication := nil. |
|
787 | 1391 |
sav closeRequestFor:(self window). |
786 | 1392 |
|
1393 |
"/ restore - in case master did not want me to close ... |
|
1394 |
masterApplication := sav. |
|
1395 |
] ifFalse:[ |
|
1396 |
self closeDownViews |
|
1397 |
]. |
|
482
c357e80669e9
close -> closeRequest leads to a cycle with ST-80 apps;
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
1398 |
|
c357e80669e9
close -> closeRequest leads to a cycle with ST-80 apps;
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
1399 |
"Modified: 4.3.1997 / 00:48:15 / cg" |
435 | 1400 |
! |
1401 |
||
1402 |
closeRequestFor:aTopView |
|
1403 |
"this is sent by any of my topViews when about to be closed by the |
|
1404 |
windowmanager. For backward compatibility with single-view applications, |
|
786 | 1405 |
this is forwarded here to a simple (non topView-specific) closeRequest, |
1406 |
effectively closing all of my views. |
|
435 | 1407 |
MultiView applications should redefine this method if closing of individual |
786 | 1408 |
views closing is to be caught and/or should not close all of them." |
1409 |
||
1410 |
|sav| |
|
1411 |
||
1412 |
masterApplication notNil ifTrue:[ |
|
435 | 1413 |
|
786 | 1414 |
"/ temporary clear my masterApplication to prevent |
1415 |
"/ endless recursion, in case the master sends me |
|
1416 |
"/ a closeRequest (although, it is supposed to |
|
1417 |
"/ send me a closeDownViews ...) |
|
1418 |
||
1419 |
sav := masterApplication. |
|
1420 |
masterApplication := nil. |
|
788 | 1421 |
sav closeRequestFor:(self window). |
786 | 1422 |
|
1423 |
"/ restore - in case master did not want me to close ... |
|
1424 |
masterApplication := sav. |
|
1425 |
] ifFalse:[ |
|
1426 |
self closeRequest |
|
1427 |
] |
|
138 | 1428 |
! |
1429 |
||
69 | 1430 |
open |
1431 |
"open a standard interface" |
|
1432 |
||
240 | 1433 |
^ self openInterface |
1434 |
||
1435 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
69 | 1436 |
! |
1437 |
||
428 | 1438 |
openAt:aPoint |
1439 |
"open a standard interface at some point" |
|
1440 |
||
1441 |
^ self openInterfaceAt:aPoint |
|
1442 |
||
1443 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1444 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
1445 |
! |
|
1446 |
||
63 | 1447 |
openInterface |
428 | 1448 |
"open a standard interface. |
215 | 1449 |
|
78 | 1450 |
Subclasses which do not have an interfaceSpec |
215 | 1451 |
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
|
1452 |
(see Launcher as an example)." |
69 | 1453 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1454 |
^ self openInterface:#windowSpec |
215 | 1455 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1456 |
"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
|
1457 |
"Modified: / 23.1.1998 / 18:16:50 / cg" |
57 | 1458 |
! |
1459 |
||
63 | 1460 |
openInterface:aSymbol |
215 | 1461 |
"open a specific interface. |
1462 |
The argument, aSymbol specifies which interface. The concrete |
|
1463 |
application subclass must provide a method with that name, |
|
1464 |
which must return an interfaceSpec. This is forwarded to |
|
1465 |
the builder to create the views. |
|
69 | 1466 |
Typically, applications only use one interface, |
78 | 1467 |
returned by the #windowSpec method." |
69 | 1468 |
|
85 | 1469 |
self allButOpenInterface:aSymbol. |
428 | 1470 |
self openWindow. |
63 | 1471 |
^ builder |
215 | 1472 |
|
428 | 1473 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
1474 |
! |
|
1475 |
||
1476 |
openInterface:aSymbol at:aLocation |
|
1477 |
"open a specific interface. |
|
1478 |
||
1479 |
The argument, aSymbol specifies which interface. The concrete |
|
1480 |
application subclass must provide a method with that name, |
|
1481 |
which must return an interfaceSpec. This is forwarded to |
|
1482 |
the builder to create the views. |
|
1483 |
Typically, applications only use one interface, |
|
1484 |
returned by the #windowSpec method." |
|
1485 |
||
1486 |
self allButOpenInterface:aSymbol. |
|
1487 |
self openWindowAt:aLocation. |
|
1488 |
^ builder |
|
1489 |
||
1490 |
"Created: 14.2.1997 / 20:19:44 / cg" |
|
1491 |
! |
|
1492 |
||
1493 |
openInterfaceAt:aLocation |
|
1494 |
"open a standard interface." |
|
1495 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1496 |
^ self openInterface:#windowSpec at:aLocation |
428 | 1497 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1498 |
"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
|
1499 |
"Modified: / 23.1.1998 / 18:17:13 / cg" |
63 | 1500 |
! |
1501 |
||
657 | 1502 |
openInterfaceModal |
1503 |
"open a standard interface. |
|
1504 |
||
1505 |
Subclasses which do not have an interfaceSpec |
|
1506 |
should redefine this method and create & open their view(s) there. |
|
1507 |
(see Launcher as an example)." |
|
1508 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1509 |
^ self openInterfaceModal:#windowSpec |
657 | 1510 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1511 |
"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
|
1512 |
"Modified: / 23.1.1998 / 18:17:17 / cg" |
657 | 1513 |
! |
1514 |
||
1515 |
openInterfaceModal:aSymbol |
|
1516 |
"open a specific interface. |
|
1517 |
The argument, aSymbol specifies which interface. The concrete |
|
1518 |
application subclass must provide a method with that name, |
|
1519 |
which must return an interfaceSpec. This is forwarded to |
|
1520 |
the builder to create the views. |
|
1521 |
Typically, applications only use one interface, |
|
1522 |
returned by the #windowSpec method." |
|
1523 |
||
1524 |
self allButOpenInterface:aSymbol. |
|
1525 |
self openWindowModal. |
|
1526 |
^ builder |
|
1527 |
||
1528 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
1529 |
! |
|
1530 |
||
1531 |
openModal |
|
1532 |
"open a standard interface" |
|
1533 |
||
1534 |
^ self openInterfaceModal |
|
1535 |
||
1536 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1537 |
! |
|
1538 |
||
362 | 1539 |
openOnDevice:aDevice |
1540 |
"open a standard interface on some other device" |
|
1541 |
||
1542 |
self setDevice:aDevice. |
|
1543 |
^ self open |
|
1544 |
||
1545 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
1546 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
1547 |
! |
|
1548 |
||
138 | 1549 |
postBuildWith:aBuilder |
1550 |
"this is sent after an interface is built from a spec. |
|
657 | 1551 |
Can be redefined in subclasses for additional setup after |
1552 |
the view has been built, but not yet opened." |
|
138 | 1553 |
! |
1554 |
||
1555 |
postOpenWith:aBuilder |
|
1556 |
"this is sent after the applications main window is opened. |
|
730 | 1557 |
Can be redefined in subclasses for actions after opening the view." |
1558 |
||
1559 |
"Modified: / 31.10.1997 / 17:55:54 / cg" |
|
138 | 1560 |
! |
1561 |
||
1562 |
preBuildWith:aBuilder |
|
1563 |
"this is sent before an interface is built from a spec. |
|
1564 |
Can be redefined in subclasses. |
|
1565 |
mhmh - what should this do here ?" |
|
1566 |
! |
|
1567 |
||
69 | 1568 |
restarted |
287 | 1569 |
"sent by my topWindow, when restarted from an image. |
69 | 1570 |
Nothing done here, but can be redefined to perform any actions |
1571 |
required to reset the application after an image-restart. |
|
1572 |
(for example: check if application files are still around, restart |
|
287 | 1573 |
subprocesses etc.)." |
1574 |
||
1575 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
63 | 1576 |
! |
57 | 1577 |
|
63 | 1578 |
saveAndTerminateRequest |
1579 |
"some windowManagers send this to shut down an application |
|
1580 |
and have it save its state for restart. |
|
1581 |
Can be redefined in subclasses" |
|
1582 |
||
1583 |
self closeRequest |
|
437 | 1584 |
! |
1585 |
||
1586 |
saveAndTerminateRequestFor:aTopView |
|
1587 |
"some windowManagers send this to shut down an application |
|
1588 |
and have it save its state for restart. |
|
1589 |
Can be redefined in subclasses" |
|
1590 |
||
1591 |
self saveAndTerminateRequest |
|
57 | 1592 |
! ! |
72 | 1593 |
|
85 | 1594 |
!ApplicationModel methodsFor:'window events'! |
1595 |
||
144 | 1596 |
showActivity:someMessage |
215 | 1597 |
"some activityNotification shalt be communicated to |
1598 |
the user. Forwarded from the topView and ignored here. |
|
1599 |
Can be redefined in concrete applications to show the |
|
1600 |
message either in some infoView (infoLabel as in Windows) |
|
1601 |
or in the title area (as done in the browsers)" |
|
1602 |
||
144 | 1603 |
^ self |
1604 |
||
1605 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
215 | 1606 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
144 | 1607 |
! |
1608 |
||
85 | 1609 |
windowEvent:anEvent from:anApplicationWindow |
215 | 1610 |
"dummy: windowEvent forwarding is not yet implemented" |
1611 |
||
85 | 1612 |
^ self |
215 | 1613 |
|
1614 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
85 | 1615 |
! ! |
1616 |
||
361 | 1617 |
!ApplicationModel class methodsFor:'documentation'! |
72 | 1618 |
|
138 | 1619 |
version |
849 | 1620 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.72 1998-02-25 14:31:49 ca Exp $' |
81 | 1621 |
! ! |
138 | 1622 |
ApplicationModel initialize! |