author | Claus Gittinger <cg@exept.de> |
Fri, 26 Feb 1999 00:07:04 +0100 | |
changeset 1109 | e76027e7627a |
parent 1105 | 1985b9e86503 |
child 1110 | 2977fe9f2184 |
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 |
||
1109 | 129 |
^ self basicNew basicInitialize initialize |
215 | 130 |
|
131 |
"Modified: 24.4.1996 / 09:42:14 / cg" |
|
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
132 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
133 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
134 |
onDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
135 |
"return a new initialized instance, which shall open its interface |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
136 |
on aDevice." |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
137 |
|
1109 | 138 |
^ (self basicNew basicInitialize |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
139 |
setDevice:aDevice) initialize |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
140 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
141 |
"Modified: 24.4.1996 / 09:42:14 / cg" |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
142 |
"Created: 5.7.1996 / 12:19:15 / cg" |
52 | 143 |
! ! |
144 |
||
421 | 145 |
!ApplicationModel class methodsFor:'accessing'! |
146 |
||
147 |
application |
|
148 |
^ self |
|
149 |
||
150 |
! ! |
|
151 |
||
599 | 152 |
!ApplicationModel class methodsFor:'active help'! |
153 |
||
154 |
helpSpec |
|
155 |
^ IdentityDictionary new. |
|
156 |
! ! |
|
157 |
||
421 | 158 |
!ApplicationModel class methodsFor:'bindings'! |
159 |
||
160 |
actionFor:aKey |
|
161 |
"sent by the builder to ask for an actionBlock for |
|
162 |
a Button. The argument, aKey comes from an UI-spec |
|
163 |
for a buttons #action property. |
|
164 |
Here, a corresponding message is sent to myself, |
|
165 |
which ought to be defined in the application subclass. |
|
166 |
Alternatively, a subclass may redefine this method, to provide |
|
167 |
actionBlocks from a Dictionary or whatever. |
|
168 |
Typically, a block is returned there." |
|
169 |
||
170 |
^ nil |
|
171 |
||
172 |
||
173 |
! |
|
174 |
||
715 | 175 |
actionFor:aKey withValue:aValue |
176 |
"sent by the builder to ask for an actionBlock for |
|
177 |
a Button which passes a value to the actionMethod. |
|
178 |
The argument, aKey comes from an UI-spec |
|
179 |
for a buttons #action property. |
|
180 |
Here, a corresponding message is sent to myself, |
|
181 |
which ought to be defined in the application subclass. |
|
182 |
Alternatively, a subclass may redefine this method, to provide |
|
183 |
actionBlocks from a Dictionary or whatever. |
|
184 |
Typically, a block is returned there." |
|
185 |
||
186 |
^ nil |
|
187 |
||
188 |
||
189 |
! |
|
190 |
||
421 | 191 |
aspectFor:aKey |
192 |
"sent by the builder to ask for an aspect (a data model). |
|
193 |
The argument, aKey comes from an UI-spec |
|
194 |
for a components #aspect property. |
|
195 |
Here, a corresponding message is sent to myself, |
|
196 |
which ought to be defined in the application subclass. |
|
197 |
Alternatively, a subclass may redefine this method, to provide |
|
198 |
holders from a Dictionary or whatever. |
|
199 |
Typically, a valueHolder is returned there." |
|
200 |
||
723 | 201 |
^ self perform:aKey |
421 | 202 |
|
723 | 203 |
"/ ^ nil |
204 |
||
205 |
"Modified: / 27.10.1997 / 13:43:12 / cg" |
|
421 | 206 |
! |
207 |
||
208 |
clientFor:aKey |
|
209 |
"sent by the builder to ask for an application provided |
|
210 |
subcanvas's application. |
|
211 |
The argument, aKey comes from an UI-spec |
|
212 |
for a subcanvas's #client property. |
|
213 |
Here, a corresponding message is sent to myself, |
|
214 |
which ought to be defined in the application subclass. |
|
215 |
Alternatively, a subclass may redefine this method, to provide |
|
216 |
appModels from a Dictionary or whatever. |
|
217 |
Typically, an applicationModel is returned there." |
|
218 |
||
219 |
^ nil |
|
220 |
||
221 |
! |
|
222 |
||
223 |
componentFor:aKey |
|
224 |
"sent by the builder to ask for an application provided |
|
225 |
component. |
|
226 |
The argument, aKey comes from an UI-spec |
|
227 |
for a viewHolders #view property. |
|
228 |
Here, a corresponding message is sent to myself, |
|
229 |
which ought to be defined in the application subclass. |
|
230 |
Alternatively, a subclass may redefine this method, to provide |
|
231 |
holders from a Dictionary or whatever. |
|
232 |
Typically, a view is returned there." |
|
233 |
||
427 | 234 |
(self respondsTo:aKey) ifTrue:[ |
235 |
^ self perform:aKey |
|
236 |
]. |
|
237 |
^ nil |
|
421 | 238 |
! |
239 |
||
240 |
labelFor:aKey |
|
241 |
"sent by the builder to ask for an application provided |
|
242 |
label for a component. |
|
243 |
The argument, aKey comes from an UI-spec |
|
244 |
for a components #label property. |
|
245 |
Here, a corresponding message is sent to myself, |
|
246 |
which ought to be defined in the application subclass. |
|
247 |
Alternatively, a subclass may redefine this method, to provide |
|
248 |
labels from a Dictionary or whatever. |
|
249 |
Typically, a string is returned there." |
|
250 |
||
251 |
(self application respondsTo:aKey) ifTrue:[ |
|
252 |
^ self application perform:aKey |
|
253 |
]. |
|
254 |
^ self application labelAt:aKey ifAbsent:nil |
|
255 |
||
256 |
! |
|
257 |
||
258 |
listFor:aKey |
|
259 |
"sent by the builder to ask for an application provided |
|
260 |
holder for a list. |
|
261 |
The argument, aKey comes from an UI-spec |
|
262 |
for a listWidgets #list property. |
|
263 |
Here, a corresponding message is sent to myself, |
|
264 |
which ought to be defined in the application subclass. |
|
265 |
Alternatively, a subclass may redefine this method, to provide |
|
266 |
holders from a Dictionary or whatever. |
|
267 |
Typically, a list-holding model (SelectionInList) is returned there." |
|
268 |
||
483 | 269 |
|app| |
421 | 270 |
|
483 | 271 |
(app := self application) notNil ifTrue:[ |
272 |
(app respondsTo:aKey) ifTrue:[ |
|
273 |
^ app perform:aKey |
|
274 |
] |
|
275 |
]. |
|
276 |
^ nil. |
|
277 |
||
278 |
"Modified: 4.3.1997 / 00:53:03 / cg" |
|
421 | 279 |
! |
280 |
||
281 |
menuFor:aKey |
|
282 |
"sent by the builder to ask for an application provided |
|
283 |
holder for a menu. |
|
284 |
The argument, aKey comes from an UI-spec |
|
285 |
for a widgets #menu property. |
|
286 |
Here, a corresponding message is sent to myself, |
|
287 |
which ought to be defined in the application subclass. |
|
288 |
Alternatively, a subclass may redefine this method, to provide |
|
289 |
holders from a Dictionary or whatever. |
|
290 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
291 |
||
292 |
^ self application perform:aKey |
|
293 |
||
294 |
! |
|
295 |
||
296 |
specificationFor:aKey |
|
297 |
"sent by the builder to ask for an application provided |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
298 |
specification for a subcanvas or subspecification. |
421 | 299 |
The argument, aKey comes from an UI-spec |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
300 |
for a subcanvases #specification property (minorKey). |
421 | 301 |
Here, a corresponding message is sent to myself, |
302 |
which ought to be defined in the application subclass. |
|
303 |
Alternatively, a subclass may redefine this method, to provide |
|
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
304 |
interfaceSpecifications from a Dictionary or whatever. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
305 |
Typically, an interfaceSpecification is returned there." |
421 | 306 |
|
307 |
^ self application perform:aKey |
|
308 |
||
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
309 |
"Modified: / 5.2.1998 / 00:21:57 / stefan" |
421 | 310 |
! |
311 |
||
312 |
visualFor:aKey |
|
313 |
"sent by the builder to ask for an application provided |
|
314 |
image or element for a label. |
|
315 |
The argument, aKey comes from an UI-spec |
|
316 |
for a widgets #label property, if LabelIsImage is turned on. |
|
317 |
Here, a corresponding message is sent to myself, |
|
318 |
which ought to be defined in the application subclass. |
|
319 |
Alternatively, a subclass may redefine this method, to provide |
|
320 |
images from a Dictionary or whatever. |
|
321 |
Typically, an image is returned there." |
|
322 |
||
323 |
(self application respondsTo:aKey) ifTrue:[ |
|
324 |
^ self application perform:aKey |
|
325 |
]. |
|
326 |
^ self application visualAt:aKey ifAbsent:nil |
|
327 |
||
328 |
||
329 |
! ! |
|
330 |
||
361 | 331 |
!ApplicationModel class methodsFor:'change & update'! |
52 | 332 |
|
302 | 333 |
update:something with:aParameter from:changedObject |
69 | 334 |
"flush resources on language changes" |
335 |
||
52 | 336 |
something == #Language ifTrue:[ |
302 | 337 |
"flush resources on language changes" |
338 |
self flushAllClassResources |
|
52 | 339 |
] |
302 | 340 |
|
341 |
"Created: 15.6.1996 / 15:13:29 / cg" |
|
52 | 342 |
! ! |
343 |
||
421 | 344 |
!ApplicationModel class methodsFor:'defaults'! |
345 |
||
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 |
|
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
649 |
"return my topWindow - or nil, if I have no window (yet)" |
138 | 650 |
|
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
651 |
builder isNil ifTrue:[^ nil]. |
138 | 652 |
^ builder window |
1074
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
653 |
|
f422336b1fd1
handle query for window, before window is setup.
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
654 |
"Modified: / 18.9.1998 / 15:18:19 / cg" |
138 | 655 |
! |
656 |
||
187 | 657 |
window:aTopView |
658 |
"set my topWindow" |
|
659 |
||
660 |
builder window:aTopView |
|
661 |
||
662 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
663 |
! |
|
664 |
||
138 | 665 |
windowGroup |
666 |
"return the applications windowGroup" |
|
667 |
||
657 | 668 |
|w| |
669 |
||
1066
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
670 |
builder notNil ifTrue:[ |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
671 |
(w := builder window) notNil ifTrue:[ |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
672 |
^ w windowGroup |
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
673 |
]. |
657 | 674 |
]. |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
675 |
masterApplication notNil ifTrue:[ |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
676 |
^ masterApplication windowGroup |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
677 |
]. |
657 | 678 |
^ nil |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
679 |
|
1066
3f827dd8983f
care for nil builder in #windowGroup.
Claus Gittinger <cg@exept.de>
parents:
1050
diff
changeset
|
680 |
"Modified: / 7.9.1998 / 23:37:00 / cg" |
138 | 681 |
! ! |
682 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
683 |
!ApplicationModel methodsFor:'binding access'! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
684 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
685 |
actionFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
686 |
"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
|
687 |
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
|
688 |
for a buttons #action property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
689 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
690 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
691 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
692 |
actionBlocks from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
693 |
Typically, a block is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
694 |
|
594 | 695 |
(self selfResponsibleFor:aKey) ifTrue:[ |
723 | 696 |
^ [self perform:aKey] "/ could use: MessageSend receiver:self selector:aKey |
594 | 697 |
]. |
698 |
^ masterApplication actionFor:aKey |
|
723 | 699 |
|
700 |
"Modified: / 28.10.1997 / 20:34:51 / cg" |
|
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
701 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
702 |
|
715 | 703 |
actionFor:aKey withValue:aValue |
704 |
"sent by the builder to ask for an actionBlock for |
|
705 |
a Button which passes a value. |
|
706 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
|
707 |
Here, a corresponding message is sent to myself, |
|
708 |
which ought to be defined in the application subclass. |
|
709 |
Alternatively, a subclass may redefine this method, to provide |
|
710 |
actionBlocks from a Dictionary or whatever. |
|
711 |
Typically, a block is returned there." |
|
712 |
||
713 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
714 |
^ [self perform:aKey with:aValue] |
|
715 |
]. |
|
716 |
^ masterApplication actionFor:aKey withValue:aValue |
|
717 |
! |
|
718 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
719 |
aspectFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
720 |
"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
|
721 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
722 |
for a components #aspect property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
723 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
724 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
725 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
726 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
727 |
Typically, a valueHolder is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
728 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
729 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
730 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
731 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
732 |
^ masterApplication aspectFor:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
733 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
734 |
"Modified: / 18.6.1998 / 20:33:23 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
735 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
736 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
737 |
clientFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
738 |
"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
|
739 |
subcanvas's application. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
740 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
741 |
for a subcanvas's #client property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
742 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
743 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
744 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
745 |
appModels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
746 |
Typically, an applicationModel is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
747 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
748 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
749 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
750 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
751 |
^ masterApplication clientFor:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
752 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
753 |
"Modified: / 18.6.1998 / 20:33:30 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
754 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
755 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
756 |
componentFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
757 |
"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
|
758 |
component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
759 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
760 |
for a viewHolders #view property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
761 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
762 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
763 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
764 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
765 |
Typically, a view is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
766 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
767 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
768 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
769 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
770 |
^ masterApplication componentFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
771 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
772 |
"Modified: / 18.6.1998 / 20:33:36 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
773 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
774 |
|
594 | 775 |
helpTextFor:aComponent |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
776 |
"activeHelp interface: return some help text for a widget component" |
594 | 777 |
|
614 | 778 |
|key cls| |
599 | 779 |
|
594 | 780 |
builder notNil ifTrue:[ |
599 | 781 |
cls := self class. |
782 |
||
783 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
784 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
|
614 | 785 |
^ self helpTextForKey:key |
599 | 786 |
] |
787 |
] |
|
594 | 788 |
]. |
614 | 789 |
masterApplication notNil ifTrue:[ |
790 |
^ masterApplication helpTextFor:aComponent |
|
791 |
]. |
|
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
792 |
^ nil |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
793 |
|
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
794 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
614 | 795 |
! |
594 | 796 |
|
614 | 797 |
helpTextForKey:aKey |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
798 |
"activeHelp interface: return some help text for a key |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
799 |
(from my helpSpec); return a language variant (if available)" |
614 | 800 |
|
801 |
|cls helpText| |
|
802 |
||
803 |
cls := self class. |
|
804 |
||
805 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
806 |
helpText := (cls helpSpec) at:aKey ifAbsent:nil |
|
807 |
]. |
|
599 | 808 |
(masterApplication notNil and:[helpText isNil]) ifTrue:[ |
614 | 809 |
helpText := masterApplication helpTextForKey:aKey |
599 | 810 |
]. |
1020
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
811 |
|
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
812 |
"/ translate. |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
813 |
resources notNil ifTrue:[ |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
814 |
^ resources string:helpText |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
815 |
]. |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
816 |
^ helpText |
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
817 |
|
faf7b61885fe
translate helptexts to national variants.
Claus Gittinger <cg@exept.de>
parents:
1017
diff
changeset
|
818 |
"Modified: / 31.7.1998 / 23:01:59 / cg" |
594 | 819 |
! |
820 |
||
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
821 |
labelFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
822 |
"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
|
823 |
label for a component. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
824 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
825 |
for a components #label property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
826 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
827 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
828 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
829 |
labels from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
830 |
Typically, a string is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
831 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
832 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
833 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
834 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
835 |
^ masterApplication labelFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
836 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
837 |
"Modified: / 18.6.1998 / 20:33:42 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
838 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
839 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
840 |
listFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
841 |
"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
|
842 |
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
|
843 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
844 |
for a listWidgets #list property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
845 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
846 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
847 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
848 |
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
|
849 |
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
|
850 |
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
|
851 |
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
|
852 |
chance." |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
853 |
|
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
854 |
|a| |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
855 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
856 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
857 |
^ self perform:aKey |
421 | 858 |
]. |
604
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
859 |
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
|
860 |
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
|
861 |
^ a |
190f3d243635
when asking for a list, look in the aspects as a fall back.
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
862 |
]. |
421 | 863 |
^ self application listFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
864 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
865 |
"Modified: / 18.6.1998 / 20:33:50 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
866 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
867 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
868 |
menuFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
869 |
"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
|
870 |
holder for a menu. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
871 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
872 |
for a widgets #menu property. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
873 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
874 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
875 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
876 |
holders from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
877 |
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
|
878 |
|
849 | 879 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
880 |
^ self perform:aKey |
421 | 881 |
]. |
849 | 882 |
^ masterApplication menuFor:aKey |
421 | 883 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
884 |
"Modified: / 18.6.1998 / 20:33:56 / cg" |
421 | 885 |
! |
886 |
||
887 |
specificationFor:aKey |
|
888 |
"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
|
889 |
specification for a subcanvas or subspecification. |
421 | 890 |
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
|
891 |
for a subcanvases #specification property (minorKey). |
421 | 892 |
Here, a corresponding message is sent to myself, |
893 |
which ought to be defined in the application subclass. |
|
894 |
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
|
895 |
interfaceSpecifications from a Dictionary or whatever. |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
896 |
Typically, an interfaceSpecification is returned there." |
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
897 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
898 |
|app| |
421 | 899 |
|
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
900 |
(self selfResponsibleFor:aKey) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
901 |
^ self perform:aKey |
963
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
902 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
903 |
((app := self application) respondsTo:aKey) ifTrue:[ |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
904 |
^ app perform:aKey |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
905 |
]. |
6ac4bb44a5df
better checks for unimplemented aspect methods
Claus Gittinger <cg@exept.de>
parents:
953
diff
changeset
|
906 |
^ masterApplication specificationFor:aKey |
825
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
907 |
|
98429ad39f5d
#specificationFor: asks the class about the window specification.
Stefan Vogel <sv@exept.de>
parents:
788
diff
changeset
|
908 |
"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
|
909 |
"Modified: / 18.6.1998 / 20:34:02 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
910 |
! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
911 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
912 |
visualFor:aKey |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
913 |
"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
|
914 |
image or element for a label. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
915 |
The argument, aKey comes from an UI-spec |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
916 |
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
|
917 |
Here, a corresponding message is sent to myself, |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
918 |
which ought to be defined in the application subclass. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
919 |
Alternatively, a subclass may redefine this method, to provide |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
920 |
images from a Dictionary or whatever. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
921 |
Typically, an image is returned there." |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
922 |
|
421 | 923 |
^ self application visualFor:aKey |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
924 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
925 |
! ! |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
926 |
|
428 | 927 |
!ApplicationModel methodsFor:'component manipulations'! |
928 |
||
929 |
components:aSymbolOrArray do:aBlock |
|
930 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
931 |
||
932 |
|coll| |
|
933 |
||
934 |
aSymbolOrArray isSymbol ifTrue:[ |
|
935 |
"/ a single components name |
|
936 |
coll := Array with:aSymbolOrArray |
|
937 |
] ifFalse:[ |
|
938 |
coll := aSymbolOrArray |
|
939 |
]. |
|
940 |
coll do:[:aSymbol | |
|
941 |
|component| |
|
942 |
||
500 | 943 |
(component := self componentFor:aSymbol) isNil ifFalse:[ |
428 | 944 |
aBlock value:component |
945 |
] |
|
946 |
] |
|
947 |
||
500 | 948 |
"Modified: 26.3.1997 / 16:23:14 / cg" |
428 | 949 |
! |
950 |
||
951 |
disable:aSymbolOrArray |
|
952 |
"disable the components whose id's are aSymbolOrArray." |
|
953 |
||
954 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
955 |
||
956 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
957 |
! |
|
958 |
||
959 |
enable:aSymbolOrArray |
|
960 |
"enables the component(s) identified by aSymbolOrArray." |
|
961 |
||
962 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
963 |
||
964 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
965 |
! |
|
966 |
||
967 |
invalidate:aSymbolOrArray |
|
968 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
969 |
||
970 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
971 |
||
972 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
973 |
! |
|
974 |
||
975 |
makeInvisible:aSymbolOrArray |
|
976 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
977 |
||
978 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
979 |
||
980 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
981 |
! |
|
982 |
||
983 |
makeReadOnly:aSymbolOrArray |
|
984 |
"make all components identified by aSymbolOrArray read only |
|
985 |
(for editText components)." |
|
986 |
||
987 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
988 |
||
989 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
990 |
! |
|
991 |
||
992 |
makeVisible:aSymbolOrArray |
|
993 |
"makes the components whose id's are aSymbolOrArray visible" |
|
994 |
||
995 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
996 |
||
997 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
998 |
! |
|
999 |
||
1000 |
makeWritable:aSymbolOrArray |
|
1001 |
"make all components identified by aSymbolOrArray writable |
|
1002 |
(for editText components)." |
|
1003 |
||
1004 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
1005 |
||
1006 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
1007 |
! ! |
|
1008 |
||
901 | 1009 |
!ApplicationModel methodsFor:'copying'! |
1010 |
||
1011 |
postCopy |
|
1012 |
builder := device := nil. |
|
1013 |
||
1014 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
1015 |
! ! |
|
1016 |
||
428 | 1017 |
!ApplicationModel methodsFor:'drag & drop'! |
1018 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1019 |
canDrop:aCollectionOfDropObjects in:aComponent |
428 | 1020 |
"drop manager asked if a drop is possible |
1021 |
- should be redefined by apps which can do it, to return true" |
|
1022 |
||
1023 |
^ false |
|
1024 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1025 |
"Modified: 11.4.1997 / 12:42:47 / cg" |
428 | 1026 |
! |
1027 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1028 |
drop:aCollectionOfDropObjects in:aComponent at:aPoint |
428 | 1029 |
"drop manager wants to drop. |
1030 |
This is ony sent, if #canDrop:in: returned true. |
|
1031 |
Must be redefined in apps which return true to #canDrop." |
|
1032 |
||
1033 |
self subclassResponsibility |
|
1034 |
||
521
2937b6c596b3
drop arg is always a collection
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1035 |
"Modified: 11.4.1997 / 12:43:19 / cg" |
428 | 1036 |
! ! |
1037 |
||
429 | 1038 |
!ApplicationModel methodsFor:'easy bindings'! |
1039 |
||
730 | 1040 |
registerInterestIn:aValueModel using:aSelectorOrArray |
429 | 1041 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
1042 |
aSelectorOrArray can be one of three things: |
|
1043 |
||
1044 |
1) nil in which case no interest is registered |
|
1045 |
2) a selector in which case the receiver is understood to be self |
|
1046 |
3) an Array in which case the size is two where the first element is the |
|
713 | 1047 |
message to be sent and the second element is the receiver." |
429 | 1048 |
|
730 | 1049 |
aSelectorOrArray isNil ifTrue:[^ aValueModel]. |
429 | 1050 |
|
713 | 1051 |
(aSelectorOrArray isArray) ifTrue:[ |
730 | 1052 |
aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2) |
429 | 1053 |
] ifFalse: [ |
1054 |
aValueModel onChangeSend:aSelectorOrArray to:self |
|
1055 |
]. |
|
1056 |
^aValueModel |
|
1057 |
||
730 | 1058 |
"Modified: / 31.10.1997 / 18:19:44 / cg" |
429 | 1059 |
! |
1060 |
||
1061 |
valueHolderFor:aSelector initialValue:anObject |
|
1062 |
"Return a ValueHolder on anObject." |
|
1063 |
||
1064 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
1065 |
||
1066 |
||
1067 |
! |
|
1068 |
||
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1069 |
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
|
1070 |
"Return a ValueHolder on anObject. aSelectorOrArrayOrNil is the change information |
429 | 1071 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
1072 |
If it is a Symbol, then it is the change message and the interested object is understood |
|
1073 |
to be the reciever. If it is an Array, then the first element is the change message and |
|
1074 |
the second element is the interested object. " |
|
1075 |
||
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1076 |
|holder| |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1077 |
|
713 | 1078 |
(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
|
1079 |
holder := ValueHolder with:anObject. |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1080 |
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
|
1081 |
aSelectorOrArrayOrNil notNil ifTrue:[ |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1082 |
^ 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
|
1083 |
]. |
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1084 |
^ holder |
429 | 1085 |
]. |
713 | 1086 |
^ builder aspectAt:aSelector |
429 | 1087 |
|
937
b4a2ba99d791
oops - forgot to add the new valueHolder to the bindings
Claus Gittinger <cg@exept.de>
parents:
933
diff
changeset
|
1088 |
"Modified: / 21.5.1998 / 03:31:28 / cg" |
429 | 1089 |
! ! |
1090 |
||
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1091 |
!ApplicationModel methodsFor:'help'! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1092 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1093 |
showActiveHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1094 |
"This is invoked from the activeHelp event listener, to display some popup-help |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1095 |
for a component. If false is returned, the help manager will pop up |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1096 |
some active help bubble; if true is returned, it will assume that the |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1097 |
help text has been already displayed and will not do any further actions. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1098 |
Here, we accept the help text, and push an event into out own input |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1099 |
queue, so that the help text will be displayed asyncronously by myself, |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1100 |
vis the #showHelp:for: method. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1101 |
This can be redefined in concrete classes to handle active help differently." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1102 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1103 |
|wg mySensor| |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1104 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1105 |
self showingHelp ifFalse: [ |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1106 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1107 |
]. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1108 |
|
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1109 |
"/ masterApplication notNil ifTrue:[ |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1110 |
"/ (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[ |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1111 |
"/ ^ true |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1112 |
"/ ] |
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1113 |
"/ ]. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1114 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1115 |
"/ NEW: push it into the event queue, to have it displayed |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1116 |
"/ syncronously with other events. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1117 |
"/ (also any errors are reported as occurring in my context; |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1118 |
"/ instead of occurring in the activeHelp context). |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1119 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1120 |
(wg := self windowGroup) notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1121 |
mySensor := wg sensor. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1122 |
mySensor notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1123 |
mySensor flushEventsFor:self withType:#showHelp:for:. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1124 |
mySensor |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1125 |
pushUserEvent:#showHelp:for: for:self |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1126 |
withArguments:(Array with:aHelpText with:view). |
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1127 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1128 |
] |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1129 |
]. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1130 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1131 |
"/ mhmh - can this happen ? |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1132 |
|
1050
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1133 |
^ true |
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1134 |
|
c062ec647d98
fixed #windowGroup - if there is a masterApp
Claus Gittinger <cg@exept.de>
parents:
1024
diff
changeset
|
1135 |
"Modified: / 21.8.1998 / 16:00:37 / cg" |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1136 |
! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1137 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1138 |
showHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1139 |
"actual method which is supposed to display the help text. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1140 |
Should be redefined in concrete classes, to put the help text |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1141 |
into some info label, or the windows title bar. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1142 |
Here, the help text is ignored." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1143 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1144 |
masterApplication notNil ifTrue:[ |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1145 |
masterApplication showHelp:aHelpText for:view |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1146 |
]. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1147 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1148 |
"Modified: / 31.7.1998 / 19:13:59 / cg" |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1149 |
! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1150 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1151 |
showingHelp |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1152 |
"return true, if the activeHelp manager should invoke my #showHelp:for: |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1153 |
method, when the mouse pointer is moved over my widgets. |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1154 |
The default here is true, however, the #showHelp:for: methods are empty. |
1017
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1155 |
These should be redefined to put the help text into some info label, |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1156 |
or into the views title bar. |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1157 |
You may also redefine the showingHelp/showingHelp: methods, to |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1158 |
remember the flag setting." |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1159 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1160 |
^ true |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1161 |
|
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1162 |
"Modified: / 31.7.1998 / 17:55:31 / cg" |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1163 |
! ! |
4bc113495af2
part of the activeHelp framework moved from ToolApplicationModel.
Claus Gittinger <cg@exept.de>
parents:
995
diff
changeset
|
1164 |
|
52 | 1165 |
!ApplicationModel methodsFor:'initialization'! |
1166 |
||
138 | 1167 |
addTopViewsToCurrentProject |
1168 |
"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
|
1169 |
This allows hiding views on a per-project basis. |
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1170 |
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
|
1171 |
(such as the Launcher), may redefine this to a noop." |
85 | 1172 |
|
138 | 1173 |
self windowGroup topViews do:[:aView | |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1174 |
aView addToCurrentProject |
138 | 1175 |
] |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1176 |
|
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1177 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
85 | 1178 |
! |
1179 |
||
63 | 1180 |
basicInitialize |
69 | 1181 |
"initialize the application. |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1182 |
Since ST-80 applications seem commonly to redefine #initialize |
69 | 1183 |
without doing a super initialize, the real initialization is |
1184 |
done here ..." |
|
1185 |
||
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1186 |
device := Screen current. |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1187 |
|
72 | 1188 |
"claus: I wanted to delay the creation & assignment of the |
1189 |
builder till later, to allow setting to another builder. |
|
1190 |
however, some ST-80 code accesses the builder right after instance |
|
1191 |
creation ..." |
|
1192 |
||
1193 |
"/ " |
|
1194 |
"/ Create a windowBuilder to have someone around which |
|
1195 |
"/ understands the builder protocol. Since UIBuilder is not present |
|
1196 |
"/ in all systems, this allows operation without one (unless a spec |
|
1197 |
"/ is read later ...) |
|
1198 |
"/ " |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1199 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1200 |
"/ changed - cg; create the builder later. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1201 |
"/ 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
|
1202 |
"/ late. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1203 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1204 |
"/ builder := self builderClass new. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1205 |
"/ builder notNil ifTrue:[builder application:self]. |
52 | 1206 |
resources := self class classResources. |
311
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1207 |
|
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1208 |
"Modified: / 20.6.1998 / 11:53:36 / cg" |
138 | 1209 |
! |
1210 |
||
63 | 1211 |
initialize |
83 | 1212 |
"nothing done here; |
1213 |
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
|
1214 |
! |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1215 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1216 |
setDevice:aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1217 |
"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
|
1218 |
shall open its view(s). |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1219 |
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
|
1220 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1221 |
device := aDevice |
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1222 |
|
fa222d8a208c
allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents:
310
diff
changeset
|
1223 |
"Created: 5.7.1996 / 12:01:40 / cg" |
371
ce94ec6a38ee
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1224 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
138 | 1225 |
! ! |
1226 |
||
1227 |
!ApplicationModel methodsFor:'misc'! |
|
1228 |
||
928 | 1229 |
information:aString |
1230 |
"like Objects information, but translates the string via the |
|
1231 |
resourcePack, thus giving a translated string automatically" |
|
1232 |
||
1233 |
super information:(resources string:aString) withCRs |
|
1234 |
||
1235 |
"Created: / 20.5.1998 / 03:48:43 / cg" |
|
1236 |
! |
|
1237 |
||
287 | 1238 |
restoreCursors |
1239 |
"restore the original cursors in all of my views" |
|
1240 |
||
1241 |
^ self window windowGroup restoreCursors |
|
1242 |
||
1243 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
1244 |
! |
|
1245 |
||
1246 |
showCursor:aCursor |
|
1247 |
"set all of my views cursor to aCursor. |
|
1248 |
It can be restored with #restoreCursor." |
|
1249 |
||
1250 |
^ self window windowGroup showCursor:aCursor |
|
1251 |
||
1252 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
1253 |
! |
|
1254 |
||
925
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1255 |
warn:aString |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1256 |
"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
|
1257 |
resourcePack, thus giving a translated string automatically" |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1258 |
|
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1259 |
super warn:(resources string:aString) withCRs |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1260 |
|
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1261 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1262 |
! |
40209ab29c73
redefined #warn:, to translate the text
Claus Gittinger <cg@exept.de>
parents:
921
diff
changeset
|
1263 |
|
138 | 1264 |
withCursor:aCursor do:aBlock |
1265 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
1266 |
Return the value of aBlock." |
|
1267 |
||
1075
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1268 |
|w ret| |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1269 |
|
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1270 |
w := self window. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1271 |
w notNil ifTrue:[ |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1272 |
^ w withCursor:aCursor do:aBlock |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1273 |
]. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1274 |
aCursor showWhile:[ret := aBlock value]. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1275 |
^ ret. |
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1276 |
|
5b52a4b70c5d
care for non-window in withCursor:do:
Claus Gittinger <cg@exept.de>
parents:
1074
diff
changeset
|
1277 |
"Modified: / 23.9.1998 / 17:00:25 / cg" |
63 | 1278 |
! |
1279 |
||
142
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1280 |
withExecuteCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1281 |
"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
|
1282 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1283 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1284 |
^ self withCursor:(Cursor execute) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1285 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1286 |
"Created: 14.12.1995 / 20:57:03 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1287 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1288 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1289 |
withReadCursorDo:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1290 |
"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
|
1291 |
Return the value of aBlock." |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1292 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1293 |
^ self withCursor:(Cursor read) do:aBlock |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1294 |
|
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1295 |
"Created: 14.12.1995 / 20:56:47 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1296 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1297 |
! |
6c6259d788a4
added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents:
138
diff
changeset
|
1298 |
|
138 | 1299 |
withWaitCursorDo:aBlock |
1300 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
1301 |
Return the value of aBlock." |
|
63 | 1302 |
|
138 | 1303 |
^ self withCursor:Cursor wait do:aBlock |
52 | 1304 |
! ! |
57 | 1305 |
|
428 | 1306 |
!ApplicationModel methodsFor:'opening'! |
1307 |
||
63 | 1308 |
allButOpenFrom:aSpec |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1309 |
"create my views but do not open the main window. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1310 |
The argument is a spec which defines the interface." |
69 | 1311 |
|
723 | 1312 |
|realBuilder window| |
71 | 1313 |
|
72 | 1314 |
"/ DISABLED; see comment in basicInitialize |
1315 |
"/ |
|
1316 |
"/ " |
|
1317 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1318 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1319 |
"/ a UIBuilder .... |
|
1320 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1321 |
"/ if not needed. |
|
1322 |
"/ " |
|
1323 |
"/ realBuilder := UIBuilder new. |
|
1324 |
"/ builder := realBuilder. |
|
1325 |
"/ builder application:self. |
|
1326 |
"/ builder bindings:builder bindings. |
|
71 | 1327 |
|
901 | 1328 |
builder isNil ifTrue:[ |
978 | 1329 |
self createBuilder. |
901 | 1330 |
]. |
1331 |
||
63 | 1332 |
self preBuildWith:builder. |
1333 |
builder buildFromSpec:aSpec. |
|
723 | 1334 |
window := builder window. |
1335 |
window model:self. |
|
1336 |
(window respondsTo:#application:) ifTrue:[ |
|
1337 |
window application:self. |
|
472 | 1338 |
]. |
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1339 |
self showingHelp ifTrue: [ActiveHelp startFor: self]. |
63 | 1340 |
self postBuildWith:builder. |
723 | 1341 |
|
978 | 1342 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
63 | 1343 |
! |
57 | 1344 |
|
138 | 1345 |
allButOpenInterface:aSymbol |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1346 |
"create my views but do not open the main window. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1347 |
The argument specifies a selector of a method, |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1348 |
which when sent to myself should return a spec" |
138 | 1349 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1350 |
self allButOpenFrom:(self interfaceSpecFor:aSymbol). |
138 | 1351 |
^ builder |
770
86ff2c263a8d
instance asks class for #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
1352 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1353 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
138 | 1354 |
! |
1355 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1356 |
buildSubCanvas:spec withBuilder:aBuilder |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1357 |
"build a subcanvases spec into aSubcanvas" |
786 | 1358 |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1359 |
|sameApp| |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1360 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1361 |
builder isNil ifTrue:[ |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1362 |
builder := aBuilder. |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1363 |
aBuilder isNil ifTrue:[ |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1364 |
self createBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1365 |
] |
786 | 1366 |
]. |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1367 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1368 |
aBuilder source:self. |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1369 |
|
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1370 |
"/ if the subcanvases appModel is NOT the same as |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1371 |
"/ the topApp, it must be pre/post-built. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1372 |
"/ Otherwise, we invoke pre/post-builtAsSubcanvas. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1373 |
"/ which provides a hook for redefinition in concrete appModels. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1374 |
"/ This avoids invoking pre/postBuild twice for subCanvases which |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1375 |
"/ have the topApp as appModel. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1376 |
|
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1377 |
sameApp := aBuilder application == aBuilder window topView application. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1378 |
sameApp ifTrue:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1379 |
self preBuildAsSubcanvasWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1380 |
] ifFalse:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1381 |
self preBuildWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1382 |
]. |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1383 |
aBuilder buildFromSpec:spec. |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1384 |
sameApp ifTrue:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1385 |
self postBuildAsSubcanvasWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1386 |
] ifFalse:[ |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1387 |
self postBuildWith:aBuilder. |
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1388 |
]. |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1389 |
^ aBuilder |
435 | 1390 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1391 |
"Created: / 18.6.1998 / 20:08:45 / cg" |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1392 |
"Modified: / 8.7.1998 / 18:30:46 / cg" |
138 | 1393 |
! |
1394 |
||
69 | 1395 |
open |
1396 |
"open a standard interface" |
|
1397 |
||
240 | 1398 |
^ self openInterface |
1399 |
||
1400 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
69 | 1401 |
! |
1402 |
||
428 | 1403 |
openAt:aPoint |
1404 |
"open a standard interface at some point" |
|
1405 |
||
1406 |
^ self openInterfaceAt:aPoint |
|
1407 |
||
1408 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1409 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
1410 |
! |
|
1411 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1412 |
openDialog |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1413 |
"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
|
1414 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1415 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1416 |
^ builder openDialog. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1417 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1418 |
"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
|
1419 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1420 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1421 |
openDialogInterface:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1422 |
"open a dialog" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1423 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1424 |
^ self openDialogInterface:aSelector withBindings:nil |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1425 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1426 |
"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
|
1427 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1428 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1429 |
openDialogInterface:aSelector withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1430 |
"open a dialog" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1431 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1432 |
^ SimpleDialog new |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1433 |
openFor:self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1434 |
interface:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1435 |
withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1436 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1437 |
"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
|
1438 |
"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
|
1439 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1440 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1441 |
openDialogSpec:aSpec withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1442 |
"open a dialog" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1443 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1444 |
^ SimpleDialog new |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1445 |
openFor:self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1446 |
spec:aSpec |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1447 |
withBindings:bindings |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1448 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1449 |
"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
|
1450 |
"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
|
1451 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1452 |
|
63 | 1453 |
openInterface |
428 | 1454 |
"open a standard interface. |
215 | 1455 |
|
78 | 1456 |
Subclasses which do not have an interfaceSpec |
215 | 1457 |
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
|
1458 |
(see Launcher as an example)." |
69 | 1459 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1460 |
^ self openInterface:#windowSpec |
215 | 1461 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1462 |
"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
|
1463 |
"Modified: / 23.1.1998 / 18:16:50 / cg" |
57 | 1464 |
! |
1465 |
||
63 | 1466 |
openInterface:aSymbol |
215 | 1467 |
"open a specific interface. |
1468 |
The argument, aSymbol specifies which interface. The concrete |
|
1469 |
application subclass must provide a method with that name, |
|
1470 |
which must return an interfaceSpec. This is forwarded to |
|
1471 |
the builder to create the views. |
|
69 | 1472 |
Typically, applications only use one interface, |
78 | 1473 |
returned by the #windowSpec method." |
69 | 1474 |
|
85 | 1475 |
self allButOpenInterface:aSymbol. |
428 | 1476 |
self openWindow. |
63 | 1477 |
^ builder |
215 | 1478 |
|
428 | 1479 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
1480 |
! |
|
1481 |
||
1482 |
openInterface:aSymbol at:aLocation |
|
1483 |
"open a specific interface. |
|
1484 |
||
1485 |
The argument, aSymbol specifies which interface. The concrete |
|
1486 |
application subclass must provide a method with that name, |
|
1487 |
which must return an interfaceSpec. This is forwarded to |
|
1488 |
the builder to create the views. |
|
1489 |
Typically, applications only use one interface, |
|
1490 |
returned by the #windowSpec method." |
|
1491 |
||
1492 |
self allButOpenInterface:aSymbol. |
|
1493 |
self openWindowAt:aLocation. |
|
1494 |
^ builder |
|
1495 |
||
1496 |
"Created: 14.2.1997 / 20:19:44 / cg" |
|
1497 |
! |
|
1498 |
||
1499 |
openInterfaceAt:aLocation |
|
1500 |
"open a standard interface." |
|
1501 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1502 |
^ self openInterface:#windowSpec at:aLocation |
428 | 1503 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1504 |
"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
|
1505 |
"Modified: / 23.1.1998 / 18:17:13 / cg" |
63 | 1506 |
! |
1507 |
||
657 | 1508 |
openInterfaceModal |
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1509 |
"open a standard interface as a modal dialog. |
657 | 1510 |
|
1511 |
Subclasses which do not have an interfaceSpec |
|
1512 |
should redefine this method and create & open their view(s) there. |
|
1513 |
(see Launcher as an example)." |
|
1514 |
||
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1515 |
^ self openInterfaceModal:#windowSpec |
657 | 1516 |
|
767
acc3850cbf7e
pass return values of openXX messages back to caller
Claus Gittinger <cg@exept.de>
parents:
746
diff
changeset
|
1517 |
"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
|
1518 |
"Modified: / 23.1.1998 / 18:17:17 / cg" |
657 | 1519 |
! |
1520 |
||
1521 |
openInterfaceModal:aSymbol |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1522 |
"open a specific interface as a modal dialog. |
657 | 1523 |
The argument, aSymbol specifies which interface. The concrete |
1524 |
application subclass must provide a method with that name, |
|
1525 |
which must return an interfaceSpec. This is forwarded to |
|
1526 |
the builder to create the views. |
|
1527 |
Typically, applications only use one interface, |
|
1528 |
returned by the #windowSpec method." |
|
1529 |
||
1530 |
self allButOpenInterface:aSymbol. |
|
1531 |
self openWindowModal. |
|
1532 |
^ builder |
|
1533 |
||
1534 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
1535 |
! |
|
1536 |
||
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1537 |
openInterfaceModal:aSymbol at:location |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1538 |
"open a specific interface modal at some screen location. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1539 |
The argument, aSymbol specifies which interface. The concrete |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1540 |
application subclass must provide a method with that name, |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1541 |
which must return an interfaceSpec. This is forwarded to |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1542 |
the builder to create the views. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1543 |
Typically, applications only use one interface, |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1544 |
returned by the #windowSpec method." |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1545 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1546 |
self allButOpenInterface:aSymbol. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1547 |
self openWindowModalAt:location. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1548 |
^ builder |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1549 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1550 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1551 |
! |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1552 |
|
657 | 1553 |
openModal |
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1554 |
"open a standard interface as a modal dialog" |
657 | 1555 |
|
1556 |
^ self openInterfaceModal |
|
1557 |
||
1558 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
1559 |
! |
|
1560 |
||
362 | 1561 |
openOnDevice:aDevice |
1562 |
"open a standard interface on some other device" |
|
1563 |
||
1564 |
self setDevice:aDevice. |
|
1565 |
^ self open |
|
1566 |
||
1567 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
1568 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
1569 |
! |
|
1570 |
||
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1571 |
openSpec:anInterfaceSpec |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1572 |
"open a view as specified in anInterfaceSpec." |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1573 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1574 |
self allButOpenFrom:anInterfaceSpec. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1575 |
self openWindow. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1576 |
^ builder |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1577 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1578 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1579 |
"Created: / 20.5.1998 / 20:08:51 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1580 |
! |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1581 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1582 |
openSpecModal:anInterfaceSpec |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1583 |
"open an interface spec modal" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1584 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1585 |
self allButOpenFrom:anInterfaceSpec. |
931
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1586 |
self openWindowModal. |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1587 |
^ builder |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1588 |
|
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1589 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1590 |
"Created: / 20.5.1998 / 20:20:21 / cg" |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1591 |
! |
9d8e155b931c
added #openSpec: and #openSpecModal:
Claus Gittinger <cg@exept.de>
parents:
928
diff
changeset
|
1592 |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1593 |
openWindow |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1594 |
"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
|
1595 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1596 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1597 |
builder openWindow. |
969
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 |
"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
|
1600 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1601 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1602 |
openWindowAt:aLocation |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1603 |
"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
|
1604 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1605 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1606 |
builder openWindowAt:aLocation. |
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 |
"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
|
1609 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1610 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1611 |
openWindowModal |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1612 |
"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
|
1613 |
the interface." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1614 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1615 |
"/ builder openDialog. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1616 |
builder |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1617 |
openAt:nil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1618 |
withExtent:nil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1619 |
andType:#dialog |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1620 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1621 |
"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
|
1622 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1623 |
|
1093
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1624 |
openWindowModalAt:aLocation |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1625 |
"open the window modal - assumes that the builder has already setup |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1626 |
the interface." |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1627 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1628 |
builder openDialogAt:aLocation. |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1629 |
|
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1630 |
"Created: 14.2.1997 / 20:20:55 / cg" |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1631 |
! |
002ed1df9f41
cleaned up all #open* methods;
Claus Gittinger <cg@exept.de>
parents:
1075
diff
changeset
|
1632 |
|
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1633 |
postBuildAsSubcanvasWith:aBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1634 |
"this is sent after an interface is built from a spec as subcanvas. |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1635 |
Can be redefined in subclasses for additional setup after |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1636 |
the subcanvas view has been built, but not yet opened." |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1637 |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1638 |
"Modified: / 8.7.1998 / 18:28:55 / cg" |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1639 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1640 |
|
138 | 1641 |
postBuildWith:aBuilder |
1642 |
"this is sent after an interface is built from a spec. |
|
657 | 1643 |
Can be redefined in subclasses for additional setup after |
1644 |
the view has been built, but not yet opened." |
|
138 | 1645 |
! |
1646 |
||
1647 |
postOpenWith:aBuilder |
|
1648 |
"this is sent after the applications main window is opened. |
|
730 | 1649 |
Can be redefined in subclasses for actions after opening the view." |
1650 |
||
1024
0d62cb3da243
switch on active help / no activeHelp event listener to the masterApp
tz
parents:
1020
diff
changeset
|
1651 |
|
138 | 1652 |
! |
1653 |
||
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1654 |
preBuildAsSubcanvasWith:aBuilder |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1655 |
"this is sent before an interface is built from a spec as a subcanvas. |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1656 |
Can be redefined for apps which need to be informed about that." |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1657 |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1658 |
"Modified: / 8.7.1998 / 18:29:34 / cg" |
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1659 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1660 |
|
138 | 1661 |
preBuildWith:aBuilder |
1662 |
"this is sent before an interface is built from a spec. |
|
1663 |
Can be redefined in subclasses. |
|
1664 |
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
|
1665 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1666 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1667 |
!ApplicationModel methodsFor:'private'! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1668 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1669 |
builderClass |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1670 |
"return the UIBuilder class for me. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1671 |
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
|
1672 |
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
|
1673 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1674 |
^ UIBuilder |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1675 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1676 |
"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
|
1677 |
"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
|
1678 |
! |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1679 |
|
978 | 1680 |
createBuilder |
1681 |
builder isNil ifTrue:[ |
|
1682 |
builder := self builderClass new. |
|
1683 |
builder application:self. |
|
1684 |
] |
|
1685 |
||
1686 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
|
1687 |
! |
|
1688 |
||
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1689 |
opened:whichTopView |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1690 |
"the topView has been opened. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1691 |
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
|
1692 |
(i.e. finally visible)" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1693 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1694 |
self addTopViewsToCurrentProject. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1695 |
self postOpenWith:builder |
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 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1698 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1699 |
selfResponsibleFor:aKey |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1700 |
^ (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
|
1701 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1702 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1703 |
!ApplicationModel methodsFor:'queries'! |
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 |
defaultWindowType |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1706 |
"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
|
1707 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1708 |
^ #normal |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1709 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1710 |
"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
|
1711 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1712 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1713 |
graphicsDevice |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1714 |
"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
|
1715 |
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
|
1716 |
active screen." |
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 |
^ device |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1719 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1720 |
"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
|
1721 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1722 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1723 |
interfaceSpecFor:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1724 |
"return an interface spec. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1725 |
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
|
1726 |
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
|
1727 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1728 |
^ self class interfaceSpecFor:aSelector |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1729 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1730 |
"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
|
1731 |
"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
|
1732 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1733 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1734 |
processName |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1735 |
"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
|
1736 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1737 |
self class == ApplicationModel ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1738 |
^ 'Application' |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1739 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1740 |
^ self class nameWithoutPrefix |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1741 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1742 |
"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
|
1743 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1744 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1745 |
resolveClassNamed:something inClass:aClass |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1746 |
"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
|
1747 |
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
|
1748 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1749 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1750 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1751 |
^ Smalltalk resolveName:something inClass:aClass. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1752 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1753 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1754 |
resolveName:something |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1755 |
"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
|
1756 |
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
|
1757 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1758 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1759 |
^ self resolveName:something inClass:self class |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1760 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1761 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1762 |
resolveName:something inClass:aClass |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1763 |
"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
|
1764 |
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
|
1765 |
current namespace and than in Smalltalk |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1766 |
" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1767 |
|cls| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1768 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1769 |
aClass notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1770 |
(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
|
1771 |
^ cls |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1772 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1773 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1774 |
masterApplication notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1775 |
^ masterApplication resolveName:something |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1776 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1777 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1778 |
^ nil |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1779 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1780 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1781 |
topApplication |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1782 |
"return the top-master application" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1783 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1784 |
masterApplication isNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1785 |
^ self |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1786 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1787 |
^ masterApplication topApplication |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1788 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1789 |
"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
|
1790 |
! ! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1791 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1792 |
!ApplicationModel methodsFor:'startup / release'! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1793 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1794 |
close |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1795 |
"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
|
1796 |
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
|
1797 |
Could be redefined in subclasses." |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1798 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1799 |
self closeDownViews |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1800 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1801 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1802 |
closeDownViews |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1803 |
"close down the applications view(s)" |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1804 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1805 |
|wg views| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1806 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1807 |
(wg := self windowGroup) notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1808 |
views := wg topViews. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1809 |
views notNil ifTrue:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1810 |
views copy do:[:aView | |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1811 |
aView notNil ifTrue:[aView destroy] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1812 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1813 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1814 |
] |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1815 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1816 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1817 |
closeRequest |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1818 |
"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
|
1819 |
by the windowManager. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1820 |
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
|
1821 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1822 |
|sav| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1823 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1824 |
"/ In multiView apps, tell my master. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1825 |
"/ (but not if I am a modal reincarnation) |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1826 |
(masterApplication notNil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1827 |
and:[self window isModal not]) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1828 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1829 |
"/ temporary clear my masterApplication to prevent |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1830 |
"/ 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
|
1831 |
"/ 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
|
1832 |
"/ send me a closeDownViews ...) |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1833 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1834 |
sav := masterApplication. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1835 |
masterApplication := nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1836 |
sav closeRequestFor:(self window). |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1837 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1838 |
"/ 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
|
1839 |
masterApplication := sav. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1840 |
] ifFalse:[ |
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1841 |
"/ 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
|
1842 |
"/ a supersend; |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1843 |
"/ 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
|
1844 |
"/ sigh. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1845 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1846 |
self requestForWindowClose ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1847 |
self closeDownViews |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1848 |
] |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1849 |
]. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1850 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1851 |
"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
|
1852 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1853 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1854 |
closeRequestFor:aTopView |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1855 |
"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
|
1856 |
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
|
1857 |
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
|
1858 |
effectively closing all of my views. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1859 |
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
|
1860 |
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
|
1861 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1862 |
|sav| |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1863 |
|
1105
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1864 |
"/ In multiView apps, tell my master. |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1865 |
"/ (but not if I am a modal reincarnation) |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1866 |
(masterApplication notNil |
1985b9e86503
care for masterApp notNil but modal mode.
Claus Gittinger <cg@exept.de>
parents:
1093
diff
changeset
|
1867 |
and:[self window isModal not]) ifTrue:[ |
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1868 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1869 |
"/ temporary clear my masterApplication to prevent |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1870 |
"/ 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
|
1871 |
"/ 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
|
1872 |
"/ send me a closeDownViews ...) |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1873 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1874 |
sav := masterApplication. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1875 |
masterApplication := nil. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1876 |
sav closeRequestFor:(self window). |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1877 |
|
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1878 |
"/ 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
|
1879 |
masterApplication := sav. |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1880 |
] ifFalse:[ |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1881 |
self closeRequest |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
1882 |
] |
138 | 1883 |
! |
1884 |
||
69 | 1885 |
restarted |
287 | 1886 |
"sent by my topWindow, when restarted from an image. |
69 | 1887 |
Nothing done here, but can be redefined to perform any actions |
1888 |
required to reset the application after an image-restart. |
|
1889 |
(for example: check if application files are still around, restart |
|
287 | 1890 |
subprocesses etc.)." |
1891 |
||
1892 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
63 | 1893 |
! |
57 | 1894 |
|
63 | 1895 |
saveAndTerminateRequest |
1896 |
"some windowManagers send this to shut down an application |
|
1897 |
and have it save its state for restart. |
|
1898 |
Can be redefined in subclasses" |
|
1899 |
||
1900 |
self closeRequest |
|
437 | 1901 |
! |
1902 |
||
1903 |
saveAndTerminateRequestFor:aTopView |
|
1904 |
"some windowManagers send this to shut down an application |
|
1905 |
and have it save its state for restart. |
|
1906 |
Can be redefined in subclasses" |
|
1907 |
||
1908 |
self saveAndTerminateRequest |
|
57 | 1909 |
! ! |
72 | 1910 |
|
85 | 1911 |
!ApplicationModel methodsFor:'window events'! |
1912 |
||
983 | 1913 |
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
1914 |
"dispatch dispatch a user-pushed event. |
|
1915 |
This allows for events for an appModel to be pushed into the event queue |
|
1916 |
the same way as events for a view are pushable." |
|
1917 |
||
1918 |
self perform:evType withArguments:evArgs |
|
1919 |
||
1920 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
1921 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
1922 |
! |
|
1923 |
||
967
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1924 |
noticeOfWindowClose:aWindow |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1925 |
"sent when a topView has been closed. |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1926 |
Can be redefined in subclasses for cleanup." |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1927 |
|
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1928 |
^ self |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1929 |
|
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1930 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1931 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1932 |
! |
2ddfe61c3c37
added #noticeOfWindowClose (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
963
diff
changeset
|
1933 |
|
975
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1934 |
requestForWindowClose |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1935 |
"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
|
1936 |
is ok. Return false if not." |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1937 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1938 |
|w k| |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1939 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1940 |
builder notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1941 |
(w := builder window) notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1942 |
(k := w keyboardProcessor) notNil ifTrue:[ |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1943 |
^ k requestForWindowClose |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1944 |
] |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1945 |
] |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1946 |
]. |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1947 |
^ true |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1948 |
|
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1949 |
"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
|
1950 |
"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
|
1951 |
! |
7edaf9f69ef7
must create the builder just before building
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1952 |
|
144 | 1953 |
showActivity:someMessage |
215 | 1954 |
"some activityNotification shalt be communicated to |
1955 |
the user. Forwarded from the topView and ignored here. |
|
1956 |
Can be redefined in concrete applications to show the |
|
1957 |
message either in some infoView (infoLabel as in Windows) |
|
1958 |
or in the title area (as done in the browsers)" |
|
1959 |
||
144 | 1960 |
^ self |
1961 |
||
1962 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
215 | 1963 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
144 | 1964 |
! |
1965 |
||
85 | 1966 |
windowEvent:anEvent from:anApplicationWindow |
215 | 1967 |
"dummy: windowEvent forwarding is not yet implemented" |
1968 |
||
85 | 1969 |
^ self |
215 | 1970 |
|
1971 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
85 | 1972 |
! ! |
1973 |
||
361 | 1974 |
!ApplicationModel class methodsFor:'documentation'! |
72 | 1975 |
|
138 | 1976 |
version |
1109 | 1977 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.101 1999-02-25 23:07:04 cg Exp $' |
81 | 1978 |
! ! |
138 | 1979 |
ApplicationModel initialize! |