author | Stefan Vogel <sv@exept.de> |
Mon, 30 Jun 2008 14:32:58 +0200 | |
changeset 2510 | 491f20d60c08 |
parent 2496 | 133bb0589d18 |
child 2520 | b4cb0d37c0d4 |
permissions | -rw-r--r-- |
1419 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
2396 | 3 |
All Rights Reserved |
1419 | 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 |
"{ Package: 'stx:libview2' }" |
|
13 |
||
14 |
Model subclass:#ApplicationModel |
|
2396 | 15 |
instanceVariableNames:'builder resources device masterApplication' |
16 |
classVariableNames:'DefaultLabels DefaultVisuals' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Framework' |
|
138 | 19 |
! |
20 |
||
1419 | 21 |
ApplicationModel class instanceVariableNames:'ClassResources' |
22 |
||
23 |
" |
|
24 |
No other class instance variables are inherited by this class. |
|
25 |
" |
|
1350 | 26 |
! |
27 |
||
1419 | 28 |
!ApplicationModel class methodsFor:'documentation'! |
29 |
||
1417 | 30 |
copyright |
1419 | 31 |
" |
32 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
2396 | 33 |
All Rights Reserved |
1419 | 34 |
|
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! |
|
43 |
||
44 |
documentation |
|
45 |
" |
|
46 |
Since many ST-80 classes are subclasses of ApplicationModel, this class |
|
47 |
is provided here to allow easier porting of ST-80 code. |
|
48 |
||
49 |
It does not (currently) provide all functionality and is NOT |
|
50 |
compatible to the corresponding ST80 class; therefore, manual |
|
51 |
changes have to be made to get those applications to run under ST/X. |
|
52 |
(but at least, this enables you to fileIn that code and have a superclass |
|
53 |
for them) |
|
54 |
||
55 |
As time goes by, ST/X applications are going to be converted to |
|
56 |
become subclasses of this abstract class - see Launcher for a |
|
57 |
first concrete example. |
|
58 |
||
59 |
||
60 |
ApplicationModel is prepared to build a view from a windowSpec, as |
|
61 |
created by the windowBuilder. If your subclass does not provide such |
|
62 |
a spec, you should at least redefine: |
|
63 |
||
64 |
#openInterface - to create a topview and open it |
|
65 |
||
66 |
you may want to redefine: |
|
67 |
||
68 |
#closeRequest - to catch window closing |
|
69 |
#focusSequence - to define a sequence for focus-stepping |
|
70 |
||
71 |
||
72 |
Once the interfaceBuilder is finished & released, subclasses can |
|
73 |
alternatively provide the spec via a #windowSpec method. |
|
74 |
||
75 |
The classResources have been put into this class to allow ST/X |
|
76 |
applications (which used to be subclasses of StandardSystemView) |
|
77 |
to migrate smoothly into ApplicationModels (which is better design ...). |
|
78 |
||
79 |
||
80 |
[Instance variables:] |
|
81 |
resources ResourcePack language string translation |
|
82 |
||
83 |
builder WindowBuilder a builder who knows how to create |
|
84 |
a window hierarchy from a specification |
|
85 |
||
86 |
||
87 |
Notice: this class was implemented using protocol information |
|
88 |
from alpha testers and PD code - it may not be complete or compatible to |
|
89 |
the corresponding ST-80 class. If you encounter any incompatibilities, |
|
90 |
please forward a note to the ST/X team. |
|
91 |
||
92 |
||
93 |
[author:] |
|
94 |
Claus Gittinger |
|
95 |
||
96 |
[see also:] |
|
97 |
StandardSystemView |
|
98 |
WindowGroup DeviceWorkstation |
|
99 |
" |
|
100 |
! ! |
|
101 |
||
102 |
!ApplicationModel class methodsFor:'initialization'! |
|
103 |
||
104 |
initialize |
|
105 |
self == ApplicationModel ifTrue:[ |
|
106 |
Smalltalk addDependent:self |
|
107 |
]. |
|
108 |
DefaultLabels isNil ifTrue:[ |
|
109 |
DefaultLabels := IdentityDictionary new |
|
110 |
]. |
|
111 |
DefaultVisuals isNil ifTrue:[ |
|
112 |
DefaultVisuals := IdentityDictionary new |
|
113 |
]. |
|
114 |
||
115 |
" |
|
116 |
ApplicationModel initialize |
|
117 |
" |
|
118 |
||
119 |
"Modified: 28.1.1997 / 12:31:38 / cg" |
|
120 |
! ! |
|
121 |
||
122 |
!ApplicationModel class methodsFor:'instance creation'! |
|
123 |
||
124 |
new |
|
125 |
"return a new initialized instance" |
|
126 |
||
1977
abd5df24333e
Make sure to return the new instance in #new (and not the return value
Stefan Vogel <sv@exept.de>
parents:
1972
diff
changeset
|
127 |
^ self basicNew basicInitialize; initialize; yourself. |
1419 | 128 |
! |
129 |
||
130 |
onDevice:aDevice |
|
1828 | 131 |
"return a new initialized instance, which shall open its interface on aDevice." |
132 |
||
133 |
^ (super basicNew basicInitialize setDevice:aDevice) initialize |
|
1419 | 134 |
! ! |
135 |
||
136 |
!ApplicationModel class methodsFor:'accessing'! |
|
137 |
||
138 |
application |
|
139 |
^ self |
|
140 |
||
141 |
! ! |
|
142 |
||
143 |
!ApplicationModel class methodsFor:'active help'! |
|
144 |
||
1538 | 145 |
flyByHelpSpec |
146 |
"default is: no help-spec (should be redefined by concrete class if help is wanted)." |
|
147 |
||
148 |
^ IdentityDictionary new. |
|
149 |
! |
|
150 |
||
1419 | 151 |
helpSpec |
1431 | 152 |
"default is: no help-spec (should be redefined by concrete class if help is wanted)." |
153 |
||
1419 | 154 |
^ IdentityDictionary new. |
155 |
! ! |
|
156 |
||
157 |
!ApplicationModel class methodsFor:'bindings'! |
|
158 |
||
159 |
actionFor:aKey |
|
160 |
"sent by the builder to ask for an actionBlock for |
|
161 |
a Button. The argument, aKey comes from an UI-spec |
|
162 |
for a buttons #action property. |
|
163 |
Here, a corresponding message is sent to myself, |
|
164 |
which ought to be defined in the application subclass. |
|
165 |
Alternatively, a subclass may redefine this method, to provide |
|
166 |
actionBlocks from a Dictionary or whatever. |
|
167 |
Typically, a block is returned there." |
|
168 |
||
169 |
^ nil |
|
170 |
||
171 |
||
172 |
! |
|
173 |
||
174 |
actionFor:aKey withValue:aValue |
|
175 |
"sent by the builder to ask for an actionBlock for |
|
176 |
a Button which passes a value to the actionMethod. |
|
177 |
The argument, aKey comes from an UI-spec |
|
178 |
for a buttons #action property. |
|
179 |
Here, a corresponding message is sent to myself, |
|
180 |
which ought to be defined in the application subclass. |
|
181 |
Alternatively, a subclass may redefine this method, to provide |
|
182 |
actionBlocks from a Dictionary or whatever. |
|
183 |
Typically, a block is returned there." |
|
184 |
||
185 |
^ nil |
|
186 |
||
187 |
||
188 |
! |
|
189 |
||
190 |
aspectFor:aKey |
|
191 |
"sent by the builder to ask for an aspect (a data model). |
|
192 |
The argument, aKey comes from an UI-spec |
|
193 |
for a components #aspect property. |
|
194 |
Here, a corresponding message is sent to myself, |
|
195 |
which ought to be defined in the application subclass. |
|
196 |
Alternatively, a subclass may redefine this method, to provide |
|
197 |
holders from a Dictionary or whatever. |
|
198 |
Typically, a valueHolder is returned there." |
|
199 |
||
200 |
^ self perform:aKey |
|
201 |
||
202 |
"/ ^ nil |
|
203 |
||
204 |
"Modified: / 27.10.1997 / 13:43:12 / cg" |
|
205 |
! |
|
206 |
||
207 |
clientFor:aKey |
|
208 |
"sent by the builder to ask for an application provided |
|
209 |
subcanvas's application. |
|
210 |
The argument, aKey comes from an UI-spec |
|
211 |
for a subcanvas's #client property. |
|
212 |
Here, a corresponding message is sent to myself, |
|
213 |
which ought to be defined in the application subclass. |
|
214 |
Alternatively, a subclass may redefine this method, to provide |
|
215 |
appModels from a Dictionary or whatever. |
|
216 |
Typically, an applicationModel is returned there." |
|
217 |
||
218 |
^ nil |
|
219 |
||
220 |
! |
|
221 |
||
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
222 |
colorFor:aSymbol |
2472 | 223 |
"sent by the builder to ask for an application provided color. |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
224 |
The argument, aKey comes from an UI-spec |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
225 |
for a widgets #*Color property. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
226 |
Here, a corresponding message is sent to myself, |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
227 |
which ought to be defined in the application subclass. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
228 |
Alternatively, a subclass may redefine this method, to provide |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
229 |
holders from a Dictionary or whatever. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
230 |
Typically, a color is returned there." |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
231 |
|
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
232 |
(self respondsTo:aSymbol) ifTrue:[ |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
233 |
^ self perform:aSymbol. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
234 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
235 |
|
2481
1fc2941fe30e
#colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents:
2472
diff
changeset
|
236 |
"fall back to a possibly well defined color name" |
1fc2941fe30e
#colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents:
2472
diff
changeset
|
237 |
^ Color name:aSymbol ifIllegal:nil. |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
238 |
! |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
239 |
|
1419 | 240 |
componentFor:aKey |
241 |
"sent by the builder to ask for an application provided |
|
242 |
component. |
|
243 |
The argument, aKey comes from an UI-spec |
|
244 |
for a viewHolders #view 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 |
holders from a Dictionary or whatever. |
|
249 |
Typically, a view is returned there." |
|
250 |
||
251 |
(self respondsTo:aKey) ifTrue:[ |
|
252 |
^ self perform:aKey |
|
253 |
]. |
|
254 |
^ nil |
|
255 |
! |
|
256 |
||
2472 | 257 |
fontFor:aSymbol |
258 |
"sent by the builder to ask for an application provided font. |
|
259 |
The argument, aKey comes from an UI-spec |
|
260 |
for a widgets #*Font property. |
|
261 |
Here, a corresponding message is sent to myself, |
|
262 |
which ought to be defined in the application subclass. |
|
263 |
Alternatively, a subclass may redefine this method, to provide |
|
264 |
holders from a Dictionary or whatever. |
|
265 |
Typically, a font is returned there." |
|
266 |
||
267 |
(self respondsTo:aSymbol) ifTrue:[ |
|
268 |
^ self perform:aSymbol. |
|
269 |
]. |
|
270 |
||
271 |
"/ "fall back to a well defined font name" |
|
272 |
"/ (Font respondsTo:aSymbol) ifTrue:[ |
|
273 |
"/ ^ Font perform:aSymbol. |
|
274 |
"/ ]. |
|
275 |
^ nil |
|
276 |
! |
|
277 |
||
1419 | 278 |
labelFor:aKey |
279 |
"sent by the builder to ask for an application provided |
|
280 |
label for a component. |
|
281 |
The argument, aKey comes from an UI-spec |
|
282 |
for a components #label property. |
|
283 |
Here, a corresponding message is sent to myself, |
|
284 |
which ought to be defined in the application subclass. |
|
285 |
Alternatively, a subclass may redefine this method, to provide |
|
286 |
labels from a Dictionary or whatever. |
|
287 |
Typically, a string is returned there." |
|
288 |
||
2058 | 289 |
|app| |
290 |
||
291 |
app := self application. |
|
292 |
app isNil ifTrue:[^ nil]. |
|
293 |
(app respondsTo:aKey) ifTrue:[ |
|
294 |
^ app perform:aKey |
|
1419 | 295 |
]. |
2058 | 296 |
^ app labelAt:aKey ifAbsent:nil |
1419 | 297 |
! |
298 |
||
299 |
listFor:aKey |
|
300 |
"sent by the builder to ask for an application provided |
|
301 |
holder for a list. |
|
302 |
The argument, aKey comes from an UI-spec |
|
303 |
for a listWidgets #list property. |
|
304 |
Here, a corresponding message is sent to myself, |
|
305 |
which ought to be defined in the application subclass. |
|
306 |
Alternatively, a subclass may redefine this method, to provide |
|
307 |
holders from a Dictionary or whatever. |
|
308 |
Typically, a list-holding model (SelectionInList) is returned there." |
|
309 |
||
310 |
|app| |
|
311 |
||
2058 | 312 |
app := self application. |
313 |
app notNil ifTrue:[ |
|
1419 | 314 |
(app respondsTo:aKey) ifTrue:[ |
315 |
^ app perform:aKey |
|
316 |
] |
|
317 |
]. |
|
318 |
^ nil. |
|
319 |
||
320 |
"Modified: 4.3.1997 / 00:53:03 / cg" |
|
321 |
! |
|
322 |
||
323 |
menuFor:aKey |
|
324 |
"sent by the builder to ask for an application provided |
|
325 |
holder for a menu. |
|
326 |
The argument, aKey comes from an UI-spec |
|
327 |
for a widgets #menu property. |
|
328 |
Here, a corresponding message is sent to myself, |
|
329 |
which ought to be defined in the application subclass. |
|
330 |
Alternatively, a subclass may redefine this method, to provide |
|
331 |
holders from a Dictionary or whatever. |
|
332 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
333 |
||
334 |
^ self application perform:aKey |
|
335 |
||
336 |
! |
|
337 |
||
338 |
specificationFor:aKey |
|
339 |
"sent by the builder to ask for an application provided |
|
340 |
specification for a subcanvas or subspecification. |
|
341 |
The argument, aKey comes from an UI-spec |
|
342 |
for a subcanvases #specification property (minorKey). |
|
343 |
Here, a corresponding message is sent to myself, |
|
344 |
which ought to be defined in the application subclass. |
|
345 |
Alternatively, a subclass may redefine this method, to provide |
|
346 |
interfaceSpecifications from a Dictionary or whatever. |
|
347 |
Typically, an interfaceSpecification is returned there." |
|
348 |
||
1584 | 349 |
^ self |
350 |
specificationFor:aKey |
|
351 |
application:self |
|
352 |
onDevice:nil |
|
353 |
! |
|
354 |
||
355 |
specificationFor:aKey application:app onDevice:deviceOrNil |
|
356 |
"sent by the builder to ask for an application provided |
|
357 |
specification for a subcanvas or subspecification. |
|
358 |
The argument, aKey comes from an UI-spec |
|
359 |
for a subcanvases #specification property (minorKey). |
|
360 |
Here, a corresponding message is sent to myself, |
|
361 |
which ought to be defined in the application subclass. |
|
362 |
Alternatively, a subclass may redefine this method, to provide |
|
363 |
interfaceSpecifications from a Dictionary or whatever. |
|
364 |
Typically, an interfaceSpecification is returned there." |
|
365 |
||
366 |
|displayDevice displayDeviceType modifiedKey appClass| |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
367 |
|
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
368 |
"/ this code is so ugly... |
1584 | 369 |
"/ translate the specs name, if the display device type is different |
370 |
"/ for example, if the type is pda, the xxxSpec_pda spec will be used. |
|
371 |
displayDevice := deviceOrNil ? Screen current ? Screen default. |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
372 |
displayDevice notNil ifTrue:[ |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
373 |
displayDeviceType := displayDevice deviceType. |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
374 |
displayDeviceType notNil ifTrue:[ |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
375 |
modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned. |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
376 |
modifiedKey notNil ifTrue:[ |
1584 | 377 |
(app respondsTo:modifiedKey) ifTrue:[ |
378 |
^ app perform:modifiedKey |
|
379 |
]. |
|
380 |
app isBehavior ifFalse:[ |
|
381 |
appClass := app application. |
|
382 |
(appClass respondsTo:modifiedKey) ifTrue:[ |
|
383 |
^ appClass perform:modifiedKey |
|
384 |
]. |
|
385 |
]. |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
386 |
] |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
387 |
] |
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
388 |
]. |
1584 | 389 |
|
390 |
app isBehavior ifFalse:[ |
|
391 |
(app respondsTo:aKey) ifTrue:[ |
|
392 |
^ app perform:aKey |
|
393 |
]. |
|
394 |
appClass := app application. |
|
395 |
(appClass respondsTo:aKey) ifTrue:[ |
|
396 |
^ appClass perform:aKey |
|
397 |
]. |
|
398 |
^ app masterApplication specificationFor:aKey |
|
399 |
]. |
|
400 |
||
401 |
^ app perform:aKey |
|
1115 | 402 |
! |
403 |
||
2058 | 404 |
subApplicationFor:aKey |
405 |
"sent by subCanvas to ask for an application inside itself. |
|
406 |
The argument, aKey comes from a TabList-specs majorKey. |
|
407 |
Here, a corresponding message is sent to myself, |
|
408 |
which ought to be defined in the application subclass. |
|
409 |
Alternatively, a subclass may redefine this method, to provide |
|
410 |
an application from a Dictionary or whatever. |
|
411 |
Typically, an ApplicationModel subinstance is returned there." |
|
412 |
||
413 |
|app| |
|
414 |
||
415 |
app := self application. |
|
416 |
(app respondsTo:aKey) ifTrue:[ |
|
417 |
^ app perform:aKey |
|
418 |
]. |
|
419 |
^ nil |
|
420 |
! |
|
421 |
||
1419 | 422 |
visualFor:aKey |
423 |
"sent by the builder to ask for an application provided |
|
424 |
image or element for a label. |
|
425 |
The argument, aKey comes from an UI-spec |
|
426 |
for a widgets #label property, if LabelIsImage is turned on. |
|
427 |
Here, a corresponding message is sent to myself, |
|
428 |
which ought to be defined in the application subclass. |
|
429 |
Alternatively, a subclass may redefine this method, to provide |
|
430 |
images from a Dictionary or whatever. |
|
431 |
Typically, an image is returned there." |
|
432 |
||
1781 | 433 |
|app| |
434 |
||
435 |
app := self application. |
|
436 |
(app respondsTo:aKey) ifTrue:[ |
|
437 |
^ app perform:aKey |
|
1419 | 438 |
]. |
1781 | 439 |
^ app visualAt:aKey ifAbsent:nil |
1419 | 440 |
! ! |
441 |
||
442 |
!ApplicationModel class methodsFor:'change & update'! |
|
443 |
||
444 |
update:something with:aParameter from:changedObject |
|
445 |
"flush resources on language changes" |
|
446 |
||
447 |
something == #Language ifTrue:[ |
|
448 |
self flushAllClassResources |
|
449 |
] |
|
450 |
||
451 |
"Created: 15.6.1996 / 15:13:29 / cg" |
|
452 |
! ! |
|
453 |
||
454 |
!ApplicationModel class methodsFor:'defaults'! |
|
455 |
||
456 |
defaultIcon |
|
1431 | 457 |
"default is: no icon (should be redefined by concrete class if an icon is wanted)." |
458 |
||
1419 | 459 |
^ nil |
460 |
! |
|
461 |
||
2496
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
462 |
defaultIconForAboutBox |
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
463 |
^ self defaultIcon |
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
464 |
! |
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
465 |
|
1419 | 466 |
labelAt:aKey |
1431 | 467 |
"default is: no label (could be redefined by concrete class )." |
468 |
||
1419 | 469 |
^ nil |
470 |
! |
|
471 |
||
472 |
labelAt:aKey ifAbsent:aBlock |
|
1431 | 473 |
"default is: no label (could be redefined by concrete class )." |
474 |
||
1419 | 475 |
^ aBlock value |
476 |
! |
|
477 |
||
478 |
labelAt:aKey put:aValue |
|
479 |
"/ not yet implemented |
|
480 |
! |
|
481 |
||
482 |
labels |
|
483 |
"/ not yet implemented |
|
484 |
^ nil |
|
485 |
! |
|
486 |
||
487 |
visualAt:aKey |
|
1431 | 488 |
"default is: no visual (could be redefined by concrete class )." |
489 |
||
1419 | 490 |
^ nil |
491 |
! |
|
492 |
||
493 |
visualAt:aKey ifAbsent:aBlock |
|
1431 | 494 |
"default is: no visual (could be redefined by concrete class )." |
495 |
||
1419 | 496 |
^ aBlock value |
497 |
! |
|
498 |
||
499 |
visualAt:aKey put:aValue |
|
500 |
"/ not yet implemented |
|
501 |
! |
|
502 |
||
503 |
visuals |
|
504 |
"/ not yet implemented |
|
505 |
^ nil |
|
506 |
! ! |
|
507 |
||
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
508 |
!ApplicationModel class methodsFor:'help'! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
509 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
510 |
aboutImage |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
511 |
"bitmap image or nil for an about box for this application." |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
512 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
513 |
^ self defaultIcon |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
514 |
! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
515 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
516 |
aboutThisApplicationLabel |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
517 |
"label for an about box for this application." |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
518 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
519 |
^ 'About This Application' |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
520 |
! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
521 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
522 |
aboutThisApplicationText |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
523 |
"text for an about box for this application." |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
524 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
525 |
|rev clsRev msg| |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
526 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
527 |
rev := ''. |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
528 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
529 |
(clsRev := self revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
530 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
531 |
msg := '\' withCRs , self name asBoldText, rev. |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
532 |
^ msg |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
533 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
534 |
"Created: / 13.11.2001 / 12:28:36 / cg" |
2382 | 535 |
! |
536 |
||
537 |
documentationPath |
|
538 |
|packageDir| |
|
539 |
||
540 |
packageDir := Smalltalk getPackageDirectoryForPackage:(self package). |
|
541 |
packageDir isNil ifTrue:[ |
|
542 |
packageDir := Filename defaultDirectory |
|
543 |
]. |
|
544 |
#( |
|
545 |
'documentation' |
|
546 |
'doc' |
|
547 |
) do:[:subDir | |
|
548 |
(packageDir construct:subDir) exists ifTrue:[ |
|
549 |
^ packageDir construct:subDir |
|
550 |
]. |
|
551 |
]. |
|
552 |
^ packageDir construct:'doc' |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
553 |
! ! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
554 |
|
1997 | 555 |
!ApplicationModel class methodsFor:'private'! |
556 |
||
557 |
selfResponsibleFor:aKey |
|
558 |
^ self respondsTo:aKey |
|
559 |
! ! |
|
560 |
||
1419 | 561 |
!ApplicationModel class methodsFor:'queries'! |
562 |
||
563 |
interfaceSpecFor:aSelector |
|
564 |
"return an interface spec" |
|
2287
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
565 |
|
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
566 |
|spec| |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
567 |
|
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
568 |
spec := self application specificationFor:aSelector. |
2355 | 569 |
spec isNil ifTrue:[^ nil]. |
2287
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
570 |
spec class missingClassInLiteralArrayErrorSignal |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
571 |
handle:[:ex | |
2295
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
572 |
|clsInMyNamespace className| |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
573 |
|
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
574 |
className := ex parameter. |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
575 |
className isSymbol ifTrue:[ |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
576 |
"retry with my nameSpace" |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
577 |
clsInMyNamespace := self nameSpace at:className. |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
578 |
clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace]. |
c303807aa17e
Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents:
2289
diff
changeset
|
579 |
]. |
2287
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
580 |
self warn:ex description. |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
581 |
ex proceedWith:nil |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
582 |
] |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
583 |
do:[ |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
584 |
^ UISpecification from:(self application specificationFor:aSelector) |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
585 |
] |
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
586 |
|
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
587 |
"Modified: / 26-02-2007 / 18:30:25 / cg" |
1419 | 588 |
! |
589 |
||
590 |
isVisualStartable |
|
1427 | 591 |
"return true, if this application can be started via #open. |
592 |
(to allow start of a change browser via double-click in the browser)" |
|
1419 | 593 |
|
594 |
(self == ApplicationModel) ifTrue:[^ false "I am abstract"]. |
|
1556
388922a9c6eb
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
1548
diff
changeset
|
595 |
((self respondsTo:#open) or:[self class includesSelector:#openInterface]) ifFalse:[^ false]. |
1419 | 596 |
"/ (self respondsTo:#windowSpec) ifFalse:[^ false]. |
597 |
^ true |
|
598 |
||
599 |
"Created: / 27.10.1997 / 16:38:02 / cg" |
|
600 |
"Modified: / 14.3.1998 / 16:30:50 / cg" |
|
601 |
! ! |
|
602 |
||
603 |
!ApplicationModel class methodsFor:'resources'! |
|
604 |
||
605 |
classResources |
|
1955
257a4acb852b
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
606 |
"if not already loaded, get the classes resourcePack and return it" |
1419 | 607 |
|
608 |
ClassResources isNil ifTrue:[ |
|
1955
257a4acb852b
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
609 |
ClassResources := super classResources. |
1419 | 610 |
]. |
611 |
^ ClassResources |
|
612 |
! |
|
613 |
||
614 |
classResources:aResourcePack |
|
615 |
"allow setting of the classResources" |
|
616 |
||
617 |
ClassResources := aResourcePack |
|
618 |
! |
|
619 |
||
620 |
flushAllClassResources |
|
621 |
"flush all classes resource translations. |
|
622 |
Needed after a resource file / language setting has changed." |
|
623 |
||
624 |
ResourcePack flushCachedResourcePacks. |
|
625 |
self flushClassResources. |
|
626 |
self allSubclassesDo:[:aClass | |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
627 |
aClass flushClassResources. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
628 |
]. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
629 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
630 |
WindowGroup scheduledWindowGroups |
2445 | 631 |
do:[:wg | |
632 |
|app| |
|
633 |
||
634 |
(app := wg application) notNil ifTrue:[ |
|
635 |
app initializeResources |
|
636 |
] |
|
637 |
] |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
638 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
639 |
"Modified: / 13-09-2006 / 12:41:31 / cg" |
1419 | 640 |
! |
641 |
||
642 |
flushClassResources |
|
643 |
"flush classes resource string translations. |
|
644 |
Needed whenever a resource file / language setting has changed" |
|
645 |
||
646 |
ClassResources := nil. |
|
647 |
! |
|
648 |
||
649 |
resources |
|
650 |
"return the applications resources - thats a ResourcePack containing |
|
651 |
language strings" |
|
652 |
||
653 |
^ self classResources |
|
654 |
||
655 |
"Created: / 19.5.1998 / 20:14:00 / cg" |
|
656 |
! |
|
657 |
||
658 |
updateClassResources |
|
659 |
"update my classResources" |
|
660 |
||
661 |
ClassResources := nil. |
|
662 |
self classResources |
|
663 |
! ! |
|
664 |
||
665 |
!ApplicationModel class methodsFor:'startup'! |
|
666 |
||
667 |
open |
|
668 |
"create an instance of the application and open its view" |
|
669 |
||
670 |
^ self new open |
|
671 |
||
672 |
" |
|
673 |
Launcher open |
|
674 |
" |
|
675 |
||
676 |
"Modified: 13.1.1997 / 20:54:50 / cg" |
|
677 |
! |
|
678 |
||
679 |
openAt:aLocation |
|
680 |
"create an instance of the application and open its view |
|
681 |
at some position." |
|
682 |
||
683 |
^ self new openAt:aLocation |
|
684 |
||
685 |
"Modified: 14.2.1997 / 20:28:41 / cg" |
|
686 |
! |
|
687 |
||
688 |
openDialogInterface:anInterfaceSymbol |
|
689 |
"create an instance of the application and open a view as |
|
690 |
specified by anInterfaceSymbol." |
|
691 |
||
692 |
^ self openDialogInterface:anInterfaceSymbol withBindings:nil |
|
693 |
||
694 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
695 |
"Created: 14.2.1997 / 20:33:10 / cg" |
|
696 |
"Modified: 28.2.1997 / 14:07:36 / cg" |
|
697 |
! |
|
698 |
||
699 |
openDialogInterface:anInterfaceSymbol withBindings:bindings |
|
700 |
"create an instance of the application and open a view as |
|
701 |
specified by anInterfaceSymbol." |
|
702 |
||
703 |
^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings |
|
704 |
||
705 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
706 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
707 |
"Created: 28.2.1997 / 14:07:24 / cg" |
|
708 |
! |
|
709 |
||
710 |
openDialogInterfaceSpec:anInterfaceSpec |
|
711 |
"create an instance of the application and open a view as |
|
712 |
specified by the given spec." |
|
713 |
||
714 |
^ self new |
|
715 |
openDialogInterfaceSpec:anInterfaceSpec |
|
716 |
withBindings:nil |
|
717 |
! |
|
718 |
||
719 |
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings |
|
720 |
"create an instance of the application and open a view as |
|
721 |
specified by the given spec." |
|
722 |
||
723 |
^ self new |
|
724 |
openDialogInterfaceSpec:anInterfaceSpec |
|
725 |
withBindings:bindings |
|
726 |
||
727 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
728 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
729 |
"Created: 28.2.1997 / 14:07:24 / cg" |
|
730 |
! |
|
731 |
||
732 |
openDialogSpec:aSpec |
|
733 |
"create an instance of the application and open a view as |
|
734 |
specified by aSpec." |
|
735 |
||
736 |
^ self openDialogSpec:aSpec withBindings:nil |
|
737 |
||
738 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
|
739 |
"Modified: / 28.2.1997 / 14:07:36 / cg" |
|
740 |
"Created: / 20.5.1998 / 20:27:08 / cg" |
|
741 |
! |
|
742 |
||
743 |
openDialogSpec:aSpec withBindings:bindings |
|
744 |
"create an instance of the application and open a view as |
|
745 |
specified by the spec." |
|
746 |
||
2071 | 747 |
^ self new |
748 |
openDialogSpec:aSpec |
|
749 |
withBindings:bindings |
|
1419 | 750 |
|
751 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
|
752 |
"Modified: / 13.1.1997 / 20:55:02 / cg" |
|
753 |
"Created: / 20.5.1998 / 20:26:37 / cg" |
|
754 |
! |
|
755 |
||
756 |
openInterface:anInterfaceSymbol |
|
757 |
"create an instance of the application and open a view as |
|
758 |
specified by anInterfaceSymbol." |
|
759 |
||
760 |
^ self new openInterface:anInterfaceSymbol |
|
761 |
||
762 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
763 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
764 |
! |
|
765 |
||
766 |
openInterface:anInterfaceSymbol at:aPoint |
|
767 |
"create an instance of the application and open a view as |
|
768 |
specified by anInterfaceSymbol." |
|
769 |
||
770 |
^ self new openInterface:anInterfaceSymbol at:aPoint |
|
771 |
||
772 |
"Modified: 14.2.1997 / 20:28:47 / cg" |
|
773 |
! |
|
774 |
||
775 |
openModal |
|
776 |
"create an instance of the application and open its view modal" |
|
777 |
||
778 |
^ self new openModal |
|
779 |
! |
|
780 |
||
781 |
openOn:anApplicationModel |
|
782 |
"send an open message to the argument, anApplicationModel. |
|
783 |
I dont really understand what this method is useful for ..." |
|
784 |
||
785 |
^ anApplicationModel open |
|
786 |
||
787 |
"Modified: 13.1.1997 / 20:55:05 / cg" |
|
788 |
! |
|
789 |
||
790 |
openOnDevice:aDevice |
|
791 |
"create an instance of the application and open its view |
|
792 |
on ANOTHER device. |
|
793 |
For more info, read the document on multiple display |
|
794 |
support and the documentation of the DeviceWorkstation class." |
|
795 |
||
2071 | 796 |
Screen currentScreenQuerySignal |
797 |
answer:aDevice |
|
798 |
do:[ |
|
799 |
^ (self onDevice:aDevice) open |
|
800 |
] |
|
1419 | 801 |
|
802 |
" |
|
803 |
Launcher openOnDevice:Display |
|
804 |
" |
|
805 |
||
806 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
807 |
! |
|
808 |
||
809 |
openOnXScreenNamed:aScreenName |
|
810 |
"create an instance of the application and open its view |
|
811 |
on some X display screen. The argument aScreenName must be |
|
812 |
a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0'). |
|
813 |
For more info, read the document on multiple display |
|
814 |
support and the documentation of the DeviceWorkstation class." |
|
815 |
||
1570
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
816 |
|newDevice| |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
817 |
|
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
818 |
[ |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
819 |
newDevice := XWorkstation newDispatchingFor:aScreenName. |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
820 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
821 |
self warn:'Could not open display: ' , aScreenName. |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
822 |
^ self |
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
823 |
]. |
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
824 |
^ self openOnDevice:newDevice. |
1419 | 825 |
|
826 |
" |
|
827 |
Launcher openOnXScreenNamed:'sgi:0' |
|
828 |
Launcher openOnXScreenNamed:'foo:0' |
|
829 |
NewLauncher openOnXScreenNamed:'dawn:0' |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
830 |
NewLauncher openOnXScreenNamed:'bitsy:0' |
1419 | 831 |
SystemBrowser openOnXScreenNamed:'dawn:0' |
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
832 |
SystemBrowser openOnXScreenNamed:'bitsy:0' |
1419 | 833 |
" |
834 |
||
835 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
836 |
! |
|
837 |
||
838 |
openWithSpec:aSpecSymbol |
|
839 |
"ST80 compatibility: |
|
840 |
mhmh - what is the difference to #openInterface ?" |
|
841 |
||
842 |
^ self openInterface:aSpecSymbol |
|
843 |
||
844 |
"Modified: 29.8.1997 / 01:16:52 / cg" |
|
845 |
! ! |
|
846 |
||
847 |
!ApplicationModel methodsFor:'accessing'! |
|
848 |
||
849 |
application |
|
850 |
"application knows about interfaceSpecs, menuSpecs etc. |
|
851 |
Usually this is my class. |
|
852 |
This may be redefined in subclasses" |
|
853 |
||
854 |
^ self class |
|
855 |
||
856 |
"Modified: / 5.2.1998 / 00:45:21 / stefan" |
|
857 |
! |
|
858 |
||
859 |
builder |
|
860 |
"return the applications builder; this one has more information |
|
861 |
about views, components etc." |
|
862 |
||
863 |
^ builder |
|
864 |
! |
|
865 |
||
866 |
builder:aBuilder |
|
867 |
"set the applications builder. Normally, you should not set it |
|
868 |
directly, but depend on the default builder, as created when the application |
|
869 |
was created." |
|
870 |
||
871 |
builder := aBuilder |
|
872 |
! |
|
873 |
||
1602 | 874 |
componentAt:name |
875 |
^ self builder componentAt:name |
|
876 |
! |
|
877 |
||
1419 | 878 |
masterApplication |
879 |
"return the value of the instance variable 'masterApplication' (automatically generated)" |
|
880 |
||
1427 | 881 |
^ masterApplication |
882 |
! |
|
1419 | 883 |
|
884 |
masterApplication:something |
|
885 |
"set the value of the instance variable 'masterApplication' (automatically generated)" |
|
886 |
||
887 |
something == self ifTrue:[ |
|
888 |
self error:'an application cannot be its own masterApplication' mayProceed:true. |
|
889 |
^ self |
|
890 |
]. |
|
891 |
masterApplication := something. |
|
892 |
! |
|
893 |
||
894 |
resources |
|
895 |
"return the applications resources - thats a ResourcePack containing |
|
1988
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
896 |
national language strings" |
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
897 |
|
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
898 |
resources isNil ifTrue:[ |
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
899 |
masterApplication notNil ifTrue:[ |
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
900 |
^ masterApplication resources |
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
901 |
] |
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
902 |
]. |
1419 | 903 |
^ resources |
904 |
! |
|
905 |
||
906 |
resources:aResourcePack |
|
1988
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
907 |
"set the applications resources - usually this is done automatically, |
1419 | 908 |
except for manually built dialogs" |
909 |
||
910 |
resources := aResourcePack |
|
911 |
! |
|
912 |
||
913 |
window |
|
914 |
"return my topWindow - or nil, if I have no window (yet)" |
|
915 |
||
916 |
|win| |
|
917 |
||
918 |
builder isNil ifTrue:[^ nil]. |
|
919 |
(win := builder window) notNil ifTrue:[ |
|
920 |
^ win |
|
921 |
]. |
|
922 |
masterApplication notNil ifTrue:[ |
|
1442
96d3aff662c3
check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
923 |
masterApplication ~~ self ifTrue:[ |
96d3aff662c3
check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
924 |
"/ is that true ? |
96d3aff662c3
check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
925 |
^ masterApplication window |
96d3aff662c3
check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
926 |
] |
1419 | 927 |
]. |
928 |
^ nil. |
|
929 |
||
930 |
"Modified: / 18.9.1998 / 15:18:19 / cg" |
|
931 |
! |
|
932 |
||
933 |
window:aTopView |
|
934 |
"set my topWindow. |
|
935 |
As a side effect, this creates a dummy builder if non has yet |
|
936 |
been built. This prevents non-GUI-Painter apps from failing later, |
|
937 |
when the builder is accessed." |
|
938 |
||
939 |
builder isNil ifTrue:[ |
|
940 |
self createBuilder |
|
941 |
]. |
|
942 |
builder window:aTopView |
|
943 |
||
944 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
945 |
! |
|
946 |
||
947 |
windowGroup |
|
948 |
"return the applications windowGroup" |
|
949 |
||
950 |
|w| |
|
951 |
||
952 |
builder notNil ifTrue:[ |
|
953 |
(w := builder window) notNil ifTrue:[ |
|
954 |
^ w windowGroup |
|
955 |
]. |
|
956 |
]. |
|
957 |
masterApplication notNil ifTrue:[ |
|
958 |
^ masterApplication windowGroup |
|
959 |
]. |
|
960 |
^ nil |
|
961 |
||
962 |
"Modified: / 7.9.1998 / 23:37:00 / cg" |
|
963 |
! ! |
|
964 |
||
965 |
!ApplicationModel methodsFor:'binding access'! |
|
966 |
||
967 |
actionFor:aKey |
|
968 |
"sent by the builder to ask for an actionBlock for |
|
969 |
a Button. The argument, aKey comes from an UI-spec |
|
970 |
for a buttons #action property. |
|
971 |
Here, a corresponding message is sent to myself, |
|
972 |
which ought to be defined in the application subclass. |
|
973 |
Alternatively, a subclass may redefine this method, to provide |
|
974 |
actionBlocks from a Dictionary or whatever. |
|
975 |
Typically, a block is returned there." |
|
976 |
||
977 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
978 |
^ [self perform:aKey] "/ could use: MessageSend receiver:self selector:aKey |
|
979 |
]. |
|
980 |
^ masterApplication actionFor:aKey |
|
981 |
||
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
982 |
"Modified: / 28.10.1997 / 20:34:51 / cg" |
1419 | 983 |
! |
984 |
||
985 |
actionFor:aKey withValue:aValue |
|
986 |
"sent by the builder to ask for an actionBlock for |
|
987 |
a Button which passes a value. |
|
988 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
|
989 |
Here, a corresponding message is sent to myself, |
|
990 |
which ought to be defined in the application subclass. |
|
991 |
Alternatively, a subclass may redefine this method, to provide |
|
992 |
actionBlocks from a Dictionary or whatever. |
|
993 |
Typically, a block is returned there." |
|
994 |
||
995 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
996 |
^ [self perform:aKey with:aValue] |
|
997 |
]. |
|
998 |
^ masterApplication actionFor:aKey withValue:aValue |
|
999 |
! |
|
1000 |
||
2364 | 1001 |
actionFor:aKey withValue:value1 withValue:value2 |
1002 |
"sent by the builder to ask for an actionBlock for a Button which passes two values. |
|
1003 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
|
1004 |
Here, a corresponding message is sent to myself, |
|
1005 |
which ought to be defined in the application subclass. |
|
1006 |
Alternatively, a subclass may redefine this method, to provide |
|
1007 |
actionBlocks from a Dictionary or whatever. |
|
1008 |
Typically, a block is returned there." |
|
1009 |
||
1010 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1011 |
^ [self perform:aKey with:value1 with:value2] |
|
1012 |
]. |
|
1013 |
^ masterApplication actionFor:aKey withValue:value1 withValue:value2 |
|
1014 |
! |
|
1015 |
||
1419 | 1016 |
aspectFor:aKey |
1017 |
"sent by the builder to ask for an aspect (a data model). |
|
1018 |
The argument, aKey comes from an UI-spec |
|
1019 |
for a components #aspect property. |
|
1020 |
Here, a corresponding message is sent to myself, |
|
1021 |
which ought to be defined in the application subclass. |
|
1022 |
Alternatively, a subclass may redefine this method, to provide |
|
1023 |
holders from a Dictionary or whatever. |
|
1024 |
Typically, a valueHolder is returned there." |
|
1025 |
||
1026 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1027 |
^ self perform:aKey |
|
1028 |
]. |
|
1029 |
^ masterApplication aspectFor:aKey |
|
1030 |
||
1031 |
"Modified: / 18.6.1998 / 20:33:23 / cg" |
|
1032 |
! |
|
1033 |
||
1742
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1034 |
aspectOrNil:aKey forSubApplication:aSubApp |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1035 |
^ nil |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1036 |
! |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1037 |
|
1419 | 1038 |
clientFor:aKey |
1039 |
"sent by the builder to ask for an application provided |
|
1040 |
subcanvas's application. |
|
1041 |
The argument, aKey comes from an UI-spec |
|
1042 |
for a subcanvas's #client property. |
|
1043 |
Here, a corresponding message is sent to myself, |
|
1044 |
which ought to be defined in the application subclass. |
|
1045 |
Alternatively, a subclass may redefine this method, to provide |
|
1046 |
appModels from a Dictionary or whatever. |
|
1047 |
Typically, an applicationModel is returned there." |
|
1048 |
||
1049 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1050 |
^ self perform:aKey |
|
1051 |
]. |
|
1052 |
^ masterApplication clientFor:aKey |
|
1053 |
||
1054 |
"Modified: / 18.6.1998 / 20:33:30 / cg" |
|
1055 |
! |
|
1056 |
||
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1057 |
colorFor:aKey |
2472 | 1058 |
"sent by the builder to ask for an application provided color. |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1059 |
The argument, aKey comes from an UI-spec |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1060 |
for a widgets #*Color property. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1061 |
Here, a corresponding message is sent to myself, |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1062 |
which ought to be defined in the application subclass. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1063 |
Alternatively, a subclass may redefine this method, to provide |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1064 |
holders from a Dictionary or whatever. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1065 |
Typically, a color is returned there." |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1066 |
|
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1067 |
(self respondsTo:aKey) ifTrue:[ |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1068 |
^ self perform:aKey |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1069 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1070 |
(self class respondsTo:aKey) ifTrue:[ |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1071 |
^ self class perform:aKey |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1072 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1073 |
masterApplication notNil ifTrue:[ |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1074 |
^ masterApplication colorFor:aKey |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1075 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1076 |
^ self class colorFor:aKey. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1077 |
! |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1078 |
|
1419 | 1079 |
componentFor:aKey |
1080 |
"sent by the builder to ask for an application provided |
|
1081 |
component. |
|
1082 |
The argument, aKey comes from an UI-spec |
|
1083 |
for a viewHolders #view property. |
|
1084 |
Here, a corresponding message is sent to myself, |
|
1085 |
which ought to be defined in the application subclass. |
|
1086 |
Alternatively, a subclass may redefine this method, to provide |
|
1087 |
holders from a Dictionary or whatever. |
|
1088 |
Typically, a view is returned there." |
|
1089 |
||
1090 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1091 |
^ self perform:aKey |
|
1092 |
]. |
|
1093 |
^ masterApplication componentFor:aKey |
|
1094 |
||
1095 |
"Modified: / 18.6.1998 / 20:33:36 / cg" |
|
1096 |
! |
|
1097 |
||
2472 | 1098 |
fontFor:aKey |
1099 |
"sent by the builder to ask for an application provided font. |
|
1100 |
The argument, aKey comes from an UI-spec |
|
1101 |
for a widgets #*Font property. |
|
1102 |
Here, a corresponding message is sent to myself, |
|
1103 |
which ought to be defined in the application subclass. |
|
1104 |
Alternatively, a subclass may redefine this method, to provide |
|
1105 |
holders from a Dictionary or whatever. |
|
1106 |
Typically, a font is returned there." |
|
1107 |
||
1108 |
(self respondsTo:aKey) ifTrue:[ |
|
1109 |
^ self perform:aKey |
|
1110 |
]. |
|
1111 |
(self class respondsTo:aKey) ifTrue:[ |
|
1112 |
^ self class perform:aKey |
|
1113 |
]. |
|
1114 |
masterApplication notNil ifTrue:[ |
|
1115 |
^ masterApplication fontFor:aKey |
|
1116 |
]. |
|
1117 |
^ self class fontFor:aKey. |
|
1118 |
! |
|
1119 |
||
1419 | 1120 |
labelFor:aKey |
1121 |
"sent by the builder to ask for an application provided |
|
1122 |
label for a component. |
|
1123 |
The argument, aKey comes from an UI-spec |
|
1124 |
for a components #label property. |
|
1125 |
Here, a corresponding message is sent to myself, |
|
1126 |
which ought to be defined in the application subclass. |
|
1127 |
Alternatively, a subclass may redefine this method, to provide |
|
1128 |
labels from a Dictionary or whatever. |
|
1129 |
Typically, a string is returned there." |
|
1130 |
||
1131 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1132 |
^ self perform:aKey |
|
1133 |
]. |
|
1997 | 1134 |
(self class selfResponsibleFor:aKey) ifTrue:[ |
1135 |
^ self class perform:aKey |
|
1136 |
]. |
|
1419 | 1137 |
^ masterApplication labelFor:aKey |
1138 |
||
1139 |
"Modified: / 18.6.1998 / 20:33:42 / cg" |
|
1140 |
! |
|
1141 |
||
1142 |
listFor:aKey |
|
1143 |
"sent by the builder to ask for an application provided |
|
1144 |
holder for a list (for example, a popUpLists list). |
|
1145 |
The argument, aKey comes from an UI-spec |
|
1146 |
for a listWidgets #list property. |
|
1147 |
Here, a corresponding message is sent to myself, |
|
1148 |
which ought to be defined in the application subclass. |
|
1149 |
Alternatively, a subclass may redefine this method, to provide |
|
1150 |
holders from a Dictionary or whatever. |
|
1151 |
Typically, a list-holding model (SelectionInList) is returned there. |
|
1152 |
If the instance does not provide a value, a corresponding aspect |
|
1153 |
is asked for. If that fails as well, the app class is asked as a last |
|
1154 |
chance." |
|
1155 |
||
1156 |
|a| |
|
1157 |
||
1158 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1159 |
^ self perform:aKey |
|
1160 |
]. |
|
1161 |
a := self aspectFor:aKey. |
|
1162 |
a notNil ifTrue:[ |
|
1163 |
^ a |
|
1164 |
]. |
|
1165 |
^ self application listFor:aKey |
|
1166 |
||
1167 |
"Modified: / 18.6.1998 / 20:33:50 / cg" |
|
1168 |
! |
|
1169 |
||
1170 |
menuFor:aKey |
|
1171 |
"sent by the builder to ask for an application provided |
|
1172 |
holder for a menu. |
|
1173 |
The argument, aKey comes from an UI-spec |
|
1174 |
for a widgets #menu property. |
|
1175 |
Here, a corresponding message is sent to myself, |
|
1176 |
which ought to be defined in the application subclass. |
|
1177 |
Alternatively, a subclass may redefine this method, to provide |
|
1178 |
holders from a Dictionary or whatever. |
|
1179 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
1180 |
||
1181 |
(self selfResponsibleFor:aKey) ifTrue:[ |
|
1182 |
^ self perform:aKey |
|
1183 |
]. |
|
1997 | 1184 |
(self class selfResponsibleFor:aKey) ifTrue:[ |
1185 |
^ self class perform:aKey |
|
1186 |
]. |
|
1419 | 1187 |
^ masterApplication menuFor:aKey |
1188 |
||
1189 |
"Modified: / 18.6.1998 / 20:33:56 / cg" |
|
1190 |
! |
|
1191 |
||
1192 |
specificationFor:aKey |
|
1193 |
"sent by the builder to ask for an application provided |
|
1194 |
specification for a subcanvas or subspecification. |
|
1195 |
The argument, aKey comes from an UI-spec |
|
1196 |
for a subcanvases #specification property (minorKey). |
|
1197 |
Here, a corresponding message is sent to myself, |
|
1198 |
which ought to be defined in the application subclass. |
|
1199 |
Alternatively, a subclass may redefine this method, to provide |
|
1200 |
interfaceSpecifications from a Dictionary or whatever. |
|
1201 |
Typically, an interfaceSpecification is returned there." |
|
1202 |
||
1584 | 1203 |
^ ApplicationModel |
1204 |
specificationFor:aKey |
|
1205 |
application:self |
|
1206 |
onDevice:(self graphicsDevice) |
|
1419 | 1207 |
! |
1208 |
||
2058 | 1209 |
subApplicationFor:aKey |
1210 |
"sent by subCanvas to ask for an application inside itself. |
|
1211 |
The argument, aKey comes from a TabList-specs majorKey. |
|
1212 |
Here, a corresponding message is sent to myself, |
|
1213 |
which ought to be defined in the application subclass. |
|
1214 |
Alternatively, a subclass may redefine this method, to provide |
|
1215 |
an application from a Dictionary or whatever. |
|
1216 |
Typically, an ApplicationModel subinstance is returned there." |
|
1217 |
||
1218 |
(self respondsTo:aKey) ifTrue:[ |
|
1219 |
^ self perform:aKey |
|
1220 |
]. |
|
1221 |
masterApplication notNil ifTrue:[ |
|
1222 |
^ masterApplication subApplicationFor:aKey |
|
1223 |
]. |
|
1224 |
^ nil. |
|
1225 |
! |
|
1226 |
||
1419 | 1227 |
visualFor:aKey |
1228 |
"sent by the builder to ask for an application provided |
|
1229 |
image or element for a label. |
|
1230 |
The argument, aKey comes from an UI-spec |
|
1231 |
for a widgets #label property, if LabelIsImage is turned on. |
|
1232 |
Here, a corresponding message is sent to myself, |
|
1233 |
which ought to be defined in the application subclass. |
|
1234 |
Alternatively, a subclass may redefine this method, to provide |
|
1235 |
images from a Dictionary or whatever. |
|
1236 |
Typically, an image is returned there." |
|
1237 |
||
1238 |
^ self application visualFor:aKey |
|
1239 |
||
1240 |
! ! |
|
1241 |
||
2086 | 1242 |
!ApplicationModel methodsFor:'binding access-help'! |
1243 |
||
2087 | 1244 |
basicFlyByHelpTextForKey:aKey |
1245 |
"flyByHelp interface: return some short help text for a key |
|
1246 |
key is the symbol associated with some widget or menu item. |
|
1247 |
Return the original (english) text; needs to be translated as per language" |
|
1248 |
||
1249 |
|helpText helpSpec resourceArgs| |
|
1250 |
||
1251 |
helpSpec := self flyByHelpSpec. |
|
1252 |
helpSpec notNil ifTrue:[ |
|
1253 |
helpText := helpSpec at:aKey ifAbsent:nil. |
|
1254 |
]. |
|
1255 |
helpText isNil ifTrue:[ |
|
1256 |
masterApplication notNil ifTrue:[ |
|
1257 |
helpText := masterApplication flyByHelpTextForKey:aKey |
|
1258 |
] |
|
1259 |
]. |
|
1260 |
||
1261 |
"/ new: allow for a collection (resource-key arg1 arg2...) |
|
1262 |
(helpText isCollection and:[helpText isString not]) ifTrue:[ |
|
1263 |
resourceArgs := helpText copyFrom:2. |
|
1264 |
helpText := helpText first. |
|
1265 |
]. |
|
1266 |
^ helpText |
|
1267 |
! |
|
1268 |
||
2086 | 1269 |
basicHelpTextForKey:aKey |
1270 |
"activeHelp interface: return some help text for a key |
|
1271 |
key is the symbol associated with some widget or menu item. |
|
1272 |
Return the original (english) text; needs to be translated as per language" |
|
1273 |
||
1274 |
|helpText| |
|
1275 |
||
1276 |
helpText := (self helpSpec) at:aKey ifAbsent:nil. |
|
1277 |
helpText isNil ifTrue:[ |
|
1278 |
masterApplication notNil ifTrue:[ |
|
1279 |
helpText := masterApplication helpTextForKey:aKey |
|
1280 |
]. |
|
1281 |
]. |
|
1282 |
^ helpText |
|
1283 |
! |
|
1284 |
||
1285 |
flyByHelpSpec |
|
1286 |
"activeHelp interface: return some short help text for a widget component" |
|
1287 |
||
1288 |
^ self class flyByHelpSpec |
|
1289 |
! |
|
1290 |
||
1291 |
flyByHelpTextFor:aComponent |
|
1292 |
"activeHelp interface: return some short help text for a widget component" |
|
1293 |
||
1294 |
|key| |
|
1295 |
||
1296 |
builder notNil ifTrue:[ |
|
1297 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
|
1298 |
^ self flyByHelpTextForKey:key |
|
1299 |
] |
|
1300 |
]. |
|
1301 |
masterApplication notNil ifTrue:[ |
|
1302 |
^ masterApplication flyByHelpTextFor:aComponent |
|
1303 |
]. |
|
1304 |
^ nil |
|
1305 |
||
1306 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
|
1307 |
! |
|
1308 |
||
1309 |
flyByHelpTextForKey:aKey |
|
1310 |
"flyByHelp interface: return some short help text for a key |
|
1311 |
key is the symbol associated with some widget or menu item. |
|
1312 |
(from my flyByHelpSpec); return a language variant (if available)" |
|
1313 |
||
2510
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1314 |
|helpText| |
2088 | 1315 |
|
1316 |
helpText := self basicFlyByHelpTextForKey:aKey. |
|
2510
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1317 |
resources notNil ifTrue:[ |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1318 |
helpText isNil ifTrue:[ |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1319 |
"resolve key from resources" |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1320 |
^ resources string:aKey. |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1321 |
] ifFalse:[ |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1322 |
"/ kludge to allow for dynamic translation by the application itself. |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1323 |
helpText isBlock ifTrue:[ |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1324 |
^ helpText value |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1325 |
]. |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1326 |
^ resources stringWithCRs:helpText |
2345
3502dcdf4372
allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
2336
diff
changeset
|
1327 |
]. |
2086 | 1328 |
]. |
1329 |
^ helpText |
|
1330 |
||
2345
3502dcdf4372
allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
2336
diff
changeset
|
1331 |
"Modified: / 03-11-2007 / 12:04:14 / cg" |
2086 | 1332 |
! |
1333 |
||
2510
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1334 |
flyByHelpTextForKey:aKey row:aRowNr |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1335 |
"Special interface for DataSet - get the active help text for a specific row" |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1336 |
|
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1337 |
"Default: no row specific help" |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1338 |
|
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1339 |
^ self flyByHelpTextForKey:aKey. |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1340 |
! |
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
1341 |
|
2086 | 1342 |
helpSpec |
1343 |
"activeHelp interface: return some short help text for a widget component" |
|
1344 |
||
1345 |
^ self class helpSpec |
|
1346 |
! |
|
1347 |
||
1348 |
helpTextFor:aComponent |
|
1349 |
"activeHelp interface: return some help text for a widget component" |
|
1350 |
||
1351 |
|key| |
|
1352 |
||
1353 |
builder notNil ifTrue:[ |
|
1354 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
|
1355 |
^ self helpTextForKey:key |
|
1356 |
] |
|
1357 |
]. |
|
1358 |
masterApplication notNil ifTrue:[ |
|
1359 |
^ masterApplication helpTextFor:aComponent |
|
1360 |
]. |
|
1361 |
^ nil |
|
1362 |
||
1363 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
|
1364 |
! |
|
1365 |
||
1366 |
helpTextForKey:aKey |
|
1367 |
"activeHelp interface: return some help text for a key |
|
1368 |
key is the symbol associated with some widget or menu item. |
|
1369 |
(from my helpSpec); return a language variant (if available)" |
|
1370 |
||
1371 |
|helpText xLated| |
|
1372 |
||
1373 |
helpText := self basicHelpTextForKey:aKey. |
|
1374 |
helpText isNil ifTrue:[ |
|
2095 | 1375 |
aKey isSymbol ifFalse:[^ nil]. |
2442
6f46d1a6fef2
'sorry-no help' is translated
Claus Gittinger <cg@exept.de>
parents:
2405
diff
changeset
|
1376 |
^ resources string:'Sorry, no help for: %1' with:aKey "/ nil |
2086 | 1377 |
]. |
1378 |
||
1379 |
"/ translate. |
|
1380 |
resources notNil ifTrue:[ |
|
1381 |
xLated := resources string:helpText default:nil. |
|
1382 |
xLated isNil ifTrue:[ |
|
1383 |
(helpText endsWith:'.') ifTrue:[ |
|
1384 |
xLated := resources string:(helpText copyWithoutLast:1) default:nil. |
|
1385 |
xLated notNil ifTrue:[ |
|
1386 |
^ xLated , '.' |
|
1387 |
] |
|
1388 |
]. |
|
1389 |
]. |
|
1390 |
^ resources string:helpText |
|
1391 |
]. |
|
1392 |
^ helpText |
|
1393 |
||
1394 |
"Modified: / 4.2.2000 / 15:30:16 / cg" |
|
1395 |
! ! |
|
1396 |
||
2380 | 1397 |
!ApplicationModel methodsFor:'building'! |
1398 |
||
1399 |
allButOpen |
|
1400 |
"create my views from the windowSpec, but do not open the main window." |
|
1401 |
||
1402 |
^ self allButOpenInterface:(self defaultWindowSpecName). |
|
1403 |
||
1404 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
|
1405 |
! |
|
1406 |
||
1407 |
allButOpenFrom:aSpec |
|
1408 |
"create my views but do not open the main window. |
|
1409 |
The argument is a spec which defines the interface." |
|
1410 |
||
1411 |
|window| |
|
1412 |
||
1413 |
"/ DISABLED; see comment in basicInitialize |
|
1414 |
"/ |
|
1415 |
"/ " |
|
1416 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1417 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1418 |
"/ a UIBuilder .... |
|
1419 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1420 |
"/ if not needed. |
|
1421 |
"/ " |
|
1422 |
"/ realBuilder := UIBuilder new. |
|
1423 |
"/ builder := realBuilder. |
|
1424 |
"/ builder application:self. |
|
1425 |
"/ builder bindings:builder bindings. |
|
1426 |
||
1427 |
builder isNil ifTrue:[ |
|
1428 |
self createBuilder. |
|
1429 |
]. |
|
1430 |
||
1431 |
self preBuildWith:builder. |
|
1432 |
builder buildWindowFromSpec:aSpec. |
|
1433 |
window := builder window. |
|
1434 |
||
1435 |
window model:self. |
|
1436 |
(window respondsTo:#application:) ifTrue:[ |
|
1437 |
window application:self. |
|
1438 |
]. |
|
1439 |
||
1440 |
self showingHelp ifTrue: [ActiveHelp startFor: self]. |
|
1441 |
self postBuildWith:builder. |
|
1442 |
||
1443 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
|
1444 |
! |
|
1445 |
||
1446 |
allButOpenInterface:aSymbol |
|
1447 |
"create my views but do not open the main window. |
|
1448 |
The argument specifies a selector of a method, |
|
1449 |
which when sent to myself should return a spec. |
|
1450 |
Notice, this returns the windowBuilder." |
|
1451 |
||
1452 |
self allButOpenFrom:(self interfaceSpecFor:aSymbol). |
|
1453 |
^ builder |
|
1454 |
||
1455 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
|
1456 |
! |
|
1457 |
||
1458 |
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder |
|
1459 |
"build a subcanvases spec into aSubcanvas" |
|
1460 |
||
1461 |
|sameApp prevSpec prevSource| |
|
1462 |
||
1463 |
aBuilder notNil ifTrue:[ |
|
1464 |
prevSpec := aBuilder spec. |
|
1465 |
prevSource := aBuilder source. |
|
1466 |
]. |
|
1467 |
||
1468 |
builder isNil ifTrue:[ |
|
1469 |
builder := aBuilder. |
|
1470 |
aBuilder isNil ifTrue:[ |
|
1471 |
self createBuilder |
|
1472 |
] |
|
1473 |
]. |
|
1474 |
||
1475 |
aBuilder source:self. |
|
1476 |
||
1477 |
"/ if the subcanvases appModel is NOT the same as |
|
1478 |
"/ the topApp, it must be pre/post-built. |
|
1479 |
"/ Otherwise, we invoke pre/post-builtAsSubcanvas. |
|
1480 |
"/ which provides a hook for redefinition in concrete appModels. |
|
1481 |
"/ This avoids invoking pre/postBuild twice for subCanvases which |
|
1482 |
"/ have the topApp as appModel. |
|
1483 |
||
1484 |
sameApp := aBuilder application == aBuilder window topView application. |
|
1485 |
sameApp ifTrue:[ |
|
1486 |
self preBuildAsSubcanvasWith:aBuilder. |
|
1487 |
] ifFalse:[ |
|
1488 |
self preBuildWith:aBuilder. |
|
1489 |
]. |
|
1490 |
||
1491 |
aBuilder buildFromSpec:specToBuild. |
|
1492 |
||
1493 |
sameApp ifTrue:[ |
|
1494 |
self postBuildAsSubcanvasWith:aBuilder. |
|
1495 |
] ifFalse:[ |
|
1496 |
self postBuildWith:aBuilder. |
|
1497 |
]. |
|
1498 |
||
1499 |
prevSpec notNil ifTrue:[ |
|
1500 |
"/ restore state in builder if original builder was used |
|
1501 |
aBuilder spec:prevSpec. |
|
1502 |
]. |
|
1503 |
prevSource notNil ifTrue:[ |
|
1504 |
"/ restore state in builder if original builder was used |
|
1505 |
aBuilder source:prevSource. |
|
1506 |
]. |
|
1507 |
||
1508 |
^ aBuilder |
|
1509 |
||
1510 |
"Created: / 18-06-1998 / 20:08:45 / cg" |
|
1511 |
"Modified: / 27-10-2006 / 11:45:25 / cg" |
|
1512 |
! |
|
1513 |
||
1514 |
buildSubCanvas:spec withBuilder:aBuilder |
|
1515 |
"build a subcanvases' spec into aSubcanvas" |
|
1516 |
||
1517 |
self buildSubCanvas:spec withMenu:false withBuilder:aBuilder |
|
1518 |
! |
|
1519 |
||
1520 |
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder |
|
1521 |
"build a subcanvases' spec into aSubcanvas" |
|
1522 |
||
1523 |
|specToBuild| |
|
1524 |
||
1525 |
specToBuild := spec. |
|
1526 |
withMenuBoolean ifFalse:[ |
|
1527 |
"/ subapps should not build the menu and other fullSpec stuff. |
|
1528 |
spec class == FullSpec ifTrue:[ |
|
1529 |
specToBuild := spec component. |
|
1530 |
] |
|
1531 |
]. |
|
1532 |
self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder |
|
1533 |
! ! |
|
1534 |
||
1419 | 1535 |
!ApplicationModel methodsFor:'change & update'! |
1536 |
||
1537 |
delayedUpdate:something with:aParameter from:changedObject |
|
1538 |
"support for delayed updates - |
|
1539 |
subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:) |
|
1540 |
must also redefine this method, and perform the actual update there." |
|
1541 |
||
1542 |
^ self |
|
1543 |
! |
|
1544 |
||
1545 |
enqueueDelayedUpdate:something with:aParameter from:changedObject |
|
1546 |
"support for delayed updates - to be invoked from a concrete classes |
|
1547 |
#update:with:from: method. |
|
1548 |
This will enqueue a delayed update, and resend #delayedUpdate:with:from: |
|
1549 |
whenever the receiver is handling events. |
|
1550 |
Especially useful, if many updates arrive at high frequency, to avoid |
|
1551 |
multiple redraws." |
|
1552 |
||
1553 |
^ self |
|
1554 |
enqueueMessage:#delayedUpdate:with:from: |
|
1555 |
for:self |
|
1556 |
arguments:(Array |
|
1557 |
with:something |
|
1558 |
with:aParameter |
|
1559 |
with:changedObject). |
|
1560 |
||
1561 |
"Modified: / 26.2.2000 / 18:01:44 / cg" |
|
1562 |
! |
|
1563 |
||
1564 |
enqueueMessage:selector for:someone arguments:argList |
|
1565 |
"enqueue a message to be sent to myself later, when my process |
|
1566 |
is back in its eventLoop. Also, filter duplicates. |
|
1567 |
This is useful, to buffer redraws and avoid flicker due to multiple |
|
1568 |
redraws (especially in browsers, when reacting on changeMessages resulting |
|
1569 |
from changes made in other browsers)" |
|
1570 |
||
1571 |
|window sensor| |
|
1572 |
||
1573 |
(window := self window) notNil ifTrue:[ |
|
1574 |
sensor := window sensor. |
|
1575 |
]. |
|
1749
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1576 |
|
1419 | 1577 |
sensor isNil ifTrue:[ |
1749
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1578 |
"no window (yet or any longer)" |
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1579 |
someone perform:selector withArguments:argList. |
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1580 |
^ self. |
1419 | 1581 |
]. |
1582 |
||
1749
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1583 |
|
1417 | 1584 |
"/ |
1419 | 1585 |
"/ if such a message is already in the queue, ignore it. |
1586 |
"/ Otherwise push it as an event, to be handled when my thread is |
|
1587 |
"/ back in the event loop. |
|
1588 |
"/ |
|
1749
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1589 |
sensor synchronized:[ |
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1590 |
(sensor hasEvent:selector for:someone withArguments:argList) ifFalse:[ |
1669
6130b670c22e
must enqueue messages with protection;
Claus Gittinger <cg@exept.de>
parents:
1634
diff
changeset
|
1591 |
sensor pushUserEvent:selector for:someone withArguments:argList |
6130b670c22e
must enqueue messages with protection;
Claus Gittinger <cg@exept.de>
parents:
1634
diff
changeset
|
1592 |
]. |
1749
1f58fbcd4b96
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
1742
diff
changeset
|
1593 |
]. |
1419 | 1594 |
|
1595 |
"Modified: / 5.2.2000 / 00:01:54 / cg" |
|
1596 |
"Created: / 26.2.2000 / 18:01:31 / cg" |
|
1597 |
! ! |
|
1598 |
||
1599 |
!ApplicationModel methodsFor:'component manipulations'! |
|
1600 |
||
1601 |
components:aSymbolOrArray do:aBlock |
|
1602 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
1603 |
||
1604 |
|coll| |
|
1605 |
||
1606 |
aSymbolOrArray isSymbol ifTrue:[ |
|
1607 |
"/ a single components name |
|
1608 |
coll := Array with:aSymbolOrArray |
|
1609 |
] ifFalse:[ |
|
1610 |
coll := aSymbolOrArray |
|
1611 |
]. |
|
1612 |
coll do:[:aSymbol | |
|
1613 |
|component| |
|
1614 |
||
1615 |
(component := self componentFor:aSymbol) isNil ifFalse:[ |
|
1616 |
aBlock value:component |
|
1617 |
] |
|
1618 |
] |
|
1619 |
||
1620 |
"Modified: 26.3.1997 / 16:23:14 / cg" |
|
1621 |
! |
|
1622 |
||
1623 |
disable:aSymbolOrArray |
|
1624 |
"disable the components whose id's are aSymbolOrArray." |
|
1625 |
||
1626 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
1627 |
||
1628 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
1629 |
! |
|
1630 |
||
1631 |
enable:aSymbolOrArray |
|
1632 |
"enables the component(s) identified by aSymbolOrArray." |
|
1633 |
||
1634 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
1635 |
||
1636 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
1637 |
! |
|
1638 |
||
1639 |
invalidate:aSymbolOrArray |
|
1640 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
1641 |
||
1642 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
1643 |
||
1644 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
1645 |
! |
|
1646 |
||
1647 |
makeInvisible:aSymbolOrArray |
|
1648 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
1649 |
||
1650 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
1651 |
||
1652 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
1653 |
! |
|
1654 |
||
1655 |
makeReadOnly:aSymbolOrArray |
|
1656 |
"make all components identified by aSymbolOrArray read only |
|
1657 |
(for editText components)." |
|
1658 |
||
1659 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
1660 |
||
1661 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
1662 |
! |
|
1663 |
||
1664 |
makeVisible:aSymbolOrArray |
|
1665 |
"makes the components whose id's are aSymbolOrArray visible" |
|
1666 |
||
1667 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
1668 |
||
1669 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
1670 |
! |
|
1671 |
||
1672 |
makeWritable:aSymbolOrArray |
|
1673 |
"make all components identified by aSymbolOrArray writable |
|
1674 |
(for editText components)." |
|
1675 |
||
1676 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
1677 |
||
1678 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
1679 |
! ! |
|
1680 |
||
1681 |
!ApplicationModel methodsFor:'copying'! |
|
1682 |
||
1683 |
postCopy |
|
1684 |
builder := device := nil. |
|
1685 |
||
1686 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
2053 | 1687 |
! |
1688 |
||
1689 |
postDeepCopy |
|
1690 |
builder := device := nil. |
|
1691 |
||
1692 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
1419 | 1693 |
! ! |
1694 |
||
1695 |
!ApplicationModel methodsFor:'drag & drop'! |
|
1696 |
||
2261 | 1697 |
canDropObjects:aCollectionOfDropObjects in:aComponent |
1419 | 1698 |
"drop manager asked if a drop is possible |
1699 |
- should be redefined by apps which can do it, to return true" |
|
1700 |
||
1701 |
^ false |
|
1702 |
||
2261 | 1703 |
"Created: / 13-10-2006 / 15:52:31 / cg" |
1419 | 1704 |
! |
1705 |
||
2261 | 1706 |
canDropObjects:aCollectionOfDropObjects in:aComponent at:position |
2405 | 1707 |
"drop manager asked if a drop is possible. |
1708 |
Should be redefined by apps which can do it, to return true" |
|
2252
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1709 |
|
2261 | 1710 |
^ self canDropObjects:aCollectionOfDropObjects in:aComponent |
1711 |
||
1712 |
"Created: / 13-10-2006 / 15:52:20 / cg" |
|
2079 | 1713 |
! |
1714 |
||
2262 | 1715 |
dropObjects:aCollectionOfDropObjects in:aComponent |
2079 | 1716 |
"drop manager wants to drop. |
2252
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1717 |
This is ony sent, if #canDrop: returned true. |
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1718 |
Must be redefine in order for drop to work." |
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1719 |
|
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1720 |
self subclassResponsibility |
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1721 |
|
2262 | 1722 |
"Created: / 13-10-2006 / 18:25:06 / cg" |
2079 | 1723 |
! |
1724 |
||
2262 | 1725 |
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint |
1419 | 1726 |
"drop manager wants to drop. |
1727 |
This is ony sent, if #canDrop:in: returned true. |
|
2252
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1728 |
Can be redefined in apps which return true to #canDrop." |
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
1729 |
|
2262 | 1730 |
self dropObjects:aCollectionOfDropObjects in:aComponent |
1731 |
||
1732 |
"Created: / 13-10-2006 / 18:25:13 / cg" |
|
1419 | 1733 |
! ! |
1734 |
||
1735 |
!ApplicationModel methodsFor:'easy bindings'! |
|
1736 |
||
1737 |
registerInterestIn:aValueModel using:aSelectorOrArray |
|
1738 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
|
1739 |
aSelectorOrArray can be one of three things: |
|
1740 |
||
1741 |
1) nil in which case no interest is registered |
|
1742 |
2) a selector in which case the receiver is understood to be self |
|
1743 |
3) an Array in which case the size is two where the first element is the |
|
1744 |
message to be sent and the second element is the receiver." |
|
1745 |
||
1746 |
aSelectorOrArray isNil ifTrue:[^ aValueModel]. |
|
1747 |
||
1748 |
(aSelectorOrArray isArray) ifTrue:[ |
|
1749 |
aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2) |
|
1750 |
] ifFalse: [ |
|
1751 |
aValueModel onChangeSend:aSelectorOrArray to:self |
|
1752 |
]. |
|
1753 |
^aValueModel |
|
1754 |
||
1755 |
"Modified: / 31.10.1997 / 18:19:44 / cg" |
|
980
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1756 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
1757 |
|
1419 | 1758 |
valueHolderFor:aSelector initialValue:anObject |
1759 |
"Return a ValueHolder on anObject." |
|
1760 |
||
1761 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
1762 |
||
1763 |
||
1764 |
! |
|
1765 |
||
1766 |
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil |
|
1767 |
"Return a ValueHolder on anObject. aSelectorOrArrayOrNil is the change information |
|
1768 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
|
1769 |
If it is a Symbol, then it is the change message and the interested object is understood |
|
1770 |
to be the reciever. If it is an Array, then the first element is the change message and |
|
1771 |
the second element is the interested object. " |
|
1772 |
||
1773 |
|holder| |
|
1774 |
||
1775 |
(builder bindings includesKey:aSelector) ifFalse:[ |
|
1776 |
holder := ValueHolder with:anObject. |
|
1777 |
builder aspectAt:aSelector put:holder. |
|
1778 |
aSelectorOrArrayOrNil notNil ifTrue:[ |
|
1779 |
^ self registerInterestIn:holder using:aSelectorOrArrayOrNil |
|
1780 |
]. |
|
1781 |
^ holder |
|
1782 |
]. |
|
1783 |
^ builder aspectAt:aSelector |
|
1784 |
||
1785 |
"Modified: / 21.5.1998 / 03:31:28 / cg" |
|
1786 |
! ! |
|
1787 |
||
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1788 |
!ApplicationModel methodsFor:'forced actions'! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1789 |
|
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1790 |
doAcceptByReturnKey |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1791 |
|acceptAction| |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1792 |
|
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1793 |
builder notNil ifTrue:[ |
2010 | 1794 |
acceptAction := builder bindingAt:#doAccept. |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1795 |
]. |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1796 |
acceptAction notNil ifTrue:[ |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1797 |
acceptAction value |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1798 |
] ifFalse:[ |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1799 |
self doAccept |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
1800 |
] |
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1801 |
! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1802 |
|
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1803 |
doCancelByEscapeKey |
2010 | 1804 |
|cancelAction| |
1805 |
||
1806 |
builder notNil ifTrue:[ |
|
1807 |
cancelAction := builder bindingAt:#doCancel. |
|
1808 |
]. |
|
1809 |
cancelAction notNil ifTrue:[ |
|
1810 |
cancelAction value |
|
1811 |
] ifFalse:[ |
|
1812 |
self doCancel |
|
1813 |
] |
|
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1814 |
! ! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
1815 |
|
1419 | 1816 |
!ApplicationModel methodsFor:'help'! |
1817 |
||
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1818 |
aboutImage |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1819 |
"bitmap image or nil for an about box for this application." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1820 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1821 |
^ self class aboutImage |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1822 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1823 |
"Modified: / 13.11.2001 / 12:32:44 / cg" |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1824 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1825 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1826 |
aboutThisApplicationLabel |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1827 |
"label for an about box for this application." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1828 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1829 |
^ self class aboutThisApplicationLabel |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1830 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1831 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1832 |
aboutThisApplicationText |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1833 |
"text for an about box for this application." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1834 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
1835 |
^ self class aboutThisApplicationText |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1836 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1837 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1838 |
openAboutThisApplication |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1839 |
"opens an about box for this application. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1840 |
Can be specialized by redefining #aboutThisApplicationText |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1841 |
and #aboutThisApplicationLabel" |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
1842 |
|
1531 | 1843 |
Dialog |
1844 |
about:(resources string:self aboutThisApplicationText) |
|
1845 |
label:(resources string:self aboutThisApplicationLabel) |
|
1846 |
icon:self aboutImage |
|
1847 |
||
1848 |
"Modified: / 17.11.2001 / 23:05:52 / cg" |
|
1419 | 1849 |
! |
1850 |
||
1851 |
openHelpViewOnFile:pathToHelpText |
|
1852 |
"open a help viewer (as opened by the help buttons). |
|
1853 |
The argument is a relative path within the help directory |
|
1854 |
(but a file under the current directory is tried first)" |
|
1855 |
||
1856 |
self withWaitCursorDo:[ |
|
1857 |
HTMLDocumentView openFullOnHelpFile:pathToHelpText |
|
1858 |
] |
|
1859 |
||
1860 |
! |
|
1861 |
||
1862 |
showActiveHelp:aHelpText for:view |
|
1863 |
"This is invoked from the activeHelp event listener, to display some popup-help |
|
1864 |
for a component. If false is returned, the help manager will pop up |
|
1865 |
some active help bubble; if true is returned, it will assume that the |
|
1866 |
help text has been already displayed and will not do any further actions. |
|
1867 |
Here, we accept the help text, and push an event into out own input |
|
1868 |
queue, so that the help text will be displayed asyncronously by myself, |
|
1869 |
vis the #showHelp:for: method. |
|
1870 |
This can be redefined in concrete classes to handle active help differently." |
|
1871 |
||
1872 |
|wg mySensor| |
|
1873 |
||
1874 |
self showingHelp ifFalse: [ |
|
1875 |
^ true |
|
1876 |
]. |
|
1877 |
||
1878 |
"/ masterApplication notNil ifTrue:[ |
|
1879 |
"/ (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[ |
|
1880 |
"/ ^ true |
|
1881 |
"/ ] |
|
1882 |
"/ ]. |
|
1883 |
||
1884 |
"/ NEW: push it into the event queue, to have it displayed |
|
1885 |
"/ syncronously with other events. |
|
1886 |
"/ (also any errors are reported as occurring in my context; |
|
1887 |
"/ instead of occurring in the activeHelp context). |
|
1888 |
||
1889 |
(wg := self windowGroup) notNil ifTrue:[ |
|
1890 |
mySensor := wg sensor. |
|
1891 |
mySensor notNil ifTrue:[ |
|
1892 |
mySensor flushEventsFor:self withType:#showHelp:for:. |
|
1893 |
mySensor |
|
1894 |
pushUserEvent:#showHelp:for: for:self |
|
1895 |
withArguments:(Array with:aHelpText with:view). |
|
1896 |
^ true |
|
1897 |
] |
|
1898 |
]. |
|
1899 |
||
1900 |
"/ mhmh - can this happen ? |
|
1901 |
||
1902 |
^ true |
|
1903 |
||
1904 |
"Modified: / 21.8.1998 / 16:00:37 / cg" |
|
1905 |
! |
|
1906 |
||
1907 |
showHelp:aHelpText for:view |
|
1908 |
"actual method which is supposed to display the help text. |
|
1909 |
Should be redefined in concrete classes, to put the help text |
|
1910 |
into some info label, or the windows title bar. |
|
1911 |
Here, the help text is ignored." |
|
1912 |
||
1913 |
masterApplication notNil ifTrue:[ |
|
1914 |
masterApplication showHelp:aHelpText for:view |
|
1915 |
]. |
|
1916 |
||
1917 |
"Modified: / 31.7.1998 / 19:13:59 / cg" |
|
1918 |
! |
|
1919 |
||
1920 |
showingHelp |
|
1921 |
"return true, if the activeHelp manager should invoke my #showHelp:for: |
|
1922 |
method, when the mouse pointer is moved over my widgets. |
|
1923 |
The default here is true, however, the #showHelp:for: methods are empty. |
|
1924 |
These should be redefined to put the help text into some info label, |
|
1925 |
or into the views title bar. |
|
1926 |
You may also redefine the showingHelp/showingHelp: methods, to |
|
1927 |
remember the flag setting." |
|
1928 |
||
1929 |
^ true |
|
1930 |
||
1931 |
"Modified: / 31.7.1998 / 17:55:31 / cg" |
|
1932 |
! ! |
|
1933 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1934 |
!ApplicationModel methodsFor:'hooks'! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1935 |
|
2185 | 1936 |
aboutToOpen:whichTopView |
1937 |
"the topView is about to be opened. |
|
1938 |
This is sent by whichTopView, right before its really open |
|
1939 |
(i.e. finally visible)" |
|
1940 |
||
1941 |
self preOpenWith:builder |
|
1942 |
! |
|
1943 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1944 |
commonPostBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1945 |
"a common hook for postBuildWith: and postBuildAsSubcanvasWith:." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1946 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1947 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1948 |
commonPostOpen |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1949 |
"a common hook for postOpenWith: and postOpenAsSubcanvasWith:." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1950 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1951 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1952 |
commonPreBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1953 |
"a common hook for preBuildWith: and preBuildAsSubcanvasWith:." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1954 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1955 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1956 |
postApplicationProcessCreate:newProcess windowGroup:newGroup |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1957 |
"this is sent whenever a new application is launched from this app, |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1958 |
which forks its own windowGroup process. Allows for process group management, |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1959 |
or process-global exception handlers to be installed. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1960 |
Nothing done here - to be redefined in concrete applications" |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1961 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1962 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1963 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1964 |
postBuildAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1965 |
"this is sent after an interface is built from a spec as subcanvas. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1966 |
Can be redefined in subclasses for additional setup after |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1967 |
the subcanvas view has been built, but not yet opened." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1968 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1969 |
|sameApp| |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1970 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1971 |
sameApp := aBuilder application == aBuilder window topView application. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1972 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1973 |
"/ If I am opened as subcanvas in another application |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1974 |
"/ then treat this like a regular open. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1975 |
"/ otherwise ignore it. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1976 |
sameApp ifFalse:[ |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1977 |
self postBuildWith:aBuilder. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1978 |
] ifTrue:[ |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1979 |
self commonPostBuild. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1980 |
]. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1981 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1982 |
"Modified: / 8.7.1998 / 18:28:55 / cg" |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1983 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1984 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1985 |
postBuildWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1986 |
"this is sent after an interface is built from a spec. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1987 |
Can be redefined in subclasses for additional setup after |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1988 |
the view has been built, but not yet opened." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1989 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1990 |
self commonPostBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1991 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1992 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1993 |
postOpenAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1994 |
"this is sent after the applications window is opened inside another application. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1995 |
Can be redefined in subclasses for actions after opening the view." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1996 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1997 |
self commonPostOpen |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1998 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
1999 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2000 |
postOpenWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2001 |
"this is sent after the applications main window is opened. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2002 |
Can be redefined in subclasses for actions after opening the view." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2003 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2004 |
self commonPostOpen |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2005 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2006 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2007 |
preBuildAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2008 |
"this is sent before an interface is built from a spec as a subcanvas. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2009 |
Can be redefined for apps which need to be informed about that." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2010 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2011 |
self commonPreBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2012 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2013 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2014 |
preBuildWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2015 |
"this is sent before an interface is built from a spec. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2016 |
Can be redefined in subclasses. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2017 |
mhmh - what should this do here ?" |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2018 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2019 |
self commonPreBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2020 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2021 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2022 |
preOpenWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2023 |
"this is sent before the applications main window is opened. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2024 |
Can be redefined in subclasses for actions right before opening the view." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2025 |
! ! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2026 |
|
1419 | 2027 |
!ApplicationModel methodsFor:'initialization'! |
2028 |
||
2029 |
addTopViewsToCurrentProject |
|
2030 |
"add all of my topViews to the current projects list of views. |
|
2031 |
This allows hiding views on a per-project basis. |
|
2032 |
Applications which do not want to be switched with projects |
|
2033 |
(such as the Launcher), may redefine this to a noop." |
|
2034 |
||
1972 | 2035 |
|wg| |
2036 |
||
2037 |
(wg := self windowGroup) notNil ifTrue:[ |
|
2038 |
(wg topViews ? #()) do:[:aView | |
|
2039 |
aView addToCurrentProject |
|
2040 |
] |
|
1419 | 2041 |
] |
2042 |
||
2043 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
|
2044 |
! |
|
2045 |
||
2046 |
basicInitialize |
|
2047 |
"initialize the application. |
|
2048 |
Since ST-80 applications seem commonly to redefine #initialize |
|
2049 |
without doing a super initialize, the real initialization is |
|
2050 |
done here ..." |
|
2051 |
||
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2052 |
self initializeDevice. |
1419 | 2053 |
|
2054 |
"claus: I wanted to delay the creation & assignment of the |
|
2055 |
builder till later, to allow setting to another builder. |
|
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2056 |
however, some (old) ST-80 code seems to access the builder right after instance |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2057 |
creation, which might lead to trouble. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2058 |
On the other hand, some (newer) apps (RefactoringBrowser) depend on this being set |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2059 |
late. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2060 |
So, we leave it undefined here. Do not uncomment the following lines. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2061 |
" |
1419 | 2062 |
|
2063 |
"/ builder := self builderClass new. |
|
2064 |
"/ builder notNil ifTrue:[builder application:self]. |
|
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2065 |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2066 |
self initializeResources. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2067 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2068 |
"Modified: / 13-09-2006 / 12:39:30 / cg" |
1419 | 2069 |
! |
2070 |
||
2071 |
initialize |
|
2072 |
"nothing done here; |
|
2073 |
but can be redefined in concrete applications" |
|
2074 |
! |
|
2075 |
||
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2076 |
initializeDevice |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2077 |
Screen notNil ifTrue:[ |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2078 |
device := Screen current. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2079 |
] |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2080 |
! |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2081 |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2082 |
initializeResources |
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2083 |
"initialize the applications resources (NLS support)." |
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2084 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2085 |
resources := self class classResources. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2086 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2087 |
"Created: / 13-09-2006 / 12:39:22 / cg" |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2088 |
! |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2089 |
|
1419 | 2090 |
setDevice:aDevice |
2091 |
"set the device (i.e. some Screen), where the application |
|
2092 |
shall open its view(s). |
|
2093 |
The default device (if not set here) will be the current screen." |
|
2094 |
||
2095 |
device := aDevice |
|
2096 |
||
2097 |
"Created: 5.7.1996 / 12:01:40 / cg" |
|
2098 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
|
2099 |
! ! |
|
2100 |
||
2101 |
!ApplicationModel methodsFor:'misc'! |
|
2102 |
||
2103 |
information:aString |
|
2104 |
"like Objects information, but translates the string via the |
|
2105 |
resourcePack, thus giving a translated string automatically" |
|
2106 |
||
1699
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2107 |
|s| |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2108 |
|
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2109 |
resources isNil ifTrue:[ |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2110 |
"/ mhmh an early warning ... |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2111 |
s := aString |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2112 |
] ifFalse:[ |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2113 |
s := resources string:aString |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2114 |
]. |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2115 |
super information:s withCRs |
1419 | 2116 |
|
2117 |
"Created: / 20.5.1998 / 03:48:43 / cg" |
|
2118 |
! |
|
2119 |
||
1699
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2120 |
notify:aString |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2121 |
"like Objects notify, but translates the string via the |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2122 |
resourcePack, thus giving a translated string automatically" |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2123 |
|
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2124 |
|s| |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2125 |
|
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2126 |
resources isNil ifTrue:[ |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2127 |
"/ mhmh an early warning ... |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2128 |
s := aString |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2129 |
] ifFalse:[ |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2130 |
s := resources string:aString |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2131 |
]. |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2132 |
super notify:s withCRs |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2133 |
|
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2134 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2135 |
"Modified: / 13.11.2001 / 20:10:12 / cg" |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2136 |
! |
f196e6667c23
Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents:
1674
diff
changeset
|
2137 |
|
1419 | 2138 |
restoreCursors |
2139 |
"restore the original cursors in all of my views" |
|
2140 |
||
2141 |
^ self window windowGroup restoreCursors |
|
2142 |
||
2143 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
2144 |
! |
|
2145 |
||
2146 |
showCursor:aCursor |
|
2147 |
"set all of my views cursor to aCursor. |
|
2148 |
It can be restored with #restoreCursor." |
|
2149 |
||
2150 |
^ self window windowGroup showCursor:aCursor |
|
2151 |
||
2152 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
2153 |
! |
|
2154 |
||
2155 |
warn:aString |
|
2156 |
"like Objects warn, but translates the string via the |
|
2157 |
resourcePack, thus giving a translated string automatically" |
|
2158 |
||
1527 | 2159 |
|s| |
2160 |
||
2161 |
resources isNil ifTrue:[ |
|
2162 |
"/ mhmh an early warning ... |
|
2163 |
s := aString |
|
2164 |
] ifFalse:[ |
|
2054 | 2165 |
s := resources stringWithCRs:aString |
1527 | 2166 |
]. |
2054 | 2167 |
super warn:s |
1419 | 2168 |
|
2169 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
|
1527 | 2170 |
"Modified: / 13.11.2001 / 20:10:12 / cg" |
1419 | 2171 |
! |
2172 |
||
2173 |
warn:aString with:arg |
|
2174 |
"like Objects warn, but translates the string via the |
|
2175 |
resourcePack, thus giving a translated string automatically" |
|
2176 |
||
2115 | 2177 |
super warn:(resources stringWithCRs:aString with:arg) |
1419 | 2178 |
! |
2179 |
||
2180 |
warn:aString with:arg1 with:arg2 |
|
2181 |
"like Objects warn, but translates the string via the |
|
2182 |
resourcePack, thus giving a translated string automatically" |
|
2183 |
||
2054 | 2184 |
super warn:(resources stringWithCRs:aString with:arg1 with:arg2) |
1419 | 2185 |
! |
2186 |
||
2187 |
warn:aString with:arg1 with:arg2 with:arg3 |
|
2188 |
"like Objects warn, but translates the string via the |
|
2189 |
resourcePack, thus giving a translated string automatically" |
|
2190 |
||
2054 | 2191 |
super warn:(resources stringWithCRs:aString with:arg1 with:arg2 with:arg3) |
1419 | 2192 |
! |
2193 |
||
2194 |
warn:aString with:arg1 with:arg2 with:arg3 with:arg4 |
|
2195 |
"like Objects warn, but translates the string via the |
|
2196 |
resourcePack, thus giving a translated string automatically" |
|
2197 |
||
2054 | 2198 |
super warn:(resources stringWithCRs:aString with:arg1 with:arg2 with:arg3 with:arg4) |
1419 | 2199 |
|
2200 |
"Created: / 23.2.2000 / 09:43:04 / cg" |
|
2201 |
! |
|
2202 |
||
2203 |
withCursor:aCursor do:aBlock |
|
2204 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
2205 |
Return the value of aBlock." |
|
2206 |
||
2207 |
|w ret| |
|
2208 |
||
2209 |
w := self window. |
|
2210 |
w notNil ifTrue:[ |
|
1886 | 2211 |
^ w topView withCursor:aCursor do:aBlock |
1419 | 2212 |
]. |
2213 |
aCursor showWhile:[ret := aBlock value]. |
|
2214 |
^ ret. |
|
2215 |
||
2216 |
"Modified: / 23.9.1998 / 17:00:25 / cg" |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2217 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2218 |
|
1419 | 2219 |
withExecuteCursorDo:aBlock |
2220 |
"evaluate aBlock, showing an executeCursor in my topView and all of its subviews. |
|
2221 |
Return the value of aBlock." |
|
2222 |
||
2223 |
^ self withCursor:(Cursor execute) do:aBlock |
|
2224 |
||
2225 |
"Created: 14.12.1995 / 20:57:03 / cg" |
|
2226 |
! |
|
2227 |
||
2228 |
withReadCursorDo:aBlock |
|
2229 |
"evaluate aBlock, showing a readCursor in my topView and all of its subviews. |
|
2230 |
Return the value of aBlock." |
|
2231 |
||
2232 |
^ self withCursor:(Cursor read) do:aBlock |
|
2233 |
||
2234 |
"Created: 14.12.1995 / 20:56:47 / cg" |
|
2235 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
|
2236 |
! |
|
2237 |
||
2238 |
withWaitCursorDo:aBlock |
|
2239 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
2240 |
Return the value of aBlock." |
|
2241 |
||
2242 |
^ self withCursor:Cursor wait do:aBlock |
|
2243 |
! ! |
|
2244 |
||
2245 |
!ApplicationModel methodsFor:'opening'! |
|
2246 |
||
2247 |
open |
|
2248 |
"open a standard interface" |
|
2249 |
||
2250 |
^ self openInterface |
|
2251 |
||
2252 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2253 |
! |
|
2254 |
||
1592
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2255 |
openAndWaitUntilVisible |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2256 |
"open a standard interface, and wait until my window is visible" |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2257 |
|
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2258 |
self open. |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2259 |
self window waitUntilVisible. |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2260 |
! |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2261 |
|
1634 | 2262 |
openAs:windowType |
2263 |
"open a standard interface as slave, partner, dialog etc." |
|
2264 |
||
2265 |
^ self openInterfaceAs:windowType |
|
2266 |
||
2267 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2268 |
! |
|
2269 |
||
2270 |
openAsSlave |
|
1726 | 2271 |
"open a standard interface as slave. |
2272 |
Notice: there is still a need to make the current window a master |
|
2273 |
(see code and comments in WindowBuilder >> openAt:withExtent:andType:)" |
|
1634 | 2274 |
|
2275 |
^ self openAs:#slave |
|
1724 | 2276 |
|
2277 |
" |
|
2278 |
WorkspaceApplication new openAsSlave. |
|
2279 |
" |
|
1634 | 2280 |
! |
2281 |
||
1419 | 2282 |
openAt:aPoint |
2283 |
"open a standard interface at some point" |
|
2284 |
||
2285 |
^ self openInterfaceAt:aPoint |
|
2286 |
||
2287 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2288 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
2289 |
! |
|
2290 |
||
2291 |
openDialog |
|
2292 |
"open the window - assumes that the builder has already setup |
|
2293 |
the interface." |
|
2294 |
||
2038 | 2295 |
self window beToolDialog. |
1419 | 2296 |
^ builder openDialog. |
2297 |
||
2298 |
"Modified: 14.2.1997 / 20:32:52 / cg" |
|
2299 |
! |
|
2300 |
||
2301 |
openDialogInterface:aSelector |
|
2302 |
"open a dialog" |
|
2303 |
||
2304 |
^ self openDialogInterface:aSelector withBindings:nil |
|
2305 |
||
2306 |
"Modified: 28.2.1997 / 14:08:01 / cg" |
|
2307 |
! |
|
2308 |
||
2309 |
openDialogInterface:aSelector withBindings:bindings |
|
2310 |
"open a dialog, given a spec-selector" |
|
2311 |
||
2312 |
^ SimpleDialog new |
|
2313 |
openFor:self |
|
2314 |
interface:aSelector |
|
2315 |
withBindings:bindings |
|
2316 |
||
2317 |
"Created: / 28.2.1997 / 14:07:45 / cg" |
|
2318 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
|
2319 |
! |
|
2320 |
||
2321 |
openDialogInterfaceSpec:aSpec withBindings:bindings |
|
2322 |
"open a dialog, given a spec" |
|
2323 |
||
2324 |
^ SimpleDialog new |
|
2325 |
openFor:self |
|
2326 |
interfaceSpec:aSpec |
|
2327 |
withBindings:bindings |
|
2328 |
||
2329 |
"Created: / 28.2.1997 / 14:07:45 / cg" |
|
2330 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
|
2331 |
! |
|
2332 |
||
2333 |
openDialogSpec:aSpec withBindings:bindings |
|
2334 |
"open a dialog" |
|
2335 |
||
2336 |
^ SimpleDialog new |
|
2337 |
openFor:self |
|
2338 |
spec:aSpec |
|
2339 |
withBindings:bindings |
|
2340 |
||
2341 |
"Modified: / 23.1.1998 / 18:18:14 / cg" |
|
2342 |
"Created: / 20.5.1998 / 20:27:56 / cg" |
|
2343 |
! |
|
2344 |
||
2345 |
openInterface |
|
2346 |
"open a standard interface. |
|
2347 |
||
2348 |
Subclasses which do not have an interfaceSpec |
|
2349 |
should redefine this method and create & open their view(s) there. |
|
2350 |
(see Launcher as an example)." |
|
2351 |
||
1985 | 2352 |
^ self openInterface:(self defaultWindowSpecName) |
1419 | 2353 |
|
2354 |
"Modified: / 9.9.1996 / 22:39:23 / stefan" |
|
2355 |
"Modified: / 23.1.1998 / 18:16:50 / cg" |
|
2356 |
! |
|
2357 |
||
2358 |
openInterface:aSymbol |
|
2359 |
"open a specific interface. |
|
2360 |
The argument, aSymbol specifies which interface. The concrete |
|
2361 |
application subclass must provide a method with that name, |
|
2362 |
which must return an interfaceSpec. This is forwarded to |
|
2363 |
the builder to create the views. |
|
2364 |
Typically, applications only use one interface, |
|
2365 |
returned by the #windowSpec method." |
|
2366 |
||
2367 |
self allButOpenInterface:aSymbol. |
|
2368 |
self openWindow. |
|
2369 |
^ builder |
|
2370 |
||
2371 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
2372 |
! |
|
2373 |
||
1634 | 2374 |
openInterface:aSymbol as:windowType |
2375 |
"open a specific interface. |
|
2376 |
The argument, aSymbol specifies which interface. |
|
2377 |
The concrete application subclass must provide a method with that name, |
|
2378 |
which must return an interfaceSpec. This is forwarded to the builder to create the views. |
|
2379 |
Typically, applications only use one interface, returned by the #windowSpec method. |
|
2380 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc." |
|
2381 |
||
2382 |
self allButOpenInterface:aSymbol. |
|
2383 |
self openWindowAs:windowType. |
|
2384 |
^ builder |
|
2385 |
||
2386 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
2387 |
! |
|
2388 |
||
1419 | 2389 |
openInterface:aSymbol at:aLocation |
2390 |
"open a specific interface. |
|
2391 |
||
2392 |
The argument, aSymbol specifies which interface. The concrete |
|
2393 |
application subclass must provide a method with that name, |
|
2394 |
which must return an interfaceSpec. This is forwarded to |
|
2395 |
the builder to create the views. |
|
2396 |
Typically, applications only use one interface, |
|
2397 |
returned by the #windowSpec method." |
|
2398 |
||
2399 |
self allButOpenInterface:aSymbol. |
|
2400 |
self openWindowAt:aLocation. |
|
2401 |
^ builder |
|
2402 |
||
2403 |
"Created: 14.2.1997 / 20:19:44 / cg" |
|
2404 |
! |
|
2405 |
||
1634 | 2406 |
openInterfaceAs:windowType |
2407 |
"open a standard interface. |
|
2408 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc. |
|
2409 |
Subclasses which do not have an interfaceSpec |
|
2410 |
should redefine this method and create & open their view(s) there. |
|
2411 |
(see Launcher as an example)." |
|
2412 |
||
1985 | 2413 |
^ self openInterface:(self defaultWindowSpecName) as:windowType |
1634 | 2414 |
|
2415 |
"Modified: / 9.9.1996 / 22:39:23 / stefan" |
|
2416 |
"Modified: / 23.1.1998 / 18:16:50 / cg" |
|
2417 |
! |
|
2418 |
||
1419 | 2419 |
openInterfaceAt:aLocation |
2420 |
"open a standard interface." |
|
2421 |
||
1985 | 2422 |
^ self openInterface:(self defaultWindowSpecName) at:aLocation |
1419 | 2423 |
|
2424 |
"Created: / 14.2.1997 / 20:18:20 / cg" |
|
2425 |
"Modified: / 23.1.1998 / 18:17:13 / cg" |
|
2426 |
! |
|
2427 |
||
2428 |
openInterfaceModal |
|
2429 |
"open a standard interface as a modal dialog. |
|
2430 |
||
2431 |
Subclasses which do not have an interfaceSpec |
|
2432 |
should redefine this method and create & open their view(s) there. |
|
2433 |
(see Launcher as an example)." |
|
2434 |
||
1985 | 2435 |
^ self openInterfaceModal:(self defaultWindowSpecName) |
1419 | 2436 |
|
2437 |
"Modified: / 9.9.1996 / 22:39:23 / stefan" |
|
2438 |
"Modified: / 23.1.1998 / 18:17:17 / cg" |
|
2439 |
! |
|
2440 |
||
2441 |
openInterfaceModal:aSymbol |
|
2442 |
"open a specific interface as a modal dialog. |
|
2443 |
The argument, aSymbol specifies which interface. The concrete |
|
2444 |
application subclass must provide a method with that name, |
|
2445 |
which must return an interfaceSpec. This is forwarded to |
|
2446 |
the builder to create the views. |
|
2447 |
Typically, applications only use one interface, |
|
2448 |
returned by the #windowSpec method." |
|
2449 |
||
2450 |
self allButOpenInterface:aSymbol. |
|
2451 |
self openWindowModal. |
|
2452 |
^ builder |
|
2453 |
||
2454 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
969
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2455 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2456 |
|
1419 | 2457 |
openInterfaceModal:aSymbol at:location |
2458 |
"open a specific interface modal at some screen location. |
|
2459 |
The argument, aSymbol specifies which interface. The concrete |
|
2460 |
application subclass must provide a method with that name, |
|
2461 |
which must return an interfaceSpec. This is forwarded to |
|
2462 |
the builder to create the views. |
|
2463 |
Typically, applications only use one interface, |
|
2464 |
returned by the #windowSpec method." |
|
2465 |
||
2466 |
self allButOpenInterface:aSymbol. |
|
2467 |
self openWindowModalAt:location. |
|
2468 |
^ builder |
|
2469 |
||
2470 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
2471 |
! |
|
2472 |
||
2473 |
openModal |
|
2474 |
"open a standard interface as a modal dialog" |
|
2475 |
||
2476 |
^ self openInterfaceModal |
|
2477 |
||
2478 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2479 |
! |
|
2480 |
||
2481 |
openOnDevice:aDevice |
|
2482 |
"open a standard interface on some other device" |
|
2483 |
||
2484 |
self setDevice:aDevice. |
|
1444 | 2485 |
Screen currentScreenQuerySignal answer:aDevice |
2486 |
do:[ |
|
2487 |
^ self open |
|
2488 |
] |
|
1419 | 2489 |
|
2490 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
2491 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
2492 |
! |
|
2493 |
||
2494 |
openSpec:anInterfaceSpec |
|
2495 |
"open a view as specified in anInterfaceSpec." |
|
2496 |
||
2497 |
self allButOpenFrom:anInterfaceSpec. |
|
2498 |
self openWindow. |
|
2499 |
^ builder |
|
2500 |
||
2501 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
|
2502 |
"Created: / 20.5.1998 / 20:08:51 / cg" |
|
2503 |
! |
|
2504 |
||
2393 | 2505 |
openSpec:anInterfaceSpec withBindings:bindings |
2506 |
"open a view as specified in anInterfaceSpec." |
|
2507 |
||
2508 |
self createBuilder. |
|
2509 |
builder bindings:bindings. |
|
2510 |
self allButOpenFrom:anInterfaceSpec. |
|
2511 |
self openWindow. |
|
2512 |
! |
|
2513 |
||
1419 | 2514 |
openSpecModal:anInterfaceSpec |
2515 |
"open an interface spec modal" |
|
2516 |
||
2517 |
self allButOpenFrom:anInterfaceSpec. |
|
2518 |
self openWindowModal. |
|
2519 |
^ builder |
|
2520 |
||
2521 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
|
2522 |
"Created: / 20.5.1998 / 20:20:21 / cg" |
|
2523 |
! |
|
2524 |
||
2525 |
openWindow |
|
2526 |
"open the window - assumes that the builder has already setup |
|
2527 |
the interface." |
|
2528 |
||
2529 |
builder openWindow. |
|
2530 |
||
2270
a7c797806d46
correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
2531 |
"Created: / 14-02-1997 / 20:20:39 / cg" |
a7c797806d46
correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
2532 |
"Modified: / 27-10-2006 / 11:49:00 / cg" |
1419 | 2533 |
! |
2534 |
||
1634 | 2535 |
openWindowAs:windowType |
2536 |
"open the window - assumes that the builder has already setup the interface. |
|
2537 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc." |
|
2538 |
||
2539 |
builder openAt:nil withExtent:nil andType:windowType |
|
2540 |
! |
|
2541 |
||
1419 | 2542 |
openWindowAt:aLocation |
2543 |
"open the window - assumes that the builder has already setup |
|
2544 |
the interface." |
|
2545 |
||
2546 |
builder openWindowAt:aLocation. |
|
2547 |
||
2548 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
2549 |
! |
|
2550 |
||
2551 |
openWindowAtCenter |
|
2552 |
"open the window centered on the screen |
|
2553 |
- assumes that the builder has already setup the interface." |
|
2554 |
||
2555 |
builder openWindowAt:#center |
|
2556 |
||
2557 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
2558 |
! |
|
2559 |
||
2560 |
openWindowModal |
|
2561 |
"open the window - assumes that the builder has already setup |
|
2562 |
the interface." |
|
2563 |
||
2564 |
"/ builder openDialog. |
|
2565 |
builder |
|
2566 |
openAt:nil |
|
2567 |
withExtent:nil |
|
2568 |
andType:#dialog |
|
2569 |
||
2570 |
"Created: 14.2.1997 / 20:20:39 / cg" |
|
2571 |
! |
|
2572 |
||
2573 |
openWindowModalAt:aLocation |
|
2574 |
"open the window modal - assumes that the builder has already setup |
|
2575 |
the interface." |
|
2576 |
||
2577 |
builder openDialogAt:aLocation. |
|
2578 |
||
2579 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
2580 |
! |
|
2581 |
||
1478 | 2582 |
openWithExtent:extPoint |
2583 |
"open a standard interface with given extent" |
|
2584 |
||
2585 |
|bldr| |
|
2586 |
||
2587 |
bldr := self allButOpen. |
|
2588 |
bldr openWithExtent:extPoint. |
|
2589 |
^ bldr |
|
2590 |
||
2591 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2592 |
! |
|
2593 |
||
1968 | 2594 |
opened:whichTopView |
2595 |
"the topView has been opened. |
|
2596 |
This is sent by whichTopView, when its really open |
|
2597 |
(i.e. finally visible)" |
|
2598 |
||
2599 |
self addTopViewsToCurrentProject. |
|
2600 |
self postOpenWith:builder |
|
1419 | 2601 |
! ! |
2602 |
||
2380 | 2603 |
!ApplicationModel methodsFor:'opening-webInterface'! |
2604 |
||
2605 |
defineInterface |
|
2606 |
"define a standard interface. |
|
2607 |
||
2608 |
Subclasses which do not have an interfaceSpec |
|
2609 |
should redefine this method and create their page there." |
|
2610 |
||
2611 |
^ self defineInterface:(self defaultPageSpecName) |
|
2612 |
! |
|
2613 |
||
2614 |
defineInterface:aSpecSymbol |
|
2615 |
"define an interface." |
|
2616 |
||
2617 |
^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol) |
|
2618 |
! |
|
2619 |
||
2620 |
defineInterfaceFrom:aSpec |
|
2621 |
"define an interface (setup a page), given a spec." |
|
2622 |
||
2623 |
|page| |
|
2624 |
||
2625 |
builder isNil ifTrue:[ |
|
2626 |
self createWebBuilder. |
|
2627 |
]. |
|
2628 |
||
2629 |
self preBuildWith:builder. |
|
2630 |
builder buildPageFromSpec:aSpec. |
|
2631 |
page := builder page. |
|
2632 |
page application:self. |
|
2633 |
||
2634 |
self postBuildWith:builder. |
|
2635 |
||
2636 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
|
2637 |
! ! |
|
2638 |
||
1419 | 2639 |
!ApplicationModel methodsFor:'private'! |
2640 |
||
2641 |
builderClass |
|
2642 |
"return the UIBuilder class for me. |
|
2643 |
This method can be redefined if (eventually) there are |
|
2644 |
spec readers for other UI languages (motif UIL ?)" |
|
2645 |
||
2646 |
^ UIBuilder |
|
2647 |
||
2648 |
"Created: / 19.6.1998 / 01:39:26 / cg" |
|
2649 |
"Modified: / 19.6.1998 / 01:45:24 / cg" |
|
2650 |
! |
|
2651 |
||
2652 |
createBuilder |
|
1431 | 2653 |
"create a WindowBuilder if not already present" |
2654 |
||
1419 | 2655 |
builder isNil ifTrue:[ |
2656 |
builder := self builderClass new. |
|
2657 |
builder application:self. |
|
2658 |
] |
|
2659 |
||
2660 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
|
2661 |
! |
|
2662 |
||
2380 | 2663 |
createWebBuilder |
2664 |
"create a Web-UIBuilder if not already present" |
|
2665 |
||
2666 |
builder isNil ifTrue:[ |
|
2667 |
builder := self webBuilderClass new. |
|
2668 |
builder application:self. |
|
2669 |
] |
|
2670 |
||
2671 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
|
2672 |
! |
|
2673 |
||
2674 |
webBuilderClass |
|
2675 |
"return the UIBuilder class for me. |
|
2676 |
This method can be redefined if (eventually) there are |
|
2677 |
spec readers for other UI languages (motif UIL ?)" |
|
2678 |
||
2679 |
^ WebPageBuilder |
|
2680 |
||
2681 |
"Created: / 19.6.1998 / 01:39:26 / cg" |
|
2682 |
"Modified: / 19.6.1998 / 01:45:24 / cg" |
|
1419 | 2683 |
! ! |
2684 |
||
2685 |
!ApplicationModel methodsFor:'queries'! |
|
2686 |
||
1985 | 2687 |
defaultWindowSpecName |
2688 |
^ #windowSpec |
|
2689 |
! |
|
2690 |
||
1419 | 2691 |
defaultWindowType |
2692 |
"Applications come up non-modal, by default" |
|
2693 |
||
2694 |
^ #normal |
|
2695 |
||
2696 |
"Created: 17.1.1997 / 19:57:34 / cg" |
|
2697 |
! |
|
2698 |
||
2699 |
graphicsDevice |
|
2700 |
"return the device I want to open my views on. |
|
2701 |
The default (if not created with #onDevice:) is the currently |
|
2702 |
active screen." |
|
2703 |
||
2704 |
^ device |
|
2705 |
||
2706 |
"Created: 5.7.1996 / 17:51:31 / cg" |
|
1132
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2707 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2708 |
|
2373 | 2709 |
interfaceSpecFor:aSelectorOrSpec |
1419 | 2710 |
"return an interface spec. |
2711 |
Here, the query is forwarded to my class. |
|
2712 |
Can be refefined in subclasses which want to provide per-instance specs." |
|
2713 |
||
2373 | 2714 |
aSelectorOrSpec isSymbol ifFalse:[ |
2715 |
(aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec]. |
|
2716 |
]. |
|
2717 |
^ self class interfaceSpecFor:aSelectorOrSpec |
|
2718 |
||
2719 |
"Created: / 25-01-1998 / 19:45:12 / cg" |
|
2720 |
"Modified: / 14-01-2008 / 17:54:29 / cg" |
|
1419 | 2721 |
! |
2722 |
||
1481
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2723 |
isOpen |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2724 |
"answer true if the application's window is open" |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2725 |
|
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2726 |
|win| |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2727 |
|
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2728 |
^ (win := self window) notNil and:[win isOpen] |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2729 |
! |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
2730 |
|
1419 | 2731 |
processName |
2732 |
"return a name to be shown for me in the process monitor" |
|
2733 |
||
2734 |
self class == ApplicationModel ifTrue:[ |
|
2735 |
^ 'Application' |
|
2736 |
]. |
|
2737 |
^ self class nameWithoutPrefix |
|
2738 |
||
2739 |
"Modified: / 4.12.1997 / 12:39:14 / cg" |
|
2740 |
! |
|
2741 |
||
2742 |
resolveClassNamed:something inClass:aClass |
|
2743 |
"return the class from something, a class, symbol, string or nil. |
|
1548 | 2744 |
first we are looking in the namespace of the application, then in the |
2745 |
current namespace and finally in Smalltalk |
|
1419 | 2746 |
" |
2747 |
||
2748 |
^ Smalltalk resolveName:something inClass:aClass. |
|
2749 |
! |
|
2750 |
||
2751 |
resolveName:something |
|
2752 |
"return the class from something, a class, symbol, string or nil. |
|
1548 | 2753 |
first we are looking in the namespace of the application, then in the |
2099 | 2754 |
current namespace and finally in Smalltalk" |
2755 |
||
1419 | 2756 |
^ self resolveName:something inClass:self class |
2757 |
! |
|
2758 |
||
2759 |
resolveName:something inClass:aClass |
|
2760 |
"return the class from something, a class, symbol, string or nil. |
|
1548 | 2761 |
first we are looking in the namespace of the application, |
2099 | 2762 |
then in the current namespace and finally in Smalltalk" |
2763 |
||
1419 | 2764 |
|cls| |
2765 |
||
2766 |
aClass notNil ifTrue:[ |
|
2767 |
(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[ |
|
2768 |
^ cls |
|
2769 |
]. |
|
2770 |
||
2771 |
masterApplication notNil ifTrue:[ |
|
2772 |
^ masterApplication resolveName:something |
|
2773 |
] |
|
2774 |
]. |
|
2775 |
^ nil |
|
2776 |
! |
|
2777 |
||
2380 | 2778 |
selfResponsibleFor:aKey |
2779 |
"internal: return true, if I am to provide a value for some aspect." |
|
2780 |
||
2781 |
^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]]) |
|
2782 |
! |
|
2783 |
||
1419 | 2784 |
topApplication |
2785 |
"return the top-master application" |
|
2786 |
||
2787 |
masterApplication isNil ifTrue:[ |
|
2788 |
^ self |
|
2789 |
]. |
|
2790 |
^ masterApplication topApplication |
|
2791 |
||
2792 |
"Created: / 6.6.1998 / 19:40:42 / cg" |
|
2793 |
! ! |
|
2794 |
||
1766 | 2795 |
!ApplicationModel methodsFor:'startup & release'! |
1419 | 2796 |
|
2797 |
applicationWindowClass |
|
1431 | 2798 |
"return the class used for my (top-) windows" |
2799 |
||
1419 | 2800 |
^ ApplicationWindow |
2801 |
! |
|
2802 |
||
2803 |
close |
|
2804 |
"this is sent by my topView when about to be closed |
|
2805 |
by the program (not by the windowManager). |
|
2806 |
Notice, that we get a closeRequest message if closed by the windowManager, |
|
2807 |
which can be rejected by the app (or confirmed via a dialog) |
|
2808 |
Could be redefined in subclasses." |
|
2809 |
||
2810 |
self closeDownViews |
|
1132
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2811 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
2812 |
|
1419 | 2813 |
closeDownViews |
2814 |
"close down the applications view(s)" |
|
2815 |
||
1700 | 2816 |
|wg wgProcess| |
1419 | 2817 |
|
2818 |
self release. |
|
2819 |
ActiveHelp stopFor:self. |
|
2820 |
||
2821 |
(wg := self windowGroup) notNil ifTrue:[ |
|
2822 |
wgProcess := wg process. |
|
2823 |
(Processor activeProcess ~~ wgProcess |
|
2824 |
and:[wgProcess notNil]) ifTrue:[ |
|
2825 |
wgProcess terminate |
|
2826 |
] ifFalse:[ |
|
2827 |
wg closeDownViews. |
|
2828 |
] |
|
2829 |
] |
|
2830 |
! |
|
2831 |
||
2832 |
closeRequest |
|
2833 |
"this is sent by my topView when about to be closed by the windowManager. |
|
2834 |
Could be redefined in subclasses to suppress close or confirm." |
|
2835 |
||
1528 | 2836 |
|sav window| |
2837 |
||
2838 |
window := self window. |
|
2839 |
window isNil ifTrue:[ |
|
1461
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2840 |
'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR. |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2841 |
^ self |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2842 |
]. |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2843 |
|
1831 | 2844 |
window isTopView ifFalse:[ |
1528 | 2845 |
window topView isModal ifTrue:[ |
1461
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2846 |
WindowGroup leaveSignal raise. |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2847 |
]. |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
2848 |
|
1419 | 2849 |
'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR. |
2850 |
^ self |
|
2851 |
]. |
|
2852 |
||
2853 |
"/ In multiView apps, tell my master. |
|
2854 |
"/ (but not if I am a modal reincarnation) |
|
2855 |
(masterApplication notNil |
|
1528 | 2856 |
and:[window isModal not]) ifTrue:[ |
1419 | 2857 |
|
2858 |
"/ temporary clear my masterApplication to prevent |
|
2859 |
"/ endless recursion, in case the master sends me |
|
2860 |
"/ a closeRequest (although, it is supposed to |
|
2861 |
"/ send me a closeDownViews ...) |
|
2862 |
||
2863 |
sav := masterApplication. |
|
2864 |
masterApplication := nil. |
|
1528 | 2865 |
sav closeRequestFor:window. |
1419 | 2866 |
|
2867 |
"/ restore - in case master did not want me to close ... |
|
2868 |
masterApplication := sav. |
|
2869 |
] ifFalse:[ |
|
2870 |
"/ ST/X does close-check by redefining this message without |
|
2871 |
"/ a supersend; |
|
2872 |
"/ VW does it by returning false from requestForWindowClose |
|
2873 |
"/ sigh. |
|
2874 |
||
2875 |
self requestForWindowClose ifTrue:[ |
|
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2876 |
window isSlave ifTrue:[ |
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2877 |
window destroy |
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2878 |
] ifFalse:[ |
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2879 |
self closeDownViews |
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2880 |
] |
1419 | 2881 |
] |
2882 |
]. |
|
2883 |
||
2884 |
"Modified: / 19.6.1998 / 01:37:17 / cg" |
|
2885 |
! |
|
2886 |
||
2887 |
closeRequestFor:aTopView |
|
2888 |
"this is sent by any of my topViews when about to be closed by the |
|
2889 |
windowmanager. For backward compatibility with single-view applications, |
|
2890 |
this is forwarded here to a simple (non topView-specific) closeRequest, |
|
2891 |
effectively closing all of my views. |
|
2892 |
MultiView applications should redefine this method if closing of individual |
|
2893 |
views closing is to be caught and/or should not close all of them." |
|
2894 |
||
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2895 |
|savedMaster myWindow| |
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2896 |
|
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2897 |
myWindow := self window. |
1419 | 2898 |
|
2899 |
"/ In multiView apps, tell my master. |
|
2900 |
"/ (but not if I am a modal reincarnation) |
|
2901 |
(masterApplication notNil |
|
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2902 |
and:[myWindow topView isModal not]) ifTrue:[ |
1419 | 2903 |
|
2904 |
"/ temporary clear my masterApplication to prevent |
|
2905 |
"/ endless recursion, in case the master sends me |
|
2906 |
"/ a closeRequest (although, it is supposed to |
|
2907 |
"/ send me a closeDownViews ...) |
|
2908 |
||
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2909 |
savedMaster := masterApplication. |
1419 | 2910 |
masterApplication := nil. |
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2911 |
aTopView isSlave ifTrue:[ |
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2912 |
savedMaster closeRequestFor:aTopView. |
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2913 |
] ifFalse:[ |
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2914 |
savedMaster closeRequestFor:myWindow. |
1565
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2915 |
]. |
1419 | 2916 |
|
2917 |
"/ restore - in case master did not want me to close ... |
|
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2918 |
masterApplication := savedMaster. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2919 |
^ self |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2920 |
]. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2921 |
|
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2922 |
(aTopView == myWindow) ifTrue:[ |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2923 |
self closeRequest. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2924 |
^ self |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2925 |
]. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2926 |
|
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2927 |
(aTopView isPartner or:[aTopView isMaster]) ifTrue:[ |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2928 |
aTopView application closeRequest. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2929 |
self closeRequest. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2930 |
^ self. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
2931 |
]. |
1924 | 2932 |
aTopView isSlave ifTrue:[ |
2933 |
aTopView closeRequest |
|
2934 |
] ifFalse:[ |
|
2935 |
aTopView application closeRequest. |
|
2936 |
] |
|
1419 | 2937 |
! |
2938 |
||
2939 |
doAccept |
|
2940 |
"this is invoked by the Return-Key (if returnIsOK) or |
|
2941 |
the ok-button (if any), IFF the application has been |
|
2942 |
opened modal (i.e. as a dialog)." |
|
2943 |
||
2944 |
"/ the following is a bad kludge - |
|
2945 |
"/ actually, modal apps should inherit from SimpleDialog |
|
2946 |
"/ (then, things would be clean) |
|
2947 |
"/ However, it may be useful, to open some app (which is normally |
|
2948 |
"/ modeless) as a modal one as well. |
|
2949 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
|
2950 |
"/ to remember the accept vs. cancel case. |
|
2951 |
"/ |
|
2952 |
self window isModal ifTrue:[ |
|
2128
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2953 |
masterApplication notNil ifTrue:[ |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2954 |
masterApplication window topView == self window topView ifTrue:[ |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2955 |
masterApplication window isModal ifTrue:[ |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2956 |
masterApplication doAccept. |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2957 |
^ self. |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2958 |
]. |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2959 |
]. |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2960 |
]. |
4e5c9e1c12e5
doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
2961 |
|
1419 | 2962 |
"/ mhmh - is this a good idea ? |
1792 | 2963 |
self perform:#accept ifNotUnderstood:[self closeRequest]. |
1419 | 2964 |
^ self |
2965 |
]. |
|
2966 |
||
2967 |
^ self "/ nothing done here ... |
|
2968 |
! |
|
2969 |
||
2970 |
doCancel |
|
2971 |
"this is invoked by the Escape-Key (if escapeIsCancel) or |
|
2972 |
the cancel-button (if any), IFF the application has been |
|
2973 |
opened modal (i.e. as a dialog)." |
|
2974 |
||
2975 |
"/ the following is a bad kludge - |
|
2976 |
"/ actually, modal apps should inherit from SimpleDialog |
|
2977 |
"/ (then, things would be clean) |
|
2978 |
"/ However, it may be useful, to open some app (which is normally |
|
2979 |
"/ modeless) as a modal one as well. |
|
2980 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
|
2981 |
"/ to remember the accept vs. cancel case. |
|
1417 | 2982 |
"/ |
1419 | 2983 |
self window isModal ifTrue:[ |
2984 |
"/ mhmh - is this a good idea ? |
|
1792 | 2985 |
self perform:#cancel ifNotUnderstood:[self closeRequest]. |
1419 | 2986 |
^ self |
2987 |
]. |
|
2988 |
^ self "/ nothing done here ... |
|
2989 |
! |
|
2990 |
||
2991 |
releaseAsSubCanvas |
|
2992 |
"a subcanvas is closed or switching to a new application. |
|
2993 |
Can be redefined to perform a self release in this case." |
|
2994 |
||
2995 |
"/ used to self release here, |
|
2996 |
"/ but that is incompatible to VW (RefactoryBrowser). |
|
2997 |
"/ Therefore, if you need it, you MUST now redefine |
|
2998 |
"/ this method. |
|
2999 |
! |
|
3000 |
||
3001 |
restarted |
|
3002 |
"sent by my topWindow, when restarted from an image. |
|
3003 |
Nothing done here, but can be redefined to perform any actions |
|
3004 |
required to reset the application after an image-restart. |
|
3005 |
(for example: check if application files are still around, restart |
|
3006 |
subprocesses etc.)." |
|
3007 |
||
3008 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
3009 |
! |
|
3010 |
||
3011 |
saveAndTerminateRequest |
|
3012 |
"some windowManagers send this to shut down an application |
|
3013 |
and have it save its state for restart. |
|
3014 |
Can be redefined in subclasses" |
|
3015 |
||
3016 |
self closeRequest |
|
3017 |
! |
|
3018 |
||
3019 |
saveAndTerminateRequestFor:aTopView |
|
3020 |
"some windowManagers send this to shut down an application |
|
3021 |
and have it save its state for restart. |
|
3022 |
Can be redefined in subclasses" |
|
3023 |
||
3024 |
self saveAndTerminateRequest |
|
3025 |
! ! |
|
3026 |
||
3027 |
!ApplicationModel methodsFor:'window events'! |
|
3028 |
||
3029 |
dispatchEvent:event |
|
3030 |
"dispatch a user-pushed event. |
|
3031 |
This allows for events for an appModel to be pushed into the event queue |
|
3032 |
the same way as events for a view are pushable." |
|
3033 |
||
3034 |
^ self |
|
3035 |
dispatchEvent:event |
|
3036 |
withFocusOn:nil |
|
3037 |
delegate:true |
|
3038 |
||
3039 |
! |
|
3040 |
||
3041 |
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
|
3042 |
"dispatch a user-pushed event. |
|
3043 |
This allows for events for an appModel to be pushed into the event queue |
|
3044 |
the same way as events for a view are pushable." |
|
3045 |
||
3046 |
self perform:evType withArguments:evArgs |
|
3047 |
||
3048 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
3049 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
1290 | 3050 |
! |
3051 |
||
1419 | 3052 |
dispatchEvent:ev type:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
3053 |
"dispatch a user-pushed event. |
|
3054 |
This allows for events for an appModel to be pushed into the event queue |
|
3055 |
the same way as events for a view are pushable." |
|
3056 |
||
3057 |
self perform:evType withArguments:evArgs |
|
3058 |
||
3059 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
3060 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
3061 |
! |
|
3062 |
||
3063 |
dispatchEvent:event withFocusOn:focusViewOrNil |
|
3064 |
"dispatch a user-pushed event. |
|
3065 |
This allows for events for an appModel to be pushed into the event queue |
|
3066 |
the same way as events for a view are pushable." |
|
3067 |
||
3068 |
^ self |
|
3069 |
dispatchEvent:event |
|
3070 |
withFocusOn:focusViewOrNil |
|
3071 |
delegate:true |
|
3072 |
||
3073 |
||
3074 |
! |
|
3075 |
||
3076 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
3077 |
"dispatch a user-pushed event. |
|
3078 |
This allows for events for an appModel to be pushed into the event queue |
|
3079 |
the same way as events for a view are pushable." |
|
3080 |
||
3081 |
^ self |
|
3082 |
dispatchEvent:event |
|
3083 |
type:event type |
|
3084 |
arguments:(event arguments) |
|
3085 |
withFocusOn:focusViewOrNil |
|
3086 |
delegate:doDelegate |
|
3087 |
||
3088 |
||
3089 |
! |
|
3090 |
||
3091 |
noticeOfWindowClose:aWindow |
|
1432
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3092 |
"sent when a topView or applicationSubView has been closed. |
1419 | 3093 |
Can be redefined in subclasses for cleanup." |
3094 |
||
1432
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3095 |
"/ ST-80 compatibility |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3096 |
self windowEvent:(#close -> aWindow) from:aWindow. |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3097 |
^ self |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3098 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3099 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3100 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3101 |
! |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3102 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3103 |
noticeOfWindowOpen:aWindow |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3104 |
"sent when a topView or applicationSubView has been opened. |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3105 |
Can be redefined in subclasses." |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3106 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3107 |
"/ ST-80 compatibility |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
3108 |
self windowEvent:(#open -> aWindow) from:aWindow. |
1419 | 3109 |
^ self |
3110 |
||
3111 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
|
3112 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
|
3113 |
! |
|
3114 |
||
3115 |
requestForWindowClose |
|
3116 |
"the applicationWindow wants to know, if a close |
|
3117 |
is ok. Return false if not." |
|
3118 |
||
3119 |
|w k| |
|
3120 |
||
3121 |
builder notNil ifTrue:[ |
|
3122 |
(w := builder window) notNil ifTrue:[ |
|
3123 |
(k := w keyboardProcessor) notNil ifTrue:[ |
|
3124 |
^ k requestForWindowClose |
|
3125 |
] |
|
3126 |
] |
|
3127 |
]. |
|
3128 |
^ true |
|
3129 |
||
3130 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
|
3131 |
"Created: / 19.6.1998 / 01:34:58 / cg" |
|
3132 |
! |
|
3133 |
||
3134 |
showActivity:someMessage |
|
3135 |
"some activityNotification shalt be communicated to |
|
3136 |
the user. Forwarded from the topView and ignored here. |
|
3137 |
Can be redefined in concrete applications to show the |
|
3138 |
message either in some infoView (infoLabel as in Windows) |
|
3139 |
or in the title area (as done in the browsers)" |
|
3140 |
||
3141 |
^ self |
|
3142 |
||
3143 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
3144 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
|
3145 |
! |
|
3146 |
||
3147 |
windowEvent:anEvent from:anApplicationWindow |
|
3148 |
"dummy: windowEvent forwarding is not yet implemented" |
|
3149 |
||
3150 |
^ self |
|
3151 |
||
3152 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
3153 |
! ! |
|
3154 |
||
3155 |
!ApplicationModel class methodsFor:'documentation'! |
|
3156 |
||
1417 | 3157 |
version |
2510
491f20d60c08
Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents:
2496
diff
changeset
|
3158 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.254 2008-06-30 12:32:58 stefan Exp $' |
85 | 3159 |
! ! |
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3160 |
|
1419 | 3161 |
ApplicationModel initialize! |