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