author | Claus Gittinger <cg@exept.de> |
Mon, 03 Mar 1997 22:28:21 +0100 | |
changeset 479 | 8058c8296148 |
parent 472 | 40eaf3d339c9 |
child 482 | c357e80669e9 |
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 |
|
310 | 14 |
instanceVariableNames:'builder resources device' |
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 |
||
152 |
!ApplicationModel class methodsFor:'bindings'! |
|
153 |
||
154 |
actionFor:aKey |
|
155 |
"sent by the builder to ask for an actionBlock for |
|
156 |
a Button. The argument, aKey comes from an UI-spec |
|
157 |
for a buttons #action property. |
|
158 |
Here, a corresponding message is sent to myself, |
|
159 |
which ought to be defined in the application subclass. |
|
160 |
Alternatively, a subclass may redefine this method, to provide |
|
161 |
actionBlocks from a Dictionary or whatever. |
|
162 |
Typically, a block is returned there." |
|
163 |
||
164 |
^ nil |
|
165 |
||
166 |
||
167 |
! |
|
168 |
||
169 |
aspectFor:aKey |
|
170 |
"sent by the builder to ask for an aspect (a data model). |
|
171 |
The argument, aKey comes from an UI-spec |
|
172 |
for a components #aspect property. |
|
173 |
Here, a corresponding message is sent to myself, |
|
174 |
which ought to be defined in the application subclass. |
|
175 |
Alternatively, a subclass may redefine this method, to provide |
|
176 |
holders from a Dictionary or whatever. |
|
177 |
Typically, a valueHolder is returned there." |
|
178 |
||
179 |
^ nil |
|
180 |
||
181 |
! |
|
182 |
||
183 |
clientFor:aKey |
|
184 |
"sent by the builder to ask for an application provided |
|
185 |
subcanvas's application. |
|
186 |
The argument, aKey comes from an UI-spec |
|
187 |
for a subcanvas's #client property. |
|
188 |
Here, a corresponding message is sent to myself, |
|
189 |
which ought to be defined in the application subclass. |
|
190 |
Alternatively, a subclass may redefine this method, to provide |
|
191 |
appModels from a Dictionary or whatever. |
|
192 |
Typically, an applicationModel is returned there." |
|
193 |
||
194 |
^ nil |
|
195 |
||
196 |
! |
|
197 |
||
198 |
componentFor:aKey |
|
199 |
"sent by the builder to ask for an application provided |
|
200 |
component. |
|
201 |
The argument, aKey comes from an UI-spec |
|
202 |
for a viewHolders #view property. |
|
203 |
Here, a corresponding message is sent to myself, |
|
204 |
which ought to be defined in the application subclass. |
|
205 |
Alternatively, a subclass may redefine this method, to provide |
|
206 |
holders from a Dictionary or whatever. |
|
207 |
Typically, a view is returned there." |
|
208 |
||
427 | 209 |
(self respondsTo:aKey) ifTrue:[ |
210 |
^ self perform:aKey |
|
211 |
]. |
|
212 |
^ nil |
|
421 | 213 |
! |
214 |
||
215 |
labelFor:aKey |
|
216 |
"sent by the builder to ask for an application provided |
|
217 |
label for a component. |
|
218 |
The argument, aKey comes from an UI-spec |
|
219 |
for a components #label property. |
|
220 |
Here, a corresponding message is sent to myself, |
|
221 |
which ought to be defined in the application subclass. |
|
222 |
Alternatively, a subclass may redefine this method, to provide |
|
223 |
labels from a Dictionary or whatever. |
|
224 |
Typically, a string is returned there." |
|
225 |
||
226 |
(self application respondsTo:aKey) ifTrue:[ |
|
227 |
^ self application perform:aKey |
|
228 |
]. |
|
229 |
^ self application labelAt:aKey ifAbsent:nil |
|
230 |
||
231 |
! |
|
232 |
||
233 |
listFor:aKey |
|
234 |
"sent by the builder to ask for an application provided |
|
235 |
holder for a list. |
|
236 |
The argument, aKey comes from an UI-spec |
|
237 |
for a listWidgets #list property. |
|
238 |
Here, a corresponding message is sent to myself, |
|
239 |
which ought to be defined in the application subclass. |
|
240 |
Alternatively, a subclass may redefine this method, to provide |
|
241 |
holders from a Dictionary or whatever. |
|
242 |
Typically, a list-holding model (SelectionInList) is returned there." |
|
243 |
||
244 |
^ self application perform:aKey |
|
245 |
||
246 |
! |
|
247 |
||
248 |
menuFor:aKey |
|
249 |
"sent by the builder to ask for an application provided |
|
250 |
holder for a menu. |
|
251 |
The argument, aKey comes from an UI-spec |
|
252 |
for a widgets #menu property. |
|
253 |
Here, a corresponding message is sent to myself, |
|
254 |
which ought to be defined in the application subclass. |
|
255 |
Alternatively, a subclass may redefine this method, to provide |
|
256 |
holders from a Dictionary or whatever. |
|
257 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
258 |
||
259 |
^ self application perform:aKey |
|
260 |
||
261 |
! |
|
262 |
||
263 |
specificationFor:aKey |
|
264 |
"sent by the builder to ask for an application provided |
|
265 |
component. |
|
266 |
The argument, aKey comes from an UI-spec |
|
267 |
for a viewHolders #specification property. |
|
268 |
Here, a corresponding message is sent to myself, |
|
269 |
which ought to be defined in the application subclass. |
|
270 |
Alternatively, a subclass may redefine this method, to provide |
|
271 |
holders from a Dictionary or whatever. |
|
272 |
Typically, a view is returned there." |
|
273 |
||
274 |
^ self application perform:aKey |
|
275 |
||
276 |
! |
|
277 |
||
278 |
visualFor:aKey |
|
279 |
"sent by the builder to ask for an application provided |
|
280 |
image or element for a label. |
|
281 |
The argument, aKey comes from an UI-spec |
|
282 |
for a widgets #label property, if LabelIsImage is turned on. |
|
283 |
Here, a corresponding message is sent to myself, |
|
284 |
which ought to be defined in the application subclass. |
|
285 |
Alternatively, a subclass may redefine this method, to provide |
|
286 |
images from a Dictionary or whatever. |
|
287 |
Typically, an image is returned there." |
|
288 |
||
289 |
(self application respondsTo:aKey) ifTrue:[ |
|
290 |
^ self application perform:aKey |
|
291 |
]. |
|
292 |
^ self application visualAt:aKey ifAbsent:nil |
|
293 |
||
294 |
||
295 |
! ! |
|
296 |
||
361 | 297 |
!ApplicationModel class methodsFor:'change & update'! |
52 | 298 |
|
302 | 299 |
update:something with:aParameter from:changedObject |
69 | 300 |
"flush resources on language changes" |
301 |
||
52 | 302 |
something == #Language ifTrue:[ |
302 | 303 |
"flush resources on language changes" |
304 |
self flushAllClassResources |
|
52 | 305 |
] |
302 | 306 |
|
307 |
"Created: 15.6.1996 / 15:13:29 / cg" |
|
52 | 308 |
! ! |
309 |
||
421 | 310 |
!ApplicationModel class methodsFor:'defaults'! |
311 |
||
312 |
labelAt:aKey |
|
313 |
^ nil |
|
314 |
! |
|
315 |
||
316 |
labelAt:aKey ifAbsent:aBlock |
|
317 |
^ aBlock value |
|
318 |
! |
|
319 |
||
320 |
labelAt:aKey put:aValue |
|
321 |
"/ not yet implemented |
|
322 |
! |
|
323 |
||
324 |
labels |
|
325 |
"/ not yet implemented |
|
326 |
^ nil |
|
327 |
! |
|
328 |
||
329 |
visualAt:aKey |
|
330 |
^ nil |
|
331 |
! |
|
332 |
||
333 |
visualAt:aKey ifAbsent:aBlock |
|
334 |
^ aBlock value |
|
335 |
! |
|
336 |
||
337 |
visualAt:aKey put:aValue |
|
338 |
"/ not yet implemented |
|
339 |
! |
|
340 |
||
341 |
visuals |
|
342 |
"/ not yet implemented |
|
343 |
^ nil |
|
344 |
! ! |
|
345 |
||
361 | 346 |
!ApplicationModel class methodsFor:'queries'! |
63 | 347 |
|
348 |
interfaceSpecFor:aSelector |
|
69 | 349 |
"return an interface spec" |
350 |
||
421 | 351 |
^ UISpecification from:(self application specificationFor:aSelector) |
63 | 352 |
! ! |
353 |
||
361 | 354 |
!ApplicationModel class methodsFor:'resources'! |
52 | 355 |
|
356 |
classResources |
|
357 |
"if not already loaded, get the classes resourcePack |
|
358 |
and return it" |
|
359 |
||
360 |
ClassResources isNil ifTrue:[ |
|
361 |
ClassResources := ResourcePack for:self. |
|
362 |
]. |
|
363 |
^ ClassResources |
|
364 |
! |
|
365 |
||
366 |
classResources:aResourcePack |
|
367 |
"allow setting of the classResources" |
|
368 |
||
369 |
ClassResources := aResourcePack |
|
370 |
! |
|
371 |
||
372 |
flushAllClassResources |
|
373 |
"flush all classes resource translations. |
|
374 |
Needed after a resource file / language setting has changed." |
|
375 |
||
376 |
ResourcePack flushCachedResourcePacks. |
|
377 |
self flushClassResources. |
|
378 |
self allSubclassesDo:[:aClass | |
|
379 |
aClass flushClassResources. |
|
380 |
] |
|
381 |
! |
|
382 |
||
383 |
flushClassResources |
|
384 |
"flush classes resource string translations. |
|
385 |
Needed whenever a resource file / language setting has changed" |
|
386 |
||
387 |
ClassResources := nil. |
|
63 | 388 |
! |
389 |
||
390 |
updateClassResources |
|
391 |
"update my classResources" |
|
392 |
||
393 |
ClassResources := nil. |
|
394 |
self classResources |
|
52 | 395 |
! ! |
396 |
||
361 | 397 |
!ApplicationModel class methodsFor:'startup'! |
138 | 398 |
|
399 |
open |
|
400 |
"create an instance of the application and open its view" |
|
401 |
||
240 | 402 |
^ self new open |
138 | 403 |
|
404 |
" |
|
361 | 405 |
Launcher open |
138 | 406 |
" |
240 | 407 |
|
361 | 408 |
"Modified: 13.1.1997 / 20:54:50 / cg" |
138 | 409 |
! |
410 |
||
428 | 411 |
openAt:aLocation |
412 |
"create an instance of the application and open its view |
|
413 |
at some position." |
|
414 |
||
415 |
^ self new openAt:aLocation |
|
416 |
||
417 |
"Modified: 14.2.1997 / 20:28:41 / cg" |
|
418 |
! |
|
419 |
||
420 |
openDialogInterface:anInterfaceSymbol |
|
421 |
"create an instance of the application and open a view as |
|
422 |
specified by anInterfaceSymbol." |
|
423 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
424 |
^ self openDialogInterface:anInterfaceSymbol withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
425 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
426 |
"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
|
427 |
"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
|
428 |
"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
|
429 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
430 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
431 |
openDialogInterface:anInterfaceSymbol withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
432 |
"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
|
433 |
specified by anInterfaceSymbol." |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
434 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
435 |
^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings |
428 | 436 |
|
437 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
438 |
"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
|
439 |
"Created: 28.2.1997 / 14:07:24 / cg" |
428 | 440 |
! |
441 |
||
138 | 442 |
openInterface:anInterfaceSymbol |
443 |
"create an instance of the application and open a view as |
|
444 |
specified by anInterfaceSymbol." |
|
445 |
||
361 | 446 |
^ self new openInterface:anInterfaceSymbol |
138 | 447 |
|
448 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
361 | 449 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
138 | 450 |
! |
451 |
||
428 | 452 |
openInterface:anInterfaceSymbol at:aPoint |
453 |
"create an instance of the application and open a view as |
|
454 |
specified by anInterfaceSymbol." |
|
455 |
||
456 |
^ self new openInterface:anInterfaceSymbol at:aPoint |
|
457 |
||
458 |
"Modified: 14.2.1997 / 20:28:47 / cg" |
|
459 |
! |
|
460 |
||
138 | 461 |
openOn:anApplicationModel |
215 | 462 |
"send an open message to the argument, anApplicationModel. |
463 |
I dont really understand what this method is useful for ..." |
|
138 | 464 |
|
361 | 465 |
^ anApplicationModel open |
215 | 466 |
|
361 | 467 |
"Modified: 13.1.1997 / 20:55:05 / cg" |
138 | 468 |
! |
469 |
||
470 |
openOnDevice:aDevice |
|
471 |
"create an instance of the application and open its view |
|
215 | 472 |
on ANOTHER device. |
473 |
For more info, read the document on multiple display |
|
474 |
support and the documentation of the DeviceWorkstation class." |
|
138 | 475 |
|
361 | 476 |
^ (self onDevice:aDevice) open |
215 | 477 |
|
361 | 478 |
" |
479 |
Launcher openOnDevice:Display |
|
480 |
" |
|
481 |
||
482 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
138 | 483 |
! ! |
484 |
||
485 |
!ApplicationModel methodsFor:'accessing'! |
|
486 |
||
421 | 487 |
application |
488 |
^ self class |
|
489 |
! |
|
490 |
||
138 | 491 |
builder |
492 |
"return the applications builder; this one has more information |
|
493 |
about views, components etc." |
|
494 |
||
495 |
^ builder |
|
496 |
! |
|
497 |
||
498 |
builder:aBuilder |
|
499 |
"set the applications builder. Normally, you should not set it |
|
500 |
directly, but depend on the default builder, as created when the application |
|
501 |
was created." |
|
502 |
||
503 |
builder := aBuilder |
|
504 |
! |
|
505 |
||
506 |
focusSequence |
|
507 |
"return a focusSequence for stepping through the applications views. |
|
508 |
The builder usually keeps track of so-called 'tabable' views. |
|
509 |
Stepping is done with the FocusNext/FocusPrevius keys, which are |
|
510 |
typically bound to Meta-CursorUp/Meta-CursorDown. |
|
511 |
Subclasses which do not use the builder (but instead build their view |
|
512 |
programmatically) should redefine this method to return a collection of |
|
513 |
views which defines the sequence." |
|
514 |
||
515 |
builder notNil ifTrue:[ |
|
516 |
^ builder focusSequence |
|
517 |
]. |
|
518 |
^ nil |
|
519 |
! |
|
520 |
||
521 |
resources |
|
522 |
"return the applications resources - thats a ResourcePack containing |
|
523 |
language strings" |
|
524 |
||
525 |
^ resources |
|
526 |
! |
|
527 |
||
528 |
window |
|
529 |
"return my topWindow" |
|
530 |
||
531 |
^ builder window |
|
532 |
! |
|
533 |
||
187 | 534 |
window:aTopView |
535 |
"set my topWindow" |
|
536 |
||
537 |
builder window:aTopView |
|
538 |
||
539 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
540 |
! |
|
541 |
||
138 | 542 |
windowGroup |
543 |
"return the applications windowGroup" |
|
544 |
||
545 |
^ builder window windowGroup |
|
546 |
! ! |
|
547 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
548 |
!ApplicationModel methodsFor:'binding access'! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
549 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
550 |
actionFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
551 |
"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
|
552 |
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
|
553 |
for a buttons #action property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
554 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
555 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
556 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
557 |
actionBlocks from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
558 |
Typically, a block is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
559 |
|
421 | 560 |
^ [self perform:aKey] |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
561 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
562 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
563 |
aspectFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
564 |
"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
|
565 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
566 |
for a components #aspect property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
567 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
568 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
569 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
570 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
571 |
Typically, a valueHolder is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
572 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
573 |
^ self perform:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
574 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
575 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
576 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
577 |
clientFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
578 |
"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
|
579 |
subcanvas's application. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
580 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
581 |
for a subcanvas's #client property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
582 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
583 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
584 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
585 |
appModels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
586 |
Typically, an applicationModel is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
587 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
588 |
^ self perform:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
589 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
590 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
591 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
592 |
componentFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
593 |
"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
|
594 |
component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
595 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
596 |
for a viewHolders #view property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
597 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
598 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
599 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
600 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
601 |
Typically, a view is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
602 |
|
421 | 603 |
(self respondsTo:aKey) ifTrue:[ |
604 |
^ self perform:aKey |
|
605 |
]. |
|
606 |
^ self application componentFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
607 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
608 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
609 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
610 |
labelFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
611 |
"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
|
612 |
label for a component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
613 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
614 |
for a components #label property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
615 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
616 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
617 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
618 |
labels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
619 |
Typically, a string is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
620 |
|
421 | 621 |
^ self application labelFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
622 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
623 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
624 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
625 |
listFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
626 |
"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
|
627 |
holder for a list. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
628 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
629 |
for a listWidgets #list property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
630 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
631 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
632 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
633 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
634 |
Typically, a list-holding model (SelectionInList) is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
635 |
|
421 | 636 |
(self respondsTo:aKey) ifTrue:[ |
637 |
^ self perform:aKey |
|
638 |
]. |
|
639 |
^ self application listFor:aKey |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
640 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
641 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
642 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
643 |
menuFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
644 |
"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
|
645 |
holder for a menu. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
646 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
647 |
for a widgets #menu property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
648 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
649 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
650 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
651 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
652 |
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
|
653 |
|
421 | 654 |
(self respondsTo:aKey) ifTrue:[ |
655 |
^ self perform:aKey |
|
656 |
]. |
|
657 |
^ self application menuFor:aKey |
|
658 |
||
659 |
! |
|
660 |
||
661 |
specificationFor:aKey |
|
662 |
"sent by the builder to ask for an application provided |
|
663 |
subcanvas's application. |
|
664 |
The argument, aKey comes from an UI-spec |
|
665 |
for a subcanvas's #specification property. |
|
666 |
Here, a corresponding message is sent to myself, |
|
667 |
which ought to be defined in the application subclass. |
|
668 |
Alternatively, a subclass may redefine this method, to provide |
|
669 |
appModels from a Dictionary or whatever. |
|
670 |
Typically, an applicationModel is returned there." |
|
671 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
672 |
^ self perform:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
673 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
674 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
675 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
676 |
visualFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
677 |
"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
|
678 |
image or element for a label. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
679 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
680 |
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
|
681 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
682 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
683 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
684 |
images from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
685 |
Typically, an image is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
686 |
|
421 | 687 |
^ self application visualFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
688 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
689 |
! ! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
690 |
|
428 | 691 |
!ApplicationModel methodsFor:'component manipulations'! |
692 |
||
693 |
components:aSymbolOrArray do:aBlock |
|
694 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
695 |
||
696 |
|coll| |
|
697 |
||
698 |
aSymbolOrArray isSymbol ifTrue:[ |
|
699 |
"/ a single components name |
|
700 |
coll := Array with:aSymbolOrArray |
|
701 |
] ifFalse:[ |
|
702 |
coll := aSymbolOrArray |
|
703 |
]. |
|
704 |
coll do:[:aSymbol | |
|
705 |
|component| |
|
706 |
||
707 |
(component := self component:aSymbol) isNil ifFalse:[ |
|
708 |
aBlock value:component |
|
709 |
] |
|
710 |
] |
|
711 |
||
712 |
"Modified: 14.2.1997 / 17:36:42 / cg" |
|
713 |
! |
|
714 |
||
715 |
disable:aSymbolOrArray |
|
716 |
"disable the components whose id's are aSymbolOrArray." |
|
717 |
||
718 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
719 |
||
720 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
721 |
! |
|
722 |
||
723 |
enable:aSymbolOrArray |
|
724 |
"enables the component(s) identified by aSymbolOrArray." |
|
725 |
||
726 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
727 |
||
728 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
729 |
! |
|
730 |
||
731 |
invalidate:aSymbolOrArray |
|
732 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
733 |
||
734 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
735 |
||
736 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
737 |
! |
|
738 |
||
739 |
makeInvisible:aSymbolOrArray |
|
740 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
741 |
||
742 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
743 |
||
744 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
745 |
! |
|
746 |
||
747 |
makeReadOnly:aSymbolOrArray |
|
748 |
"make all components identified by aSymbolOrArray read only |
|
749 |
(for editText components)." |
|
750 |
||
751 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
752 |
||
753 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
754 |
! |
|
755 |
||
756 |
makeVisible:aSymbolOrArray |
|
757 |
"makes the components whose id's are aSymbolOrArray visible" |
|
758 |
||
759 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
760 |
||
761 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
762 |
! |
|
763 |
||
764 |
makeWritable:aSymbolOrArray |
|
765 |
"make all components identified by aSymbolOrArray writable |
|
766 |
(for editText components)." |
|
767 |
||
768 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
769 |
||
770 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
771 |
! ! |
|
772 |
||
773 |
!ApplicationModel methodsFor:'drag & drop'! |
|
774 |
||
775 |
canDrop:anObjectOrCollection in:aComponent |
|
776 |
"drop manager asked if a drop is possible |
|
777 |
- should be redefined by apps which can do it, to return true" |
|
778 |
||
779 |
^ false |
|
780 |
||
781 |
||
782 |
! |
|
783 |
||
784 |
drop:anObjectOrCollection in:aComponent at:aPoint |
|
785 |
"drop manager wants to drop. |
|
786 |
This is ony sent, if #canDrop:in: returned true. |
|
787 |
Must be redefined in apps which return true to #canDrop." |
|
788 |
||
789 |
self subclassResponsibility |
|
790 |
||
791 |
||
792 |
! ! |
|
793 |
||
429 | 794 |
!ApplicationModel methodsFor:'easy bindings'! |
795 |
||
796 |
registerInterestIn: aValueModel using: aSelectorOrArray |
|
797 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
|
798 |
aSelectorOrArray can be one of three things: |
|
799 |
||
800 |
1) nil in which case no interest is registered |
|
801 |
2) a selector in which case the receiver is understood to be self |
|
802 |
3) an Array in which case the size is two where the first element is the |
|
803 |
message to be sent and the second element is the receiver." |
|
804 |
||
805 |
aSelectorOrArray isNil ifTrue: [^ aValueModel]. |
|
806 |
||
807 |
(aSelectorOrArray isKindOf:Array) ifTrue:[ |
|
808 |
aValueModel onChangeSend:(aSelectorOrArray at: 1) to:(aSelectorOrArray at: 2) |
|
809 |
] ifFalse: [ |
|
810 |
aValueModel onChangeSend:aSelectorOrArray to:self |
|
811 |
]. |
|
812 |
^aValueModel |
|
813 |
||
814 |
||
815 |
! |
|
816 |
||
817 |
valueHolderFor:aSelector initialValue:anObject |
|
818 |
"Return a ValueHolder on anObject." |
|
819 |
||
820 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
821 |
||
822 |
||
823 |
! |
|
824 |
||
825 |
valueHolderFor: aSelector initialValue: anObject changeMessage: aSelectorOrArray |
|
826 |
"Return a ValueHolder on anObject. aSelectorOrArray is the change information |
|
827 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
|
828 |
If it is a Symbol, then it is the change message and the interested object is understood |
|
829 |
to be the reciever. If it is an Array, then the first element is the change message and |
|
830 |
the second element is the interested object. " |
|
831 |
||
832 |
(self builder bindings includesKey:aSelector) ifFalse:[ |
|
833 |
^ self registerInterestIn:(ValueHolder with:anObject) using:aSelectorOrArray |
|
834 |
]. |
|
835 |
^ self builder aspectAt:aSelector |
|
836 |
||
837 |
! ! |
|
838 |
||
52 | 839 |
!ApplicationModel methodsFor:'initialization'! |
840 |
||
138 | 841 |
addTopViewsToCurrentProject |
842 |
"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
|
843 |
This allows hiding views on a per-project basis. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
844 |
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
|
845 |
(such as the Launcher), may redefine this to a noop." |
85 | 846 |
|
138 | 847 |
self windowGroup topViews do:[:aView | |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
848 |
aView addToCurrentProject |
138 | 849 |
] |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
850 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
851 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
85 | 852 |
! |
853 |
||
63 | 854 |
basicInitialize |
69 | 855 |
"initialize the application. |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
856 |
Since ST-80 applications seem commonly to redefine #initialize |
69 | 857 |
without doing a super initialize, the real initialization is |
858 |
done here ..." |
|
859 |
||
52 | 860 |
super initialize. |
72 | 861 |
|
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
862 |
device := Screen current. |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
863 |
|
72 | 864 |
"claus: I wanted to delay the creation & assignment of the |
865 |
builder till later, to allow setting to another builder. |
|
866 |
however, some ST-80 code accesses the builder right after instance |
|
867 |
creation ..." |
|
868 |
||
869 |
"/ " |
|
870 |
"/ Create a windowBuilder to have someone around which |
|
871 |
"/ understands the builder protocol. Since UIBuilder is not present |
|
872 |
"/ in all systems, this allows operation without one (unless a spec |
|
873 |
"/ is read later ...) |
|
874 |
"/ " |
|
85 | 875 |
builder := self createBuilder. |
78 | 876 |
builder notNil ifTrue:[builder application:self]. |
52 | 877 |
resources := self class classResources. |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
878 |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
879 |
"Modified: 17.1.1997 / 19:41:59 / cg" |
63 | 880 |
! |
881 |
||
138 | 882 |
createBuilder |
883 |
"create a UI Builder for me. |
|
884 |
This method can be redefined if (eventually) there are |
|
885 |
spec readers for other UI languages (motif UIL ?)" |
|
886 |
||
887 |
|cls| |
|
888 |
||
889 |
(cls := UIBuilder) isNil ifTrue:[ |
|
890 |
(cls := WindowBuilder) isNil ifTrue:[ |
|
891 |
^ nil |
|
892 |
] |
|
893 |
]. |
|
894 |
^ cls new |
|
895 |
! |
|
896 |
||
63 | 897 |
initialize |
83 | 898 |
"nothing done here; |
899 |
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
|
900 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
901 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
902 |
setDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
903 |
"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
|
904 |
shall open its view(s). |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
905 |
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
|
906 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
907 |
device := aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
908 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
909 |
"Created: 5.7.1996 / 12:01:40 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
910 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
138 | 911 |
! ! |
912 |
||
913 |
!ApplicationModel methodsFor:'misc'! |
|
914 |
||
287 | 915 |
restoreCursors |
916 |
"restore the original cursors in all of my views" |
|
917 |
||
918 |
^ self window windowGroup restoreCursors |
|
919 |
||
920 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
921 |
! |
|
922 |
||
923 |
showCursor:aCursor |
|
924 |
"set all of my views cursor to aCursor. |
|
925 |
It can be restored with #restoreCursor." |
|
926 |
||
927 |
^ self window windowGroup showCursor:aCursor |
|
928 |
||
929 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
930 |
! |
|
931 |
||
138 | 932 |
withCursor:aCursor do:aBlock |
933 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
934 |
Return the value of aBlock." |
|
935 |
||
936 |
^ self window withCursor:aCursor do:aBlock |
|
63 | 937 |
! |
938 |
||
142
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
939 |
withExecuteCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
940 |
"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
|
941 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
942 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
943 |
^ self withCursor:(Cursor execute) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
944 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
945 |
"Created: 14.12.1995 / 20:57:03 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
946 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
947 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
948 |
withReadCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
949 |
"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
|
950 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
951 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
952 |
^ self withCursor:(Cursor read) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
953 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
954 |
"Created: 14.12.1995 / 20:56:47 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
955 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
956 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
957 |
|
138 | 958 |
withWaitCursorDo:aBlock |
959 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
960 |
Return the value of aBlock." |
|
63 | 961 |
|
138 | 962 |
^ self withCursor:Cursor wait do:aBlock |
52 | 963 |
! ! |
57 | 964 |
|
428 | 965 |
!ApplicationModel methodsFor:'opening'! |
966 |
||
967 |
openDialog |
|
968 |
"open the window - assumes that the builder has already setup |
|
969 |
the interface." |
|
970 |
||
432 | 971 |
^ builder openDialog. |
428 | 972 |
|
973 |
"Modified: 14.2.1997 / 20:32:52 / cg" |
|
974 |
! |
|
975 |
||
429 | 976 |
openDialogInterface:aSelector |
977 |
"open a dialog" |
|
978 |
||
464
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
979 |
^ self openDialogInterface:aSelector withBindings:nil |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
980 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
981 |
"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
|
982 |
! |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
983 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
984 |
openDialogInterface:aSelector withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
985 |
"open a dialog" |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
986 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
987 |
^ SimpleDialog new openFor:self interface:aSelector withBindings:bindings |
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
988 |
|
25e6380399c6
allow additional bindings to be passed with #openDialogInterface
Claus Gittinger <cg@exept.de>
parents:
438
diff
changeset
|
989 |
"Created: 28.2.1997 / 14:07:45 / cg" |
429 | 990 |
! |
991 |
||
428 | 992 |
openWindow |
993 |
"open the window - assumes that the builder has already setup |
|
994 |
the interface." |
|
995 |
||
438 | 996 |
builder open. |
428 | 997 |
|
998 |
"Created: 14.2.1997 / 20:20:39 / cg" |
|
999 |
! |
|
1000 |
||
1001 |
openWindowAt:aLocation |
|
1002 |
"open the window - assumes that the builder has already setup |
|
1003 |
the interface." |
|
1004 |
||
1005 |
builder openWindowAt:aLocation. |
|
1006 |
||
1007 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
1008 |
! ! |
|
1009 |
||
1010 |
!ApplicationModel methodsFor:'private'! |
|
1011 |
||
1012 |
opened |
|
1013 |
"the topView has been opened. |
|
1014 |
This is sent by my topView when its really open |
|
1015 |
(i.e. finally visible)" |
|
1016 |
||
1017 |
self addTopViewsToCurrentProject. |
|
1018 |
self postOpenWith:builder |
|
1019 |
||
1020 |
"Modified: 14.2.1997 / 20:26:16 / cg" |
|
1021 |
! ! |
|
1022 |
||
71 | 1023 |
!ApplicationModel methodsFor:'queries'! |
1024 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1025 |
defaultWindowType |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1026 |
"Applications come up non-modal, by default" |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1027 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1028 |
^ #normal |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1029 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1030 |
"Created: 17.1.1997 / 19:57:34 / cg" |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1031 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1032 |
|
313
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1033 |
graphicsDevice |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1034 |
"return the device I want to open my views on. |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1035 |
The default (if not created with #onDevice:) is the currently |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1036 |
active screen." |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1037 |
|
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1038 |
^ device |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1039 |
|
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1040 |
"Created: 5.7.1996 / 17:51:31 / cg" |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1041 |
! |
09c2e83252f4
added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents:
311
diff
changeset
|
1042 |
|
71 | 1043 |
processName |
1044 |
"return a name to be shown for me in the process monitor" |
|
1045 |
||
1046 |
^ 'Application' |
|
1047 |
! ! |
|
1048 |
||
428 | 1049 |
!ApplicationModel methodsFor:'startup / release'! |
57 | 1050 |
|
63 | 1051 |
allButOpenFrom:aSpec |
69 | 1052 |
"create my views but do not open the main window" |
1053 |
||
71 | 1054 |
|realBuilder| |
1055 |
||
72 | 1056 |
"/ DISABLED; see comment in basicInitialize |
1057 |
"/ |
|
1058 |
"/ " |
|
1059 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1060 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1061 |
"/ a UIBuilder .... |
|
1062 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1063 |
"/ if not needed. |
|
1064 |
"/ " |
|
1065 |
"/ realBuilder := UIBuilder new. |
|
1066 |
"/ builder := realBuilder. |
|
1067 |
"/ builder application:self. |
|
1068 |
"/ builder bindings:builder bindings. |
|
71 | 1069 |
|
63 | 1070 |
self preBuildWith:builder. |
1071 |
builder buildFromSpec:aSpec. |
|
85 | 1072 |
builder window model:self. |
472 | 1073 |
(builder window respondsTo:#application:) ifTrue:[ |
1074 |
builder window application:self. |
|
1075 |
]. |
|
63 | 1076 |
self postBuildWith:builder. |
1077 |
! |
|
57 | 1078 |
|
138 | 1079 |
allButOpenInterface:aSymbol |
1080 |
"create my views but do not open the main window" |
|
1081 |
||
1082 |
|spec| |
|
1083 |
||
1084 |
spec := self class interfaceSpecFor:aSymbol. |
|
1085 |
self allButOpenFrom:spec. |
|
1086 |
^ builder |
|
1087 |
! |
|
1088 |
||
1089 |
close |
|
1090 |
"this is sent by my topView when about to be closed |
|
1091 |
by the program (not by the windowManager). |
|
1092 |
Could be redefined in subclasses." |
|
1093 |
||
1094 |
self closeDownViews |
|
1095 |
! |
|
1096 |
||
1097 |
closeDownViews |
|
435 | 1098 |
"close down the applications view(s)" |
138 | 1099 |
|
1100 |
|wg views| |
|
1101 |
||
1102 |
(wg := self windowGroup) notNil ifTrue:[ |
|
435 | 1103 |
views := wg topViews. |
1104 |
views notNil ifTrue:[ |
|
1105 |
views copy do:[:aView | |
|
1106 |
aView notNil ifTrue:[aView destroy] |
|
1107 |
] |
|
1108 |
] |
|
138 | 1109 |
] |
1110 |
! |
|
1111 |
||
1112 |
closeRequest |
|
1113 |
"this is sent by my topView when about to be closed by the |
|
1114 |
windowmanager. Can be redefined to inform & query about unsafed |
|
1115 |
view contents, to send #close on ok, or ignore the closeRequest." |
|
1116 |
||
435 | 1117 |
self close |
1118 |
! |
|
1119 |
||
1120 |
closeRequestFor:aTopView |
|
1121 |
"this is sent by any of my topViews when about to be closed by the |
|
1122 |
windowmanager. For backward compatibility with single-view applications, |
|
1123 |
this is forwarded here to a simple (non topView-specific) closeRequest. |
|
1124 |
MultiView applications should redefine this method if closing of individual |
|
1125 |
views closing is to be cought." |
|
1126 |
||
1127 |
^ self closeRequest |
|
138 | 1128 |
! |
1129 |
||
69 | 1130 |
open |
1131 |
"open a standard interface" |
|
1132 |
||
240 | 1133 |
^ self openInterface |
1134 |
||
1135 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
69 | 1136 |
! |
1137 |
||
428 | 1138 |
openAt:aPoint |
1139 |
"open a standard interface at some point" |
|
1140 |
||
1141 |
^ self openInterfaceAt:aPoint |
|
1142 |
||
1143 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1144 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
1145 |
! |
|
1146 |
||
63 | 1147 |
openInterface |
428 | 1148 |
"open a standard interface. |
215 | 1149 |
|
78 | 1150 |
Subclasses which do not have an interfaceSpec |
215 | 1151 |
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
|
1152 |
(see Launcher as an example)." |
69 | 1153 |
|
63 | 1154 |
self openInterface:#windowSpec |
215 | 1155 |
|
330
d7ce98930ad3
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
313
diff
changeset
|
1156 |
"Modified: 9.9.1996 / 22:39:23 / stefan" |
428 | 1157 |
"Modified: 14.2.1997 / 20:18:26 / cg" |
57 | 1158 |
! |
1159 |
||
63 | 1160 |
openInterface:aSymbol |
215 | 1161 |
"open a specific interface. |
1162 |
The argument, aSymbol specifies which interface. The concrete |
|
1163 |
application subclass must provide a method with that name, |
|
1164 |
which must return an interfaceSpec. This is forwarded to |
|
1165 |
the builder to create the views. |
|
69 | 1166 |
Typically, applications only use one interface, |
78 | 1167 |
returned by the #windowSpec method." |
69 | 1168 |
|
85 | 1169 |
self allButOpenInterface:aSymbol. |
428 | 1170 |
self openWindow. |
63 | 1171 |
^ builder |
215 | 1172 |
|
428 | 1173 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
1174 |
! |
|
1175 |
||
1176 |
openInterface:aSymbol at:aLocation |
|
1177 |
"open a specific interface. |
|
1178 |
||
1179 |
The argument, aSymbol specifies which interface. The concrete |
|
1180 |
application subclass must provide a method with that name, |
|
1181 |
which must return an interfaceSpec. This is forwarded to |
|
1182 |
the builder to create the views. |
|
1183 |
Typically, applications only use one interface, |
|
1184 |
returned by the #windowSpec method." |
|
1185 |
||
1186 |
self allButOpenInterface:aSymbol. |
|
1187 |
self openWindowAt:aLocation. |
|
1188 |
^ builder |
|
1189 |
||
1190 |
"Created: 14.2.1997 / 20:19:44 / cg" |
|
1191 |
! |
|
1192 |
||
1193 |
openInterfaceAt:aLocation |
|
1194 |
"open a standard interface." |
|
1195 |
||
1196 |
self openInterface:#windowSpec at:aLocation |
|
1197 |
||
1198 |
"Created: 14.2.1997 / 20:18:20 / cg" |
|
63 | 1199 |
! |
1200 |
||
362 | 1201 |
openOnDevice:aDevice |
1202 |
"open a standard interface on some other device" |
|
1203 |
||
1204 |
self setDevice:aDevice. |
|
1205 |
^ self open |
|
1206 |
||
1207 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
1208 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
1209 |
! |
|
1210 |
||
138 | 1211 |
postBuildWith:aBuilder |
1212 |
"this is sent after an interface is built from a spec. |
|
1213 |
Can be redefined in subclasses. |
|
1214 |
mhmh - what should this do here ?" |
|
1215 |
! |
|
1216 |
||
1217 |
postOpenWith:aBuilder |
|
1218 |
"this is sent after the applications main window is opened. |
|
1219 |
Can be redefined in subclasses. |
|
1220 |
mhmh - what should this do here ?" |
|
1221 |
! |
|
1222 |
||
1223 |
preBuildWith:aBuilder |
|
1224 |
"this is sent before an interface is built from a spec. |
|
1225 |
Can be redefined in subclasses. |
|
1226 |
mhmh - what should this do here ?" |
|
1227 |
! |
|
1228 |
||
69 | 1229 |
restarted |
287 | 1230 |
"sent by my topWindow, when restarted from an image. |
69 | 1231 |
Nothing done here, but can be redefined to perform any actions |
1232 |
required to reset the application after an image-restart. |
|
1233 |
(for example: check if application files are still around, restart |
|
287 | 1234 |
subprocesses etc.)." |
1235 |
||
1236 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
63 | 1237 |
! |
57 | 1238 |
|
63 | 1239 |
saveAndTerminateRequest |
1240 |
"some windowManagers send this to shut down an application |
|
1241 |
and have it save its state for restart. |
|
1242 |
Can be redefined in subclasses" |
|
1243 |
||
1244 |
self closeRequest |
|
437 | 1245 |
! |
1246 |
||
1247 |
saveAndTerminateRequestFor:aTopView |
|
1248 |
"some windowManagers send this to shut down an application |
|
1249 |
and have it save its state for restart. |
|
1250 |
Can be redefined in subclasses" |
|
1251 |
||
1252 |
self saveAndTerminateRequest |
|
57 | 1253 |
! ! |
72 | 1254 |
|
85 | 1255 |
!ApplicationModel methodsFor:'window events'! |
1256 |
||
144 | 1257 |
showActivity:someMessage |
215 | 1258 |
"some activityNotification shalt be communicated to |
1259 |
the user. Forwarded from the topView and ignored here. |
|
1260 |
Can be redefined in concrete applications to show the |
|
1261 |
message either in some infoView (infoLabel as in Windows) |
|
1262 |
or in the title area (as done in the browsers)" |
|
1263 |
||
144 | 1264 |
^ self |
1265 |
||
1266 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
215 | 1267 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
144 | 1268 |
! |
1269 |
||
85 | 1270 |
windowEvent:anEvent from:anApplicationWindow |
215 | 1271 |
"dummy: windowEvent forwarding is not yet implemented" |
1272 |
||
85 | 1273 |
^ self |
215 | 1274 |
|
1275 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
85 | 1276 |
! ! |
1277 |
||
361 | 1278 |
!ApplicationModel class methodsFor:'documentation'! |
72 | 1279 |
|
138 | 1280 |
version |
472 | 1281 |
^ '$Header: /cvs/stx/stx/libview2/Attic/AppModel.st,v 1.45 1997-03-03 10:12:08 ca Exp $' |
81 | 1282 |
! ! |
138 | 1283 |
ApplicationModel initialize! |