author | Claus Gittinger <cg@exept.de> |
Sun, 03 Aug 2014 14:36:49 +0200 | |
changeset 3365 | 49cb7d13746c |
parent 3335 | 27092004f1cc |
child 3366 | 55e191acf1b0 |
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' |
3192 | 16 |
classVariableNames:'DefaultLabels DefaultVisuals RecentlyOpenedApplications |
17 |
DefaultExtents' |
|
2396 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-Framework' |
|
138 | 20 |
! |
21 |
||
1419 | 22 |
ApplicationModel class instanceVariableNames:'ClassResources' |
23 |
||
24 |
" |
|
25 |
No other class instance variables are inherited by this class. |
|
26 |
" |
|
1350 | 27 |
! |
28 |
||
1419 | 29 |
!ApplicationModel class methodsFor:'documentation'! |
30 |
||
1417 | 31 |
copyright |
1419 | 32 |
" |
33 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
2396 | 34 |
All Rights Reserved |
1419 | 35 |
|
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
Since many ST-80 classes are subclasses of ApplicationModel, this class |
|
48 |
is provided here to allow easier porting of ST-80 code. |
|
49 |
||
50 |
It does not (currently) provide all functionality and is NOT |
|
51 |
compatible to the corresponding ST80 class; therefore, manual |
|
52 |
changes have to be made to get those applications to run under ST/X. |
|
53 |
(but at least, this enables you to fileIn that code and have a superclass |
|
54 |
for them) |
|
55 |
||
56 |
As time goes by, ST/X applications are going to be converted to |
|
57 |
become subclasses of this abstract class - see Launcher for a |
|
58 |
first concrete example. |
|
59 |
||
60 |
||
61 |
ApplicationModel is prepared to build a view from a windowSpec, as |
|
62 |
created by the windowBuilder. If your subclass does not provide such |
|
63 |
a spec, you should at least redefine: |
|
64 |
||
3297 | 65 |
#openInterface - to create a topview and open it |
1419 | 66 |
|
67 |
you may want to redefine: |
|
68 |
||
3297 | 69 |
#closeRequest - to catch window closing |
70 |
#focusSequence - to define a sequence for focus-stepping |
|
1419 | 71 |
|
72 |
||
73 |
Once the interfaceBuilder is finished & released, subclasses can |
|
74 |
alternatively provide the spec via a #windowSpec method. |
|
75 |
||
76 |
The classResources have been put into this class to allow ST/X |
|
77 |
applications (which used to be subclasses of StandardSystemView) |
|
78 |
to migrate smoothly into ApplicationModels (which is better design ...). |
|
79 |
||
80 |
||
81 |
[Instance variables:] |
|
3297 | 82 |
resources ResourcePack language string translation |
83 |
||
84 |
builder WindowBuilder a builder who knows how to create |
|
85 |
a window hierarchy from a specification |
|
1419 | 86 |
|
87 |
||
88 |
Notice: this class was implemented using protocol information |
|
89 |
from alpha testers and PD code - it may not be complete or compatible to |
|
90 |
the corresponding ST-80 class. If you encounter any incompatibilities, |
|
91 |
please forward a note to the ST/X team. |
|
92 |
||
93 |
||
94 |
[author:] |
|
3297 | 95 |
Claus Gittinger |
1419 | 96 |
|
97 |
[see also:] |
|
3297 | 98 |
StandardSystemView |
99 |
WindowGroup DeviceWorkstation |
|
1419 | 100 |
" |
2527 | 101 |
! |
102 |
||
103 |
howToDealWithMultipleApplicationInstances |
|
104 |
" |
|
105 |
The following relates to StandAlone applications (i.e. compiled exe's) only. |
|
106 |
If the user attempts to open another of the applications documents (after the first instance |
|
107 |
of the application has already been opened), it is sometimes required to notify the first |
|
108 |
application about this and to ask it to open an extra window on the second-clicked document. |
|
109 |
In other words: to get another of the first instances' windows instead of opening a window |
|
110 |
by the second application. |
|
111 |
||
112 |
This is implemented via the following mechanism (see StandaloneStartup): |
|
3297 | 113 |
the first application instance leaves the information about its existence somewhere |
114 |
(under win32: in the registry, the window-ID of its main window is remembered; |
|
115 |
under unix, its stored into a locked file). |
|
116 |
a mutex is created to prevent a race on this informationduring startup |
|
117 |
(under win32: a mutex proper; under unix, the above locked file will do) |
|
2527 | 118 |
|
119 |
when the app is started the second time, it will not be able to aquire the mutex (and therefore |
|
120 |
knows, that its the second instance). It will then send an event-message (win32: via copyData; |
|
121 |
unix. via sendClientEvent), to the first instance and pass the fileName of the document which |
|
122 |
is to be opened. The first instance receives this event and opens another window for it. |
|
123 |
The second instance simply exits and stops execution. |
|
124 |
This guarantees that only one instance of an application is executing (if desired). |
|
125 |
||
126 |
The implementation is found in: |
|
3297 | 127 |
StandaloneStartup: |
128 |
checkForAndExitIfAnotherApplicationInstanceIsRunning |
|
129 |
||
130 |
here: |
|
131 |
processOpenPathCommand:aFilename |
|
2527 | 132 |
|
133 |
By default, the event is ignored - subclasses which want to support that behavior MUST |
|
134 |
redefine processOpenPathCommand: in ApplicationModel and also make sure that |
|
135 |
checkForAndExitIfAnotherApplicationInstanceIsRunning is called for in StandaloneStartup. |
|
3297 | 136 |
|
2527 | 137 |
" |
1419 | 138 |
! ! |
139 |
||
140 |
!ApplicationModel class methodsFor:'initialization'! |
|
141 |
||
3297 | 142 |
initialize |
1419 | 143 |
self == ApplicationModel ifTrue:[ |
3297 | 144 |
Smalltalk addDependent:self |
1419 | 145 |
]. |
146 |
DefaultLabels isNil ifTrue:[ |
|
3297 | 147 |
DefaultLabels := IdentityDictionary new |
1419 | 148 |
]. |
149 |
DefaultVisuals isNil ifTrue:[ |
|
3297 | 150 |
DefaultVisuals := IdentityDictionary new |
1419 | 151 |
]. |
152 |
||
153 |
" |
|
154 |
ApplicationModel initialize |
|
155 |
" |
|
156 |
||
157 |
"Modified: 28.1.1997 / 12:31:38 / cg" |
|
158 |
! ! |
|
159 |
||
160 |
!ApplicationModel class methodsFor:'instance creation'! |
|
161 |
||
162 |
new |
|
163 |
"return a new initialized instance" |
|
164 |
||
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
|
165 |
^ self basicNew basicInitialize; initialize; yourself. |
1419 | 166 |
! |
167 |
||
168 |
onDevice:aDevice |
|
1828 | 169 |
"return a new initialized instance, which shall open its interface on aDevice." |
170 |
||
171 |
^ (super basicNew basicInitialize setDevice:aDevice) initialize |
|
1419 | 172 |
! ! |
173 |
||
174 |
!ApplicationModel class methodsFor:'accessing'! |
|
175 |
||
176 |
application |
|
177 |
^ self |
|
178 |
||
179 |
! ! |
|
180 |
||
181 |
!ApplicationModel class methodsFor:'active help'! |
|
182 |
||
1538 | 183 |
flyByHelpSpec |
184 |
"default is: no help-spec (should be redefined by concrete class if help is wanted)." |
|
185 |
||
2569 | 186 |
^ self helpSpec |
1538 | 187 |
! |
188 |
||
1419 | 189 |
helpSpec |
1431 | 190 |
"default is: no help-spec (should be redefined by concrete class if help is wanted)." |
191 |
||
1419 | 192 |
^ IdentityDictionary new. |
193 |
! ! |
|
194 |
||
195 |
!ApplicationModel class methodsFor:'bindings'! |
|
196 |
||
197 |
actionFor:aKey |
|
198 |
"sent by the builder to ask for an actionBlock for |
|
199 |
a Button. The argument, aKey comes from an UI-spec |
|
200 |
for a buttons #action property. |
|
201 |
Here, a corresponding message is sent to myself, |
|
202 |
which ought to be defined in the application subclass. |
|
203 |
Alternatively, a subclass may redefine this method, to provide |
|
204 |
actionBlocks from a Dictionary or whatever. |
|
205 |
Typically, a block is returned there." |
|
206 |
||
207 |
^ nil |
|
208 |
||
209 |
||
210 |
! |
|
211 |
||
212 |
actionFor:aKey withValue:aValue |
|
213 |
"sent by the builder to ask for an actionBlock for |
|
3297 | 214 |
a Button which passes a value to the actionMethod. |
1419 | 215 |
The argument, aKey comes from an UI-spec |
216 |
for a buttons #action property. |
|
217 |
Here, a corresponding message is sent to myself, |
|
218 |
which ought to be defined in the application subclass. |
|
219 |
Alternatively, a subclass may redefine this method, to provide |
|
220 |
actionBlocks from a Dictionary or whatever. |
|
221 |
Typically, a block is returned there." |
|
222 |
||
223 |
^ nil |
|
224 |
||
225 |
||
226 |
! |
|
227 |
||
228 |
aspectFor:aKey |
|
229 |
"sent by the builder to ask for an aspect (a data model). |
|
230 |
The argument, aKey comes from an UI-spec |
|
231 |
for a components #aspect property. |
|
232 |
Here, a corresponding message is sent to myself, |
|
233 |
which ought to be defined in the application subclass. |
|
234 |
Alternatively, a subclass may redefine this method, to provide |
|
235 |
holders from a Dictionary or whatever. |
|
236 |
Typically, a valueHolder is returned there." |
|
237 |
||
238 |
^ self perform:aKey |
|
239 |
||
240 |
"/ ^ nil |
|
241 |
||
242 |
"Modified: / 27.10.1997 / 13:43:12 / cg" |
|
243 |
! |
|
244 |
||
245 |
clientFor:aKey |
|
246 |
"sent by the builder to ask for an application provided |
|
247 |
subcanvas's application. |
|
248 |
The argument, aKey comes from an UI-spec |
|
249 |
for a subcanvas's #client property. |
|
250 |
Here, a corresponding message is sent to myself, |
|
251 |
which ought to be defined in the application subclass. |
|
252 |
Alternatively, a subclass may redefine this method, to provide |
|
253 |
appModels from a Dictionary or whatever. |
|
254 |
Typically, an applicationModel is returned there." |
|
255 |
||
256 |
^ nil |
|
257 |
||
258 |
! |
|
259 |
||
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
260 |
colorFor:aSymbol |
2472 | 261 |
"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
|
262 |
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
|
263 |
for a widgets #*Color property. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
264 |
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
|
265 |
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
|
266 |
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
|
267 |
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
|
268 |
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
|
269 |
|
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
270 |
(self respondsTo:aSymbol) ifTrue:[ |
3297 | 271 |
^ (self perform:aSymbol) value. |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
272 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
273 |
|
2481
1fc2941fe30e
#colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents:
2472
diff
changeset
|
274 |
"fall back to a possibly well defined color name" |
1fc2941fe30e
#colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents:
2472
diff
changeset
|
275 |
^ 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
|
276 |
! |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
277 |
|
1419 | 278 |
componentFor:aKey |
279 |
"sent by the builder to ask for an application provided |
|
280 |
component. |
|
281 |
The argument, aKey comes from an UI-spec |
|
282 |
for a viewHolders #view 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 |
holders from a Dictionary or whatever. |
|
287 |
Typically, a view is returned there." |
|
288 |
||
289 |
(self respondsTo:aKey) ifTrue:[ |
|
3297 | 290 |
^ self perform:aKey |
1419 | 291 |
]. |
292 |
^ nil |
|
293 |
! |
|
294 |
||
2472 | 295 |
fontFor:aSymbol |
296 |
"sent by the builder to ask for an application provided font. |
|
297 |
The argument, aKey comes from an UI-spec |
|
298 |
for a widgets #*Font property. |
|
299 |
Here, a corresponding message is sent to myself, |
|
300 |
which ought to be defined in the application subclass. |
|
301 |
Alternatively, a subclass may redefine this method, to provide |
|
302 |
holders from a Dictionary or whatever. |
|
303 |
Typically, a font is returned there." |
|
304 |
||
305 |
(self respondsTo:aSymbol) ifTrue:[ |
|
3297 | 306 |
^ self perform:aSymbol. |
2472 | 307 |
]. |
308 |
||
309 |
"/ "fall back to a well defined font name" |
|
310 |
"/ (Font respondsTo:aSymbol) ifTrue:[ |
|
311 |
"/ ^ Font perform:aSymbol. |
|
312 |
"/ ]. |
|
313 |
^ nil |
|
314 |
! |
|
315 |
||
1419 | 316 |
labelFor:aKey |
317 |
"sent by the builder to ask for an application provided |
|
318 |
label for a component. |
|
319 |
The argument, aKey comes from an UI-spec |
|
320 |
for a components #label property. |
|
321 |
Here, a corresponding message is sent to myself, |
|
322 |
which ought to be defined in the application subclass. |
|
323 |
Alternatively, a subclass may redefine this method, to provide |
|
324 |
labels from a Dictionary or whatever. |
|
325 |
Typically, a string is returned there." |
|
326 |
||
2058 | 327 |
|app| |
328 |
||
329 |
app := self application. |
|
330 |
app isNil ifTrue:[^ nil]. |
|
331 |
(app respondsTo:aKey) ifTrue:[ |
|
3297 | 332 |
^ app perform:aKey |
1419 | 333 |
]. |
2058 | 334 |
^ app labelAt:aKey ifAbsent:nil |
1419 | 335 |
! |
336 |
||
337 |
listFor:aKey |
|
338 |
"sent by the builder to ask for an application provided |
|
339 |
holder for a list. |
|
340 |
The argument, aKey comes from an UI-spec |
|
341 |
for a listWidgets #list property. |
|
342 |
Here, a corresponding message is sent to myself, |
|
343 |
which ought to be defined in the application subclass. |
|
344 |
Alternatively, a subclass may redefine this method, to provide |
|
345 |
holders from a Dictionary or whatever. |
|
346 |
Typically, a list-holding model (SelectionInList) is returned there." |
|
347 |
||
348 |
|app| |
|
349 |
||
2058 | 350 |
app := self application. |
351 |
app notNil ifTrue:[ |
|
3297 | 352 |
(app respondsTo:aKey) ifTrue:[ |
353 |
^ app perform:aKey |
|
354 |
] |
|
1419 | 355 |
]. |
356 |
^ nil. |
|
357 |
||
358 |
"Modified: 4.3.1997 / 00:53:03 / cg" |
|
359 |
! |
|
360 |
||
361 |
menuFor:aKey |
|
362 |
"sent by the builder to ask for an application provided |
|
363 |
holder for a menu. |
|
364 |
The argument, aKey comes from an UI-spec |
|
365 |
for a widgets #menu property. |
|
366 |
Here, a corresponding message is sent to myself, |
|
367 |
which ought to be defined in the application subclass. |
|
368 |
Alternatively, a subclass may redefine this method, to provide |
|
369 |
holders from a Dictionary or whatever. |
|
370 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
371 |
||
372 |
^ self application perform:aKey |
|
373 |
||
374 |
! |
|
375 |
||
376 |
specificationFor:aKey |
|
377 |
"sent by the builder to ask for an application provided |
|
378 |
specification for a subcanvas or subspecification. |
|
379 |
The argument, aKey comes from an UI-spec |
|
380 |
for a subcanvases #specification property (minorKey). |
|
381 |
Here, a corresponding message is sent to myself, |
|
382 |
which ought to be defined in the application subclass. |
|
383 |
Alternatively, a subclass may redefine this method, to provide |
|
384 |
interfaceSpecifications from a Dictionary or whatever. |
|
385 |
Typically, an interfaceSpecification is returned there." |
|
386 |
||
1584 | 387 |
^ self |
3297 | 388 |
specificationFor:aKey |
389 |
application:self |
|
390 |
onDevice:nil |
|
1584 | 391 |
! |
392 |
||
393 |
specificationFor:aKey application:app onDevice:deviceOrNil |
|
394 |
"sent by the builder to ask for an application provided |
|
395 |
specification for a subcanvas or subspecification. |
|
396 |
The argument, aKey comes from an UI-spec |
|
397 |
for a subcanvases #specification property (minorKey). |
|
398 |
Here, a corresponding message is sent to myself, |
|
399 |
which ought to be defined in the application subclass. |
|
400 |
Alternatively, a subclass may redefine this method, to provide |
|
401 |
interfaceSpecifications from a Dictionary or whatever. |
|
402 |
Typically, an interfaceSpecification is returned there." |
|
403 |
||
404 |
|displayDevice displayDeviceType modifiedKey appClass| |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
405 |
|
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
406 |
"/ this code is so ugly... |
1584 | 407 |
"/ translate the specs name, if the display device type is different |
408 |
"/ for example, if the type is pda, the xxxSpec_pda spec will be used. |
|
2926
d6663298affa
changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
409 |
displayDevice := deviceOrNil. |
d6663298affa
changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
410 |
displayDevice isNil ifTrue:[ |
3297 | 411 |
displayDevice := Screen current. |
412 |
displayDevice isNil ifTrue:[ |
|
413 |
displayDevice := Screen default. |
|
414 |
] |
|
2926
d6663298affa
changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
415 |
]. |
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
416 |
displayDevice notNil ifTrue:[ |
3297 | 417 |
displayDeviceType := displayDevice deviceType. |
418 |
displayDeviceType notNil ifTrue:[ |
|
419 |
modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned. |
|
420 |
modifiedKey notNil ifTrue:[ |
|
421 |
(app respondsTo:modifiedKey) ifTrue:[ |
|
422 |
^ app perform:modifiedKey |
|
423 |
]. |
|
424 |
app isBehavior ifFalse:[ |
|
425 |
appClass := app application. |
|
426 |
(appClass respondsTo:modifiedKey) ifTrue:[ |
|
427 |
^ appClass perform:modifiedKey |
|
428 |
]. |
|
429 |
]. |
|
430 |
] |
|
431 |
] |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
432 |
]. |
1584 | 433 |
|
434 |
app isBehavior ifFalse:[ |
|
3297 | 435 |
(app respondsTo:aKey) ifTrue:[ |
436 |
^ app perform:aKey |
|
437 |
]. |
|
438 |
appClass := app application. |
|
439 |
(appClass respondsTo:aKey) ifTrue:[ |
|
440 |
^ appClass perform:aKey |
|
441 |
]. |
|
442 |
^ app masterApplication specificationFor:aKey |
|
1584 | 443 |
]. |
444 |
||
445 |
^ app perform:aKey |
|
2926
d6663298affa
changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
446 |
|
d6663298affa
changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents:
2923
diff
changeset
|
447 |
"Modified: / 18-07-2011 / 09:28:15 / cg" |
1115 | 448 |
! |
449 |
||
2058 | 450 |
subApplicationFor:aKey |
3297 | 451 |
"sent by subCanvas to ask for an application inside itself. |
2058 | 452 |
The argument, aKey comes from a TabList-specs majorKey. |
453 |
Here, a corresponding message is sent to myself, |
|
454 |
which ought to be defined in the application subclass. |
|
455 |
Alternatively, a subclass may redefine this method, to provide |
|
456 |
an application from a Dictionary or whatever. |
|
457 |
Typically, an ApplicationModel subinstance is returned there." |
|
458 |
||
459 |
|app| |
|
460 |
||
461 |
app := self application. |
|
462 |
(app respondsTo:aKey) ifTrue:[ |
|
3297 | 463 |
^ app perform:aKey |
2058 | 464 |
]. |
465 |
^ nil |
|
466 |
! |
|
467 |
||
1419 | 468 |
visualFor:aKey |
469 |
"sent by the builder to ask for an application provided |
|
470 |
image or element for a label. |
|
471 |
The argument, aKey comes from an UI-spec |
|
472 |
for a widgets #label property, if LabelIsImage is turned on. |
|
473 |
Here, a corresponding message is sent to myself, |
|
474 |
which ought to be defined in the application subclass. |
|
475 |
Alternatively, a subclass may redefine this method, to provide |
|
476 |
images from a Dictionary or whatever. |
|
477 |
Typically, an image is returned there." |
|
478 |
||
1781 | 479 |
|app| |
480 |
||
481 |
app := self application. |
|
482 |
(app respondsTo:aKey) ifTrue:[ |
|
3297 | 483 |
^ app perform:aKey |
1419 | 484 |
]. |
1781 | 485 |
^ app visualAt:aKey ifAbsent:nil |
1419 | 486 |
! ! |
487 |
||
488 |
!ApplicationModel class methodsFor:'change & update'! |
|
489 |
||
490 |
update:something with:aParameter from:changedObject |
|
491 |
"flush resources on language changes" |
|
492 |
||
493 |
something == #Language ifTrue:[ |
|
3297 | 494 |
self flushAllClassResources |
1419 | 495 |
] |
496 |
||
497 |
"Created: 15.6.1996 / 15:13:29 / cg" |
|
498 |
! ! |
|
499 |
||
500 |
!ApplicationModel class methodsFor:'defaults'! |
|
501 |
||
3209 | 502 |
defaultExtentFor:anApplicationClass |
503 |
DefaultExtents notNil ifTrue:[ |
|
3297 | 504 |
UserPreferences current shouldRememberLastExtent ifTrue:[ |
505 |
^ DefaultExtents at:anApplicationClass name ifAbsent:nil |
|
506 |
] ifFalse:[ |
|
507 |
DefaultExtents := nil. |
|
508 |
] |
|
3209 | 509 |
]. |
510 |
^ nil. |
|
511 |
||
512 |
"Modified: / 31-07-2013 / 18:20:28 / cg" |
|
513 |
! |
|
514 |
||
2554
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
515 |
defaultHttpServerPort |
2769 | 516 |
"this is only used for web-applications" |
517 |
||
2554
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
518 |
^ HTTPServer defaultPort |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
519 |
! |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
520 |
|
1419 | 521 |
defaultIcon |
1431 | 522 |
"default is: no icon (should be redefined by concrete class if an icon is wanted)." |
523 |
||
1419 | 524 |
^ nil |
525 |
! |
|
526 |
||
2496
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
527 |
defaultIconForAboutBox |
2769 | 528 |
"the icon to be shown in my about-this-app dialog" |
529 |
||
2496
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
530 |
^ self defaultIcon |
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
531 |
! |
133bb0589d18
allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
532 |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
533 |
defaultServiceLinkName |
2580 | 534 |
"old web server interface - remove me" |
535 |
||
536 |
<resource: #obsolete> |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
537 |
^ '/portal' |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
538 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
539 |
|
1419 | 540 |
labelAt:aKey |
1431 | 541 |
"default is: no label (could be redefined by concrete class )." |
542 |
||
1419 | 543 |
^ nil |
544 |
! |
|
545 |
||
546 |
labelAt:aKey ifAbsent:aBlock |
|
1431 | 547 |
"default is: no label (could be redefined by concrete class )." |
548 |
||
1419 | 549 |
^ aBlock value |
550 |
! |
|
551 |
||
552 |
labelAt:aKey put:aValue |
|
553 |
"/ not yet implemented |
|
554 |
! |
|
555 |
||
556 |
labels |
|
557 |
"/ not yet implemented |
|
558 |
^ nil |
|
559 |
! |
|
560 |
||
561 |
visualAt:aKey |
|
1431 | 562 |
"default is: no visual (could be redefined by concrete class )." |
563 |
||
1419 | 564 |
^ nil |
565 |
! |
|
566 |
||
567 |
visualAt:aKey ifAbsent:aBlock |
|
1431 | 568 |
"default is: no visual (could be redefined by concrete class )." |
569 |
||
1419 | 570 |
^ aBlock value |
571 |
! |
|
572 |
||
573 |
visualAt:aKey put:aValue |
|
574 |
"/ not yet implemented |
|
575 |
! |
|
576 |
||
577 |
visuals |
|
578 |
"/ not yet implemented |
|
579 |
^ nil |
|
580 |
! ! |
|
581 |
||
3307 | 582 |
!ApplicationModel class methodsFor:'font helpers'! |
583 |
||
3308 | 584 |
resolveFont:aSelector |
585 |
"resolve the font descriobed by aSelector. |
|
586 |
Delegate to a WindowBuilder, whuch may forward to self fontOn:" |
|
587 |
||
588 |
|builder| |
|
589 |
||
590 |
builder := UIBuilder new isEditing:true; applicationClass:self. |
|
591 |
^ builder resolveFont:aSelector. |
|
3307 | 592 |
! ! |
593 |
||
3335 | 594 |
!ApplicationModel class methodsFor:'font specs'! |
595 |
||
596 |
buttonFont |
|
597 |
<resource: #fontSpec> |
|
598 |
||
599 |
^ Button defaultFont |
|
600 |
! |
|
601 |
||
602 |
inputFont |
|
603 |
<resource: #fontSpec> |
|
604 |
||
605 |
^ EditField defaultFont |
|
606 |
! |
|
607 |
||
608 |
labelFont |
|
609 |
<resource: #fontSpec> |
|
610 |
||
611 |
^ Label defaultFont |
|
612 |
! |
|
613 |
||
614 |
listFont |
|
615 |
<resource: #fontSpec> |
|
616 |
||
617 |
^ SelectionInListView defaultFont |
|
618 |
! |
|
619 |
||
620 |
menuFont |
|
621 |
<resource: #fontSpec> |
|
622 |
||
623 |
^ MenuView defaultFont |
|
624 |
! |
|
625 |
||
626 |
textFont |
|
627 |
<resource: #fontSpec> |
|
628 |
||
629 |
^ TextView defaultFont |
|
630 |
! ! |
|
631 |
||
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
632 |
!ApplicationModel class methodsFor:'help'! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
633 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
634 |
aboutImage |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
635 |
"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
|
636 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
637 |
^ self defaultIcon |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
638 |
! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
639 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
640 |
aboutThisApplicationLabel |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
641 |
"label for an about box for this application." |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
642 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
643 |
^ 'About This Application' |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
644 |
! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
645 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
646 |
aboutThisApplicationText |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
647 |
"text for an about box for this application." |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
648 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
649 |
|rev clsRev msg| |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
650 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
651 |
rev := ''. |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
652 |
|
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
653 |
(clsRev := self revision) notNil ifTrue: [rev := ' (rev: ', clsRev printString, ')']. |
2981
da09f3d57773
changed: #aboutThisApplicationText
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
654 |
msg := "'\' withCRs ," self name asBoldText, rev. |
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
655 |
^ msg |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
656 |
|
2981
da09f3d57773
changed: #aboutThisApplicationText
Claus Gittinger <cg@exept.de>
parents:
2980
diff
changeset
|
657 |
"Created: / 13-11-2001 / 12:28:36 / cg" |
2382 | 658 |
! |
659 |
||
660 |
documentationPath |
|
661 |
|packageDir| |
|
662 |
||
663 |
packageDir := Smalltalk getPackageDirectoryForPackage:(self package). |
|
664 |
packageDir isNil ifTrue:[ |
|
3297 | 665 |
packageDir := Filename defaultDirectory |
2382 | 666 |
]. |
667 |
#( |
|
3297 | 668 |
'documentation' |
669 |
'doc' |
|
2382 | 670 |
) do:[:subDir | |
3297 | 671 |
(packageDir construct:subDir) exists ifTrue:[ |
672 |
^ packageDir construct:subDir |
|
673 |
]. |
|
2382 | 674 |
]. |
675 |
^ packageDir construct:'doc' |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
676 |
! ! |
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
677 |
|
2797 | 678 |
!ApplicationModel class methodsFor:'history'! |
679 |
||
680 |
forgetRecentlyOpenedApplications |
|
681 |
RecentlyOpenedApplications := nil |
|
682 |
! |
|
683 |
||
684 |
recentlyOpenedApplications |
|
685 |
^ RecentlyOpenedApplications ? #() |
|
686 |
! |
|
687 |
||
688 |
rememberRecentlyOpenedApplication |
|
689 |
RecentlyOpenedApplications isNil ifTrue:[ |
|
3297 | 690 |
RecentlyOpenedApplications := OrderedCollection new. |
2797 | 691 |
]. |
692 |
RecentlyOpenedApplications remove:(self name) ifAbsent:[]. |
|
693 |
RecentlyOpenedApplications addFirst:(self name). |
|
694 |
! ! |
|
695 |
||
1997 | 696 |
!ApplicationModel class methodsFor:'private'! |
697 |
||
698 |
selfResponsibleFor:aKey |
|
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
699 |
<resource: #obsolete> |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
700 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
701 |
self obsoleteMethodWarning:'obsoleted for de-obfuscation'. |
1997 | 702 |
^ self respondsTo:aKey |
703 |
! ! |
|
704 |
||
1419 | 705 |
!ApplicationModel class methodsFor:'queries'! |
706 |
||
707 |
interfaceSpecFor:aSelector |
|
708 |
"return an interface spec" |
|
3297 | 709 |
|
2850 | 710 |
|specOrSpecArray| |
711 |
||
712 |
specOrSpecArray := self application specificationFor:aSelector. |
|
713 |
specOrSpecArray isNil ifTrue:[^ nil]. |
|
714 |
||
715 |
"/ app could already return a decoded spec |
|
716 |
specOrSpecArray isCollection ifFalse:[^ specOrSpecArray]. |
|
717 |
||
718 |
"/ app returns a literal array |
|
719 |
specOrSpecArray class missingClassInLiteralArrayErrorSignal |
|
3297 | 720 |
handle:[:ex | |
721 |
|clsInMyNamespace className| |
|
722 |
||
723 |
className := ex parameter. |
|
724 |
className isSymbol ifTrue:[ |
|
725 |
"retry with my nameSpace" |
|
726 |
clsInMyNamespace := self nameSpace at:className. |
|
727 |
clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace]. |
|
728 |
]. |
|
729 |
self warn:ex description. |
|
730 |
ex proceedWith:nil |
|
731 |
] |
|
732 |
do:[ |
|
733 |
^ UISpecification from:specOrSpecArray |
|
734 |
] |
|
2287
fc04b196d28c
care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents:
2270
diff
changeset
|
735 |
|
2850 | 736 |
"Modified: / 25-07-2010 / 10:36:53 / cg" |
1419 | 737 |
! |
738 |
||
2999 | 739 |
isAbstract |
740 |
^ self == ApplicationModel |
|
741 |
||
742 |
" |
|
743 |
self isAbstract |
|
744 |
" |
|
745 |
||
746 |
"Created: / 02-03-2012 / 15:56:48 / cg" |
|
747 |
! |
|
748 |
||
1419 | 749 |
isVisualStartable |
1427 | 750 |
"return true, if this application can be started via #open. |
751 |
(to allow start of a change browser via double-click in the browser)" |
|
1419 | 752 |
|
2999 | 753 |
(self isAbstract) ifTrue:[^ false "I am abstract"]. |
1556
388922a9c6eb
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
1548
diff
changeset
|
754 |
((self respondsTo:#open) or:[self class includesSelector:#openInterface]) ifFalse:[^ false]. |
1419 | 755 |
"/ (self respondsTo:#windowSpec) ifFalse:[^ false]. |
756 |
^ true |
|
757 |
||
2999 | 758 |
"Created: / 27-10-1997 / 16:38:02 / cg" |
759 |
"Modified: / 02-03-2012 / 15:57:02 / cg" |
|
3192 | 760 |
! |
761 |
||
762 |
shouldRememberLastExtent |
|
763 |
"to be redefined by concrete applications: |
|
764 |
if true is answered, the application's extent is remembered on close |
|
765 |
and used as a default when opened the next time" |
|
766 |
||
3207 | 767 |
^ UserPreferences current shouldRememberLastExtent |
768 |
||
769 |
"Modified: / 31-07-2013 / 18:12:07 / cg" |
|
1419 | 770 |
! ! |
771 |
||
772 |
!ApplicationModel class methodsFor:'resources'! |
|
773 |
||
774 |
classResources |
|
1955
257a4acb852b
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
1924
diff
changeset
|
775 |
"if not already loaded, get the classes resourcePack and return it" |
1419 | 776 |
|
777 |
ClassResources isNil ifTrue:[ |
|
3297 | 778 |
ClassResources := super classResources. |
1419 | 779 |
]. |
780 |
^ ClassResources |
|
781 |
! |
|
782 |
||
783 |
classResources:aResourcePack |
|
784 |
"allow setting of the classResources" |
|
785 |
||
786 |
ClassResources := aResourcePack |
|
787 |
! |
|
788 |
||
789 |
flushAllClassResources |
|
790 |
"flush all classes resource translations. |
|
791 |
Needed after a resource file / language setting has changed." |
|
792 |
||
793 |
ResourcePack flushCachedResourcePacks. |
|
794 |
self flushClassResources. |
|
795 |
self allSubclassesDo:[:aClass | |
|
3297 | 796 |
aClass flushClassResources. |
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
797 |
]. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
798 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
799 |
WindowGroup scheduledWindowGroups |
3297 | 800 |
do:[:wg | |
801 |
|app| |
|
802 |
||
803 |
(app := wg application) notNil ifTrue:[ |
|
804 |
app initializeResources |
|
805 |
] |
|
806 |
] |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
807 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
808 |
"Modified: / 13-09-2006 / 12:41:31 / cg" |
1419 | 809 |
! |
810 |
||
811 |
flushClassResources |
|
812 |
"flush classes resource string translations. |
|
813 |
Needed whenever a resource file / language setting has changed" |
|
814 |
||
815 |
ClassResources := nil. |
|
816 |
! |
|
817 |
||
818 |
resources |
|
3297 | 819 |
"return the applications resources - |
2609
a78a9e0380b1
added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents:
2605
diff
changeset
|
820 |
that's a ResourcePack containing national language strings" |
1419 | 821 |
|
822 |
^ self classResources |
|
823 |
||
824 |
"Created: / 19.5.1998 / 20:14:00 / cg" |
|
825 |
! |
|
826 |
||
827 |
updateClassResources |
|
828 |
"update my classResources" |
|
829 |
||
830 |
ClassResources := nil. |
|
831 |
self classResources |
|
832 |
! ! |
|
833 |
||
834 |
!ApplicationModel class methodsFor:'startup'! |
|
835 |
||
836 |
open |
|
837 |
"create an instance of the application and open its view" |
|
838 |
||
2797 | 839 |
self rememberRecentlyOpenedApplication. |
1419 | 840 |
^ self new open |
841 |
||
842 |
" |
|
843 |
Launcher open |
|
844 |
" |
|
845 |
||
846 |
"Modified: 13.1.1997 / 20:54:50 / cg" |
|
847 |
! |
|
848 |
||
849 |
openAt:aLocation |
|
850 |
"create an instance of the application and open its view |
|
851 |
at some position." |
|
852 |
||
2797 | 853 |
self rememberRecentlyOpenedApplication. |
1419 | 854 |
^ self new openAt:aLocation |
855 |
||
856 |
"Modified: 14.2.1997 / 20:28:41 / cg" |
|
857 |
! |
|
858 |
||
859 |
openDialogInterface:anInterfaceSymbol |
|
860 |
"create an instance of the application and open a view as |
|
861 |
specified by anInterfaceSymbol." |
|
862 |
||
863 |
^ self openDialogInterface:anInterfaceSymbol withBindings:nil |
|
864 |
||
865 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
866 |
"Created: 14.2.1997 / 20:33:10 / cg" |
|
867 |
"Modified: 28.2.1997 / 14:07:36 / cg" |
|
868 |
! |
|
869 |
||
870 |
openDialogInterface:anInterfaceSymbol withBindings:bindings |
|
871 |
"create an instance of the application and open a view as |
|
872 |
specified by anInterfaceSymbol." |
|
873 |
||
874 |
^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings |
|
875 |
||
876 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
877 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
878 |
"Created: 28.2.1997 / 14:07:24 / cg" |
|
879 |
! |
|
880 |
||
881 |
openDialogInterfaceSpec:anInterfaceSpec |
|
882 |
"create an instance of the application and open a view as |
|
883 |
specified by the given spec." |
|
884 |
||
3297 | 885 |
^ self new |
886 |
openDialogInterfaceSpec:anInterfaceSpec |
|
887 |
withBindings:nil |
|
1419 | 888 |
! |
889 |
||
890 |
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings |
|
891 |
"create an instance of the application and open a view as |
|
892 |
specified by the given spec." |
|
893 |
||
3297 | 894 |
^ self new |
895 |
openDialogInterfaceSpec:anInterfaceSpec |
|
896 |
withBindings:bindings |
|
1419 | 897 |
|
898 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
899 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
900 |
"Created: 28.2.1997 / 14:07:24 / cg" |
|
901 |
! |
|
902 |
||
903 |
openDialogSpec:aSpec |
|
904 |
"create an instance of the application and open a view as |
|
905 |
specified by aSpec." |
|
906 |
||
907 |
^ self openDialogSpec:aSpec withBindings:nil |
|
908 |
||
909 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
|
910 |
"Modified: / 28.2.1997 / 14:07:36 / cg" |
|
911 |
"Created: / 20.5.1998 / 20:27:08 / cg" |
|
912 |
! |
|
913 |
||
914 |
openDialogSpec:aSpec withBindings:bindings |
|
915 |
"create an instance of the application and open a view as |
|
916 |
specified by the spec." |
|
917 |
||
3297 | 918 |
^ self new |
919 |
openDialogSpec:aSpec |
|
920 |
withBindings:bindings |
|
1419 | 921 |
|
922 |
"Modified: / 5.9.1995 / 17:54:50 / claus" |
|
923 |
"Modified: / 13.1.1997 / 20:55:02 / cg" |
|
924 |
"Created: / 20.5.1998 / 20:26:37 / cg" |
|
925 |
! |
|
926 |
||
927 |
openInterface:anInterfaceSymbol |
|
928 |
"create an instance of the application and open a view as |
|
929 |
specified by anInterfaceSymbol." |
|
930 |
||
931 |
^ self new openInterface:anInterfaceSymbol |
|
932 |
||
933 |
"Modified: 5.9.1995 / 17:54:50 / claus" |
|
934 |
"Modified: 13.1.1997 / 20:55:02 / cg" |
|
935 |
! |
|
936 |
||
937 |
openInterface:anInterfaceSymbol at:aPoint |
|
938 |
"create an instance of the application and open a view as |
|
939 |
specified by anInterfaceSymbol." |
|
940 |
||
941 |
^ self new openInterface:anInterfaceSymbol at:aPoint |
|
942 |
||
943 |
"Modified: 14.2.1997 / 20:28:47 / cg" |
|
944 |
! |
|
945 |
||
2843 | 946 |
openLauncherOnInitializedDisplayNamed:displayName |
947 |
|display app wsClass| |
|
948 |
||
949 |
wsClass := Smalltalk classNamed:#XWorkstation. |
|
950 |
wsClass isNil ifTrue:[ |
|
3297 | 951 |
self error:'XWorkstation has not been loaded' |
952 |
]. |
|
2843 | 953 |
|
954 |
[ |
|
3297 | 955 |
display := wsClass newDispatchingFor:displayName. |
956 |
display deviceIOErrorSignal handlerBlock:[:ex | |
|
957 |
'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint. |
|
958 |
display errorPrintCR. |
|
959 |
display brokenConnection. |
|
960 |
]. |
|
961 |
||
962 |
Screen currentScreenQuerySignal answer:display do:[ |
|
963 |
Screen default isNil ifTrue:[ |
|
964 |
Smalltalk secureFileIn:'keyboard.rc'. |
|
965 |
"/ Smalltalk secureFileIn:'display.rc'. |
|
966 |
display buttonTranslation:#(1 2 2 4 5 6 7). |
|
967 |
Screen default:display. |
|
968 |
]. |
|
969 |
||
970 |
app := NewLauncher new openAndWaitUntilVisible. |
|
971 |
app windowGroup isNil ifTrue:[ |
|
972 |
"terminate event processor on error" |
|
973 |
display stopDispatch. |
|
974 |
self error:'Cannot open'. |
|
975 |
] ifFalse:[ |
|
976 |
app windowGroup process addExitAction:[ |
|
977 |
"reset the default display" |
|
978 |
Screen default == display ifTrue:[ |
|
979 |
Screen default:nil. |
|
980 |
]. |
|
981 |
]. |
|
982 |
]. |
|
983 |
] |
|
2843 | 984 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
3297 | 985 |
self error:('Cannot connect to display: <1s><br><2s>' |
986 |
expandMacrosWith:displayName with:ex description). |
|
2843 | 987 |
]. |
988 |
^ app |
|
989 |
||
990 |
"Created: / 01-06-2010 / 11:23:52 / sr" |
|
991 |
! |
|
992 |
||
1419 | 993 |
openModal |
994 |
"create an instance of the application and open its view modal" |
|
995 |
||
996 |
^ self new openModal |
|
997 |
! |
|
998 |
||
999 |
openOn:anApplicationModel |
|
1000 |
"send an open message to the argument, anApplicationModel. |
|
3110 | 1001 |
I don't really understand what this method is useful for ..." |
1419 | 1002 |
|
1003 |
^ anApplicationModel open |
|
1004 |
||
1005 |
"Modified: 13.1.1997 / 20:55:05 / cg" |
|
1006 |
! |
|
1007 |
||
1008 |
openOnDevice:aDevice |
|
1009 |
"create an instance of the application and open its view |
|
3297 | 1010 |
on ANOTHER device. |
1419 | 1011 |
For more info, read the document on multiple display |
1012 |
support and the documentation of the DeviceWorkstation class." |
|
1013 |
||
3297 | 1014 |
Screen currentScreenQuerySignal |
1015 |
answer:aDevice |
|
1016 |
do:[ |
|
1017 |
^ (self onDevice:aDevice) open |
|
1018 |
] |
|
1419 | 1019 |
|
1020 |
" |
|
1021 |
Launcher openOnDevice:Display |
|
1022 |
" |
|
1023 |
||
1024 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
1025 |
! |
|
1026 |
||
1027 |
openOnXScreenNamed:aScreenName |
|
1028 |
"create an instance of the application and open its view |
|
3297 | 1029 |
on some X display screen. The argument aScreenName must be |
1419 | 1030 |
a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0'). |
1031 |
For more info, read the document on multiple display |
|
1032 |
support and the documentation of the DeviceWorkstation class." |
|
1033 |
||
1570
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
1034 |
|newDevice| |
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
1035 |
|
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
1036 |
[ |
3297 | 1037 |
newDevice := XWorkstation newDispatchingFor:aScreenName. |
1570
5ef90b35b7d6
Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents:
1565
diff
changeset
|
1038 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
3297 | 1039 |
self warn:'Could not open display: ' , aScreenName. |
1040 |
^ self |
|
995
63d1b9ce554b
Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents:
983
diff
changeset
|
1041 |
]. |
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
1042 |
^ self openOnDevice:newDevice. |
1419 | 1043 |
|
1044 |
" |
|
1045 |
Launcher openOnXScreenNamed:'sgi:0' |
|
1046 |
Launcher openOnXScreenNamed:'foo:0' |
|
1047 |
NewLauncher openOnXScreenNamed:'dawn:0' |
|
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
1048 |
NewLauncher openOnXScreenNamed:'bitsy:0' |
1419 | 1049 |
SystemBrowser openOnXScreenNamed:'dawn:0' |
1479
c30179d243db
allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents:
1478
diff
changeset
|
1050 |
SystemBrowser openOnXScreenNamed:'bitsy:0' |
1419 | 1051 |
" |
1052 |
||
1053 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
1054 |
! |
|
1055 |
||
1056 |
openWithSpec:aSpecSymbol |
|
1057 |
"ST80 compatibility: |
|
1058 |
mhmh - what is the difference to #openInterface ?" |
|
1059 |
||
1060 |
^ self openInterface:aSpecSymbol |
|
1061 |
||
1062 |
"Modified: 29.8.1997 / 01:16:52 / cg" |
|
2542 | 1063 |
! ! |
1064 |
||
1065 |
!ApplicationModel class methodsFor:'startup-web applications'! |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1066 |
|
2568 | 1067 |
initialPageSpec |
2769 | 1068 |
"this is only required for web-applications" |
1069 |
||
2568 | 1070 |
self subclassResponsibility |
1071 |
! |
|
1072 |
||
1073 |
pageSpec |
|
2769 | 1074 |
"this is only used for web-applications" |
1075 |
||
2568 | 1076 |
^ self windowSpec |
1077 |
! |
|
1078 |
||
1079 |
pageSpecs |
|
2769 | 1080 |
"this is only required for web-applications" |
1081 |
||
2568 | 1082 |
self subclassResponsibility |
1083 |
! |
|
1084 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1085 |
startAsWebService |
2631 | 1086 |
"this is not yet a public interface. For internal exept use only. |
1087 |
Start a web service for myself on the default webService linkURL. |
|
1088 |
The webService will create new instances of me for incoming sessions. |
|
1089 |
Answer the webService." |
|
2604
68f9951ec611
startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents:
2586
diff
changeset
|
1090 |
|
68f9951ec611
startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents:
2586
diff
changeset
|
1091 |
^ self startAsWebService:(self webServiceLinkName) |
2579 | 1092 |
|
1093 |
" |
|
1094 |
self startAsWebService |
|
1095 |
" |
|
1096 |
! |
|
1097 |
||
1098 |
startAsWebService:linkName |
|
2631 | 1099 |
"this is not yet a public interface. For internal exept use only. |
1100 |
Start a web service for myself on link, an URL. |
|
1101 |
The webService will create new instances of me for incoming sessions. |
|
1102 |
Answer the webService. |
|
2580 | 1103 |
Start a HTTP server, if not already running" |
1104 |
||
3297 | 1105 |
^ HTTPPortalService |
1106 |
startWithApplication:self |
|
1107 |
link:linkName |
|
2579 | 1108 |
|
1109 |
" |
|
1110 |
self startAsWebService:'hello' |
|
1111 |
UBS::UBSUsecase startAsWebService:'uuu' |
|
1112 |
" |
|
1113 |
! |
|
1114 |
||
2629 | 1115 |
startAsWebService:linkName inServer:httpServer |
2631 | 1116 |
"this is not yet a public interface. For internal exept use only. |
1117 |
Start a web service for myself on the default webService linkURL. |
|
1118 |
The webService will create new instances of me for incoming sessions. |
|
1119 |
Answer the webService. |
|
2629 | 1120 |
Start a HTTP server, if not already running" |
1121 |
||
3297 | 1122 |
^ HTTPPortalService |
1123 |
startWithApplication:self |
|
1124 |
inServer:httpServer |
|
1125 |
link:linkName |
|
2629 | 1126 |
|
1127 |
" |
|
1128 |
self startAsWebService:'hello' |
|
1129 |
UBS::UBSUsecase startAsWebService:'uuu' |
|
1130 |
" |
|
1131 |
! |
|
1132 |
||
1133 |
startAsWebService:linkName onPort:httpPort |
|
2631 | 1134 |
"this is not yet a public interface. For internal exept use only. |
1135 |
Start a web service for myself on the default webService linkURL. |
|
1136 |
The webService will create new instances of me for incoming sessions. |
|
1137 |
Answer the webService. |
|
2629 | 1138 |
Start a HTTP server, if not already running" |
1139 |
||
3297 | 1140 |
^ HTTPPortalService |
1141 |
startWithApplication:self |
|
1142 |
inServer:(HTTPServer serverOnPort:httpPort) |
|
1143 |
link:linkName |
|
2629 | 1144 |
|
1145 |
" |
|
1146 |
self startAsWebService:'hello' |
|
1147 |
UBS::UBSUsecase startAsWebService:'uuu' |
|
1148 |
" |
|
1149 |
! |
|
1150 |
||
2579 | 1151 |
startAsWebService_old |
2542 | 1152 |
"this is not yet a public interface. For internal exept use only" |
1153 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1154 |
|app| |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1155 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1156 |
app := self basicNew. |
2547
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
1157 |
app initializeAsWebServiceOnWebDevice:(WebApplicationDevice new). |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1158 |
app startAsWebService. |
2605 | 1159 |
^ app |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1160 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1161 |
" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1162 |
PortalTests::TestApplication1 startAsWebService |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1163 |
" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1164 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1165 |
|
2632
ced2473521b1
changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
1166 |
startInPortalService:aPortalServiceOrSession |
2542 | 1167 |
"this is not yet a public interface. For internal exept use only" |
1168 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1169 |
|app| |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1170 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1171 |
app := self basicNew. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1172 |
app setDevice:(WebApplicationDevice new). |
2544
2df3456aa8f7
initialization if I am a webService
Claus Gittinger <cg@exept.de>
parents:
2543
diff
changeset
|
1173 |
app initialize. |
2543 | 1174 |
app initializeResources. |
2632
ced2473521b1
changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
1175 |
app startInPortalService:aPortalServiceOrSession. |
2605 | 1176 |
^ app. |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1177 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1178 |
" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1179 |
PortalTests::TestApplication1 |
3297 | 1180 |
startInPortalService: |
1181 |
(HTTPPortalService allInstances select:[:s | s httpServer port = 8080]) first |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1182 |
" |
2579 | 1183 |
! |
1184 |
||
1185 |
webServiceLinkName |
|
1186 |
"the link name, under which instances of myself are found in the httpServer" |
|
1187 |
||
1188 |
"/ typically, redefined as: |
|
2581 | 1189 |
^ self name asLowercaseFirst |
2579 | 1190 |
"/ or |
1191 |
"/ ^ 'ubs' |
|
1192 |
||
2581 | 1193 |
"/ ^ self subclassResponsibility |
1419 | 1194 |
! ! |
1195 |
||
1196 |
!ApplicationModel methodsFor:'accessing'! |
|
1197 |
||
1198 |
application |
|
1199 |
"application knows about interfaceSpecs, menuSpecs etc. |
|
1200 |
Usually this is my class. |
|
1201 |
This may be redefined in subclasses" |
|
1202 |
||
1203 |
^ self class |
|
1204 |
||
1205 |
"Modified: / 5.2.1998 / 00:45:21 / stefan" |
|
1206 |
! |
|
1207 |
||
1208 |
builder |
|
1209 |
"return the applications builder; this one has more information |
|
1210 |
about views, components etc." |
|
1211 |
||
1212 |
^ builder |
|
1213 |
! |
|
1214 |
||
1215 |
builder:aBuilder |
|
1216 |
"set the applications builder. Normally, you should not set it |
|
1217 |
directly, but depend on the default builder, as created when the application |
|
1218 |
was created." |
|
1219 |
||
1220 |
builder := aBuilder |
|
1221 |
! |
|
1222 |
||
1602 | 1223 |
componentAt:name |
2747 | 1224 |
"return a component identified by its name" |
1225 |
||
1602 | 1226 |
^ self builder componentAt:name |
1227 |
! |
|
1228 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1229 |
device |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1230 |
device isNil ifTrue:[ |
3297 | 1231 |
self isWebService ifTrue:[ |
1232 |
device := WebApplicationDevice new |
|
1233 |
] |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1234 |
]. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1235 |
^ device |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1236 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
1237 |
|
1419 | 1238 |
masterApplication |
3279 | 1239 |
"return the master application, in which I am embedded, or nil, if I am the topmost application. |
1240 |
Useful for embedded sub applications to access outer windows and/or bindings from the master" |
|
1419 | 1241 |
|
1427 | 1242 |
^ masterApplication |
1243 |
! |
|
1419 | 1244 |
|
1245 |
masterApplication:something |
|
1246 |
"set the value of the instance variable 'masterApplication' (automatically generated)" |
|
1247 |
||
1248 |
something == self ifTrue:[ |
|
3297 | 1249 |
self error:'an application cannot be its own masterApplication' mayProceed:true. |
1250 |
^ self |
|
1419 | 1251 |
]. |
1252 |
masterApplication := something. |
|
2566 | 1253 |
|
1254 |
"/ ensure that the device is compatible. |
|
2567 | 1255 |
masterApplication notNil ifTrue:[ |
3297 | 1256 |
device := masterApplication device. |
2567 | 1257 |
]. |
1419 | 1258 |
! |
1259 |
||
1260 |
resources |
|
3297 | 1261 |
"return the applications resources - |
2609
a78a9e0380b1
added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents:
2605
diff
changeset
|
1262 |
that's a ResourcePack containing national language strings" |
1988
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
1263 |
|
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
1264 |
resources isNil ifTrue:[ |
3297 | 1265 |
masterApplication notNil ifTrue:[ |
1266 |
^ masterApplication resources |
|
1267 |
] |
|
1988
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
1268 |
]. |
2609
a78a9e0380b1
added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents:
2605
diff
changeset
|
1269 |
resources isNil ifTrue:[ |
3297 | 1270 |
^ ResourcePack new |
2609
a78a9e0380b1
added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents:
2605
diff
changeset
|
1271 |
]. |
1419 | 1272 |
^ resources |
1273 |
! |
|
1274 |
||
1275 |
resources:aResourcePack |
|
1988
7b33c9095fe9
resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
1276 |
"set the applications resources - usually this is done automatically, |
1419 | 1277 |
except for manually built dialogs" |
1278 |
||
1279 |
resources := aResourcePack |
|
1280 |
! |
|
1281 |
||
3279 | 1282 |
topMasterApplication |
1283 |
"return the topmost master application. Useful when nested subapplications are used" |
|
1284 |
||
1285 |
masterApplication isNil ifTrue:[^ self]. |
|
1286 |
^ masterApplication topMasterApplication |
|
1287 |
! |
|
1288 |
||
3256 | 1289 |
topView |
1290 |
"SimpleView compatibility - answer my topWindow" |
|
1291 |
||
1292 |
^ self window |
|
1293 |
! |
|
1294 |
||
1419 | 1295 |
window |
1296 |
"return my topWindow - or nil, if I have no window (yet)" |
|
1297 |
||
1298 |
|win| |
|
1299 |
||
1300 |
builder isNil ifTrue:[^ nil]. |
|
1301 |
(win := builder window) notNil ifTrue:[ |
|
3297 | 1302 |
^ win |
1419 | 1303 |
]. |
1304 |
masterApplication notNil ifTrue:[ |
|
3297 | 1305 |
masterApplication ~~ self ifTrue:[ |
1306 |
"/ is that true ? |
|
1307 |
^ masterApplication window |
|
1308 |
] |
|
1419 | 1309 |
]. |
1310 |
^ nil. |
|
1311 |
||
1312 |
"Modified: / 18.9.1998 / 15:18:19 / cg" |
|
1313 |
! |
|
1314 |
||
1315 |
window:aTopView |
|
1316 |
"set my topWindow. |
|
1317 |
As a side effect, this creates a dummy builder if non has yet |
|
1318 |
been built. This prevents non-GUI-Painter apps from failing later, |
|
1319 |
when the builder is accessed." |
|
1320 |
||
1321 |
builder isNil ifTrue:[ |
|
3297 | 1322 |
self createBuilder |
1419 | 1323 |
]. |
1324 |
builder window:aTopView |
|
1325 |
||
1326 |
"Created: 18.4.1996 / 14:55:26 / cg" |
|
1327 |
! |
|
1328 |
||
3297 | 1329 |
windowGroup |
1419 | 1330 |
"return the applications windowGroup" |
1331 |
||
1332 |
|w| |
|
1333 |
||
1334 |
builder notNil ifTrue:[ |
|
3297 | 1335 |
(w := builder window) notNil ifTrue:[ |
1336 |
^ w windowGroup |
|
1337 |
]. |
|
1419 | 1338 |
]. |
1339 |
masterApplication notNil ifTrue:[ |
|
3297 | 1340 |
^ masterApplication windowGroup |
1419 | 1341 |
]. |
1342 |
^ nil |
|
1343 |
||
1344 |
"Modified: / 7.9.1998 / 23:37:00 / cg" |
|
3195 | 1345 |
! |
1346 |
||
1347 |
windowTitle:aString |
|
1348 |
builder window label:aString |
|
1419 | 1349 |
! ! |
1350 |
||
1351 |
!ApplicationModel methodsFor:'binding access'! |
|
1352 |
||
1353 |
actionFor:aKey |
|
1354 |
"sent by the builder to ask for an actionBlock for |
|
1355 |
a Button. The argument, aKey comes from an UI-spec |
|
1356 |
for a buttons #action property. |
|
1357 |
Here, a corresponding message is sent to myself, |
|
1358 |
which ought to be defined in the application subclass. |
|
1359 |
Alternatively, a subclass may redefine this method, to provide |
|
1360 |
actionBlocks from a Dictionary or whatever. |
|
1361 |
Typically, a block is returned there." |
|
1362 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1363 |
aKey isNil ifTrue:[ self error:'nil action key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1364 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1365 |
masterApplication notNil ifTrue:[ |
3297 | 1366 |
(self respondsTo:aKey) ifFalse:[ |
1367 |
^ masterApplication actionFor:aKey |
|
1368 |
]. |
|
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1369 |
]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1370 |
|
2853 | 1371 |
^ MessageSend receiver:self selector:aKey |
1372 |
"/ ^ [self perform:aKey] "/ could use: MessageSend receiver:self selector:aKey |
|
1373 |
||
1374 |
"Modified: / 28-07-2010 / 11:56:49 / cg" |
|
1419 | 1375 |
! |
1376 |
||
1377 |
actionFor:aKey withValue:aValue |
|
1378 |
"sent by the builder to ask for an actionBlock for |
|
3297 | 1379 |
a Button which passes a value. |
1419 | 1380 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
1381 |
Here, a corresponding message is sent to myself, |
|
1382 |
which ought to be defined in the application subclass. |
|
1383 |
Alternatively, a subclass may redefine this method, to provide |
|
1384 |
actionBlocks from a Dictionary or whatever. |
|
1385 |
Typically, a block is returned there." |
|
1386 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1387 |
aKey isNil ifTrue:[ self error:'nil action key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1388 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1389 |
masterApplication notNil ifTrue:[ |
3297 | 1390 |
(self respondsTo:aKey) ifFalse:[ |
1391 |
^ masterApplication actionFor:aKey withValue:aValue |
|
1392 |
]. |
|
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1393 |
]. |
2853 | 1394 |
|
2863 | 1395 |
"/ sigh - too many senders of #isBlock around... |
1396 |
"/ ^ MessageSend receiver:self selector:aKey argument:aValue |
|
1397 |
^ [self perform:aKey with:aValue] |
|
2853 | 1398 |
|
1399 |
"Modified: / 28-07-2010 / 11:56:42 / cg" |
|
2863 | 1400 |
"Modified: / 30-07-2010 / 10:40:35 / sr" |
1419 | 1401 |
! |
1402 |
||
2364 | 1403 |
actionFor:aKey withValue:value1 withValue:value2 |
3297 | 1404 |
"sent by the builder to ask for an actionBlock for a Button which passes two values. |
2364 | 1405 |
The argument, aKey comes from an UI-spec for a buttons #action property. |
1406 |
Here, a corresponding message is sent to myself, |
|
1407 |
which ought to be defined in the application subclass. |
|
1408 |
Alternatively, a subclass may redefine this method, to provide |
|
1409 |
actionBlocks from a Dictionary or whatever. |
|
1410 |
Typically, a block is returned there." |
|
1411 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1412 |
aKey isNil ifTrue:[ self error:'nil action key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1413 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1414 |
masterApplication notNil ifTrue:[ |
3297 | 1415 |
(self respondsTo:aKey) ifFalse:[ |
1416 |
^ masterApplication actionFor:aKey withValue:value1 withValue:value2 |
|
1417 |
]. |
|
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1418 |
]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1419 |
^ [self perform:aKey with:value1 with:value2] |
2364 | 1420 |
! |
1421 |
||
1419 | 1422 |
aspectFor:aKey |
1423 |
"sent by the builder to ask for an aspect (a data model). |
|
1424 |
The argument, aKey comes from an UI-spec |
|
1425 |
for a components #aspect property. |
|
1426 |
Here, a corresponding message is sent to myself, |
|
1427 |
which ought to be defined in the application subclass. |
|
1428 |
Alternatively, a subclass may redefine this method, to provide |
|
1429 |
holders from a Dictionary or whatever. |
|
1430 |
Typically, a valueHolder is returned there." |
|
1431 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1432 |
aKey isNil ifTrue:[ self error:'nil aspect key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1433 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1434 |
masterApplication notNil ifTrue:[ |
3297 | 1435 |
(self respondsTo:aKey) ifFalse:[ |
1436 |
^ masterApplication aspectFor:aKey |
|
1437 |
]. |
|
1419 | 1438 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1439 |
^ self perform:aKey |
1419 | 1440 |
|
1441 |
"Modified: / 18.6.1998 / 20:33:23 / cg" |
|
1442 |
! |
|
1443 |
||
1742
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1444 |
aspectOrNil:aKey forSubApplication:aSubApp |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1445 |
^ nil |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1446 |
! |
e463f28400fd
hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1447 |
|
1419 | 1448 |
clientFor:aKey |
1449 |
"sent by the builder to ask for an application provided |
|
1450 |
subcanvas's application. |
|
1451 |
The argument, aKey comes from an UI-spec |
|
1452 |
for a subcanvas's #client property. |
|
1453 |
Here, a corresponding message is sent to myself, |
|
1454 |
which ought to be defined in the application subclass. |
|
1455 |
Alternatively, a subclass may redefine this method, to provide |
|
1456 |
appModels from a Dictionary or whatever. |
|
1457 |
Typically, an applicationModel is returned there." |
|
1458 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1459 |
aKey isNil ifTrue:[ self error:'nil client key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1460 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1461 |
masterApplication notNil ifTrue:[ |
3297 | 1462 |
(self respondsTo:aKey) ifFalse:[ |
1463 |
^ masterApplication clientFor:aKey |
|
1464 |
]. |
|
1419 | 1465 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1466 |
^ self perform:aKey |
1419 | 1467 |
|
1468 |
"Modified: / 18.6.1998 / 20:33:30 / cg" |
|
1469 |
! |
|
1470 |
||
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1471 |
colorFor:aKey |
2472 | 1472 |
"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
|
1473 |
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
|
1474 |
for a widgets #*Color property. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1475 |
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
|
1476 |
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
|
1477 |
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
|
1478 |
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
|
1479 |
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
|
1480 |
|
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1481 |
(self respondsTo:aKey) ifTrue:[ |
3297 | 1482 |
^ (self perform:aKey) value |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1483 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1484 |
(self class respondsTo:aKey) ifTrue:[ |
3297 | 1485 |
^ (self class perform:aKey) value |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1486 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1487 |
masterApplication notNil ifTrue:[ |
3297 | 1488 |
^ masterApplication colorFor:aKey |
2387
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1489 |
]. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1490 |
^ self class colorFor:aKey. |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1491 |
! |
ef4a9559c9e6
Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents:
2382
diff
changeset
|
1492 |
|
1419 | 1493 |
componentFor:aKey |
1494 |
"sent by the builder to ask for an application provided |
|
1495 |
component. |
|
1496 |
The argument, aKey comes from an UI-spec |
|
1497 |
for a viewHolders #view property. |
|
1498 |
Here, a corresponding message is sent to myself, |
|
1499 |
which ought to be defined in the application subclass. |
|
1500 |
Alternatively, a subclass may redefine this method, to provide |
|
1501 |
holders from a Dictionary or whatever. |
|
1502 |
Typically, a view is returned there." |
|
1503 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1504 |
aKey isNil ifTrue:[ self error:'nil component key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1505 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1506 |
masterApplication notNil ifTrue:[ |
3297 | 1507 |
(self respondsTo:aKey) ifFalse:[ |
1508 |
^ masterApplication componentFor:aKey |
|
1509 |
]. |
|
1419 | 1510 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1511 |
^ self perform:aKey |
1419 | 1512 |
|
1513 |
"Modified: / 18.6.1998 / 20:33:36 / cg" |
|
1514 |
! |
|
1515 |
||
2472 | 1516 |
fontFor:aKey |
1517 |
"sent by the builder to ask for an application provided font. |
|
1518 |
The argument, aKey comes from an UI-spec |
|
1519 |
for a widgets #*Font property. |
|
1520 |
Here, a corresponding message is sent to myself, |
|
1521 |
which ought to be defined in the application subclass. |
|
1522 |
Alternatively, a subclass may redefine this method, to provide |
|
1523 |
holders from a Dictionary or whatever. |
|
3308 | 1524 |
Typically, a font is returned there. |
1525 |
||
1526 |
Use #resolveFont:, if you are not a builder!!" |
|
2472 | 1527 |
|
1528 |
(self respondsTo:aKey) ifTrue:[ |
|
3308 | 1529 |
^ self perform:aKey |
2472 | 1530 |
]. |
1531 |
(self class respondsTo:aKey) ifTrue:[ |
|
3308 | 1532 |
^ self class perform:aKey |
2472 | 1533 |
]. |
1534 |
masterApplication notNil ifTrue:[ |
|
3308 | 1535 |
^ masterApplication fontFor:aKey |
2472 | 1536 |
]. |
1537 |
^ self class fontFor:aKey. |
|
1538 |
! |
|
1539 |
||
1419 | 1540 |
labelFor:aKey |
1541 |
"sent by the builder to ask for an application provided |
|
1542 |
label for a component. |
|
1543 |
The argument, aKey comes from an UI-spec |
|
1544 |
for a components #label property. |
|
1545 |
Here, a corresponding message is sent to myself, |
|
1546 |
which ought to be defined in the application subclass. |
|
1547 |
Alternatively, a subclass may redefine this method, to provide |
|
1548 |
labels from a Dictionary or whatever. |
|
1549 |
Typically, a string is returned there." |
|
1550 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1551 |
aKey isNil ifTrue:[ self error:'nil label key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1552 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1553 |
masterApplication notNil ifTrue:[ |
3297 | 1554 |
(self respondsTo:aKey) ifFalse:[ |
1555 |
^ masterApplication labelFor:aKey |
|
1556 |
]. |
|
1419 | 1557 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1558 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1559 |
(self respondsTo:aKey) ifFalse:[ |
3297 | 1560 |
(self class respondsTo:aKey) ifTrue:[ |
1561 |
^ self class perform:aKey |
|
1562 |
]. |
|
1997 | 1563 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1564 |
^ self perform:aKey |
1419 | 1565 |
! |
1566 |
||
1567 |
listFor:aKey |
|
1568 |
"sent by the builder to ask for an application provided |
|
1569 |
holder for a list (for example, a popUpLists list). |
|
1570 |
The argument, aKey comes from an UI-spec |
|
1571 |
for a listWidgets #list property. |
|
1572 |
Here, a corresponding message is sent to myself, |
|
1573 |
which ought to be defined in the application subclass. |
|
1574 |
Alternatively, a subclass may redefine this method, to provide |
|
1575 |
holders from a Dictionary or whatever. |
|
1576 |
Typically, a list-holding model (SelectionInList) is returned there. |
|
1577 |
If the instance does not provide a value, a corresponding aspect |
|
1578 |
is asked for. If that fails as well, the app class is asked as a last |
|
1579 |
chance." |
|
1580 |
||
1581 |
|a| |
|
1582 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1583 |
aKey isNil ifTrue:[ self error:'nil list key' ]. |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1584 |
|
1419 | 1585 |
a := self aspectFor:aKey. |
1586 |
a notNil ifTrue:[ |
|
3297 | 1587 |
^ a |
1419 | 1588 |
]. |
1589 |
^ self application listFor:aKey |
|
1590 |
||
1591 |
"Modified: / 18.6.1998 / 20:33:50 / cg" |
|
1592 |
! |
|
1593 |
||
3297 | 1594 |
menuFor:key |
1595 |
"Sent by the builder to ask for an application provided |
|
1596 |
holder for a menu. The argument, `key`, comes from an UI-spec |
|
1419 | 1597 |
for a widgets #menu property. |
1598 |
Here, a corresponding message is sent to myself, |
|
1599 |
which ought to be defined in the application subclass. |
|
1600 |
Alternatively, a subclass may redefine this method, to provide |
|
1601 |
holders from a Dictionary or whatever. |
|
1602 |
Typically, a menu or a menu-holding valueHolder is returned there." |
|
1603 |
||
3297 | 1604 |
| menu | |
1605 |
||
1606 |
key isNil ifTrue:[ self error:'nil menu key' ]. |
|
1607 |
||
1608 |
"/ Ask myself first... |
|
1609 |
(thisContext isRecursive not and:[ self respondsTo: key ]) ifTrue:[ |
|
1610 |
menu := self perform: key |
|
1611 |
] ifFalse:[ |
|
1612 |
"/ Ask my class... |
|
1613 |
(self class respondsTo: key) ifTrue:[ |
|
1614 |
menu := self class perform: key |
|
1615 |
] ifFalse:[ |
|
1616 |
"/ Ask masterApplication if any... |
|
1617 |
masterApplication notNil ifTrue:[ |
|
1618 |
menu := masterApplication menuFor: key |
|
1619 |
]. |
|
1620 |
]. |
|
1419 | 1621 |
]. |
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
1622 |
|
3297 | 1623 |
"/ If the provided menu is a menu spec, create Menu from it... |
1624 |
menu isArray ifTrue:[ |
|
1625 |
menu := Menu decodeFromLiteralArray: menu. |
|
1997 | 1626 |
]. |
3297 | 1627 |
^ menu. |
1628 |
||
1629 |
"Modified: / 18-06-1998 / 20:33:56 / cg" |
|
1630 |
"Modified: / 24-01-2014 / 09:46:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1419 | 1631 |
! |
1632 |
||
1633 |
specificationFor:aKey |
|
1634 |
"sent by the builder to ask for an application provided |
|
1635 |
specification for a subcanvas or subspecification. |
|
1636 |
The argument, aKey comes from an UI-spec |
|
1637 |
for a subcanvases #specification property (minorKey). |
|
1638 |
Here, a corresponding message is sent to myself, |
|
1639 |
which ought to be defined in the application subclass. |
|
1640 |
Alternatively, a subclass may redefine this method, to provide |
|
1641 |
interfaceSpecifications from a Dictionary or whatever. |
|
1642 |
Typically, an interfaceSpecification is returned there." |
|
1643 |
||
1584 | 1644 |
^ ApplicationModel |
3297 | 1645 |
specificationFor:aKey |
1646 |
application:self |
|
1647 |
onDevice:(self graphicsDevice) |
|
1419 | 1648 |
! |
1649 |
||
2058 | 1650 |
subApplicationFor:aKey |
3297 | 1651 |
"sent by subCanvas to ask for an application inside itself. |
2058 | 1652 |
The argument, aKey comes from a TabList-specs majorKey. |
1653 |
Here, a corresponding message is sent to myself, |
|
1654 |
which ought to be defined in the application subclass. |
|
1655 |
Alternatively, a subclass may redefine this method, to provide |
|
1656 |
an application from a Dictionary or whatever. |
|
1657 |
Typically, an ApplicationModel subinstance is returned there." |
|
1658 |
||
1659 |
(self respondsTo:aKey) ifTrue:[ |
|
3297 | 1660 |
^ self perform:aKey |
2058 | 1661 |
]. |
1662 |
masterApplication notNil ifTrue:[ |
|
3297 | 1663 |
^ masterApplication subApplicationFor:aKey |
2058 | 1664 |
]. |
1665 |
^ nil. |
|
1666 |
! |
|
1667 |
||
1419 | 1668 |
visualFor:aKey |
1669 |
"sent by the builder to ask for an application provided |
|
1670 |
image or element for a label. |
|
1671 |
The argument, aKey comes from an UI-spec |
|
1672 |
for a widgets #label property, if LabelIsImage is turned on. |
|
1673 |
Here, a corresponding message is sent to myself, |
|
1674 |
which ought to be defined in the application subclass. |
|
1675 |
Alternatively, a subclass may redefine this method, to provide |
|
1676 |
images from a Dictionary or whatever. |
|
1677 |
Typically, an image is returned there." |
|
1678 |
||
1679 |
^ self application visualFor:aKey |
|
1680 |
! ! |
|
1681 |
||
2380 | 1682 |
!ApplicationModel methodsFor:'building'! |
1683 |
||
1684 |
allButOpen |
|
1685 |
"create my views from the windowSpec, but do not open the main window." |
|
1686 |
||
1687 |
^ self allButOpenInterface:(self defaultWindowSpecName). |
|
1688 |
||
1689 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
|
1690 |
! |
|
1691 |
||
1692 |
allButOpenFrom:aSpec |
|
1693 |
"create my views but do not open the main window. |
|
1694 |
The argument is a spec which defines the interface." |
|
1695 |
||
1696 |
|window| |
|
1697 |
||
2691 | 1698 |
window notNil ifTrue:[ |
3297 | 1699 |
self error:'building twice (window is already built) ?' mayProceed:true. |
2691 | 1700 |
]. |
1701 |
||
2380 | 1702 |
"/ DISABLED; see comment in basicInitialize |
1703 |
"/ |
|
1704 |
"/ " |
|
1705 |
"/ here, we kludge a bit: up to now, the builder was an |
|
1706 |
"/ instance of the no-op WindowBuilder. Now, it becomes |
|
1707 |
"/ a UIBuilder .... |
|
1708 |
"/ This allows for ApplicationModels without a UIBuilder |
|
1709 |
"/ if not needed. |
|
1710 |
"/ " |
|
1711 |
"/ realBuilder := UIBuilder new. |
|
1712 |
"/ builder := realBuilder. |
|
1713 |
"/ builder application:self. |
|
1714 |
"/ builder bindings:builder bindings. |
|
1715 |
||
1716 |
builder isNil ifTrue:[ |
|
3297 | 1717 |
self createBuilder. |
2380 | 1718 |
]. |
1719 |
||
1720 |
self preBuildWith:builder. |
|
1721 |
builder buildWindowFromSpec:aSpec. |
|
1722 |
window := builder window. |
|
1723 |
||
1724 |
window model:self. |
|
1725 |
(window respondsTo:#application:) ifTrue:[ |
|
3297 | 1726 |
window application:self. |
2380 | 1727 |
]. |
1728 |
||
1729 |
self showingHelp ifTrue: [ActiveHelp startFor: self]. |
|
1730 |
self postBuildWith:builder. |
|
1731 |
||
1732 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
|
1733 |
! |
|
1734 |
||
1735 |
allButOpenInterface:aSymbol |
|
1736 |
"create my views but do not open the main window. |
|
1737 |
The argument specifies a selector of a method, |
|
1738 |
which when sent to myself should return a spec. |
|
1739 |
Notice, this returns the windowBuilder." |
|
1740 |
||
1741 |
self allButOpenFrom:(self interfaceSpecFor:aSymbol). |
|
1742 |
^ builder |
|
1743 |
||
1744 |
"Modified: / 19.6.1998 / 01:48:26 / cg" |
|
1745 |
! |
|
1746 |
||
1747 |
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder |
|
1748 |
"build a subcanvases spec into aSubcanvas" |
|
1749 |
||
1750 |
|sameApp prevSpec prevSource| |
|
1751 |
||
1752 |
aBuilder notNil ifTrue:[ |
|
3297 | 1753 |
prevSpec := aBuilder spec. |
1754 |
prevSource := aBuilder source. |
|
2380 | 1755 |
]. |
1756 |
||
1757 |
builder isNil ifTrue:[ |
|
3297 | 1758 |
builder := aBuilder. |
1759 |
aBuilder isNil ifTrue:[ |
|
1760 |
self createBuilder |
|
1761 |
] |
|
2380 | 1762 |
]. |
1763 |
||
1764 |
aBuilder source:self. |
|
1765 |
||
1766 |
"/ if the subcanvases appModel is NOT the same as |
|
1767 |
"/ the topApp, it must be pre/post-built. |
|
1768 |
"/ Otherwise, we invoke pre/post-builtAsSubcanvas. |
|
1769 |
"/ which provides a hook for redefinition in concrete appModels. |
|
1770 |
"/ This avoids invoking pre/postBuild twice for subCanvases which |
|
1771 |
"/ have the topApp as appModel. |
|
1772 |
||
1773 |
sameApp := aBuilder application == aBuilder window topView application. |
|
1774 |
sameApp ifTrue:[ |
|
3297 | 1775 |
self preBuildAsSubcanvasWith:aBuilder. |
2380 | 1776 |
] ifFalse:[ |
3297 | 1777 |
self preBuildWith:aBuilder. |
2380 | 1778 |
]. |
1779 |
||
1780 |
aBuilder buildFromSpec:specToBuild. |
|
1781 |
||
1782 |
sameApp ifTrue:[ |
|
3297 | 1783 |
self postBuildAsSubcanvasWith:aBuilder. |
2380 | 1784 |
] ifFalse:[ |
3297 | 1785 |
self postBuildWith:aBuilder. |
2380 | 1786 |
]. |
1787 |
||
1788 |
prevSpec notNil ifTrue:[ |
|
3297 | 1789 |
"/ restore state in builder if original builder was used |
1790 |
aBuilder spec:prevSpec. |
|
2380 | 1791 |
]. |
1792 |
prevSource notNil ifTrue:[ |
|
3297 | 1793 |
"/ restore state in builder if original builder was used |
1794 |
aBuilder source:prevSource. |
|
2380 | 1795 |
]. |
1796 |
||
1797 |
^ aBuilder |
|
1798 |
||
1799 |
"Created: / 18-06-1998 / 20:08:45 / cg" |
|
1800 |
"Modified: / 27-10-2006 / 11:45:25 / cg" |
|
1801 |
! |
|
1802 |
||
1803 |
buildSubCanvas:spec withBuilder:aBuilder |
|
1804 |
"build a subcanvases' spec into aSubcanvas" |
|
1805 |
||
1806 |
self buildSubCanvas:spec withMenu:false withBuilder:aBuilder |
|
1807 |
! |
|
1808 |
||
1809 |
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder |
|
1810 |
"build a subcanvases' spec into aSubcanvas" |
|
1811 |
||
1812 |
|specToBuild| |
|
1813 |
||
1814 |
specToBuild := spec. |
|
1815 |
withMenuBoolean ifFalse:[ |
|
3297 | 1816 |
"/ subapps should not build the menu and other fullSpec stuff. |
1817 |
spec class == FullSpec ifTrue:[ |
|
1818 |
specToBuild := spec component. |
|
1819 |
] |
|
2380 | 1820 |
]. |
1821 |
self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder |
|
1822 |
! ! |
|
1823 |
||
1419 | 1824 |
!ApplicationModel methodsFor:'component manipulations'! |
1825 |
||
1826 |
components:aSymbolOrArray do:aBlock |
|
1827 |
"evaluate aBlock for all components listed aSymbolOrArray." |
|
1828 |
||
1829 |
|coll| |
|
1830 |
||
1831 |
aSymbolOrArray isSymbol ifTrue:[ |
|
3297 | 1832 |
"/ a single components name |
1833 |
coll := Array with:aSymbolOrArray |
|
1419 | 1834 |
] ifFalse:[ |
3297 | 1835 |
coll := aSymbolOrArray |
1419 | 1836 |
]. |
1837 |
coll do:[:aSymbol | |
|
3297 | 1838 |
|component| |
1839 |
||
1840 |
(component := self componentFor:aSymbol) isNil ifFalse:[ |
|
1841 |
aBlock value:component |
|
1842 |
] |
|
1419 | 1843 |
] |
1844 |
||
1845 |
"Modified: 26.3.1997 / 16:23:14 / cg" |
|
1846 |
! |
|
1847 |
||
1848 |
disable:aSymbolOrArray |
|
1849 |
"disable the components whose id's are aSymbolOrArray." |
|
1850 |
||
1851 |
self components:aSymbolOrArray do:[:comp | comp disable] |
|
1852 |
||
1853 |
"Modified: 14.2.1997 / 17:32:09 / cg" |
|
1854 |
! |
|
1855 |
||
1856 |
enable:aSymbolOrArray |
|
1857 |
"enables the component(s) identified by aSymbolOrArray." |
|
1858 |
||
1859 |
self components:aSymbolOrArray do:[:comp | comp enable] |
|
1860 |
||
1861 |
"Modified: 14.2.1997 / 17:32:19 / cg" |
|
1862 |
! |
|
1863 |
||
1864 |
invalidate:aSymbolOrArray |
|
1865 |
"invalidates the component(s) identified by aSymbolOrArray." |
|
1866 |
||
1867 |
self components:aSymbolOrArray do:[:comp | comp invalidate] |
|
1868 |
||
1869 |
"Modified: 14.2.1997 / 17:32:28 / cg" |
|
1870 |
! |
|
1871 |
||
1872 |
makeInvisible:aSymbolOrArray |
|
1873 |
"makes the components whose id's are aSymbolOrArray invisible" |
|
1874 |
||
1875 |
self components:aSymbolOrArray do:[:comp | comp beInvisible] |
|
1876 |
||
1877 |
"Modified: 14.2.1997 / 17:32:42 / cg" |
|
1878 |
! |
|
1879 |
||
1880 |
makeReadOnly:aSymbolOrArray |
|
1881 |
"make all components identified by aSymbolOrArray read only |
|
1882 |
(for editText components)." |
|
1883 |
||
1884 |
self components:aSymbolOrArray do:[:comp | comp readOnly:true] |
|
1885 |
||
1886 |
"Modified: 14.2.1997 / 17:36:22 / cg" |
|
1887 |
! |
|
1888 |
||
1889 |
makeVisible:aSymbolOrArray |
|
1890 |
"makes the components whose id's are aSymbolOrArray visible" |
|
1891 |
||
1892 |
self components:aSymbolOrArray do:[:comp | comp beVisible] |
|
1893 |
||
1894 |
"Modified: 14.2.1997 / 17:32:52 / cg" |
|
1895 |
! |
|
1896 |
||
1897 |
makeWritable:aSymbolOrArray |
|
3297 | 1898 |
"make all components identified by aSymbolOrArray writable |
1419 | 1899 |
(for editText components)." |
1900 |
||
1901 |
self components:aSymbolOrArray do:[:comp | comp readOnly:false] |
|
1902 |
||
1903 |
"Created: 14.2.1997 / 17:36:17 / cg" |
|
1904 |
! ! |
|
1905 |
||
1906 |
!ApplicationModel methodsFor:'copying'! |
|
1907 |
||
1908 |
postCopy |
|
1909 |
builder := device := nil. |
|
1910 |
||
1911 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
2053 | 1912 |
! |
1913 |
||
1914 |
postDeepCopy |
|
1915 |
builder := device := nil. |
|
1916 |
||
1917 |
"Created: / 19.4.1998 / 11:44:44 / cg" |
|
1419 | 1918 |
! ! |
1919 |
||
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1920 |
!ApplicationModel methodsFor:'delayed actions (enqueue)'! |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1921 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1922 |
delayedUpdate:something with:aParameter from:changedObject |
3297 | 1923 |
"support for delayed updates - |
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1924 |
subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:) |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1925 |
must also redefine this method, and perform the actual update there." |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1926 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1927 |
^ self |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1928 |
! |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1929 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1930 |
enqueueDelayedAction:aBlock |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1931 |
"This will enqueue a delayed action - the application-process will |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1932 |
eventually execute aBlock. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1933 |
Useful for synchronization" |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1934 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1935 |
^ self |
3297 | 1936 |
enqueueMessage:#value |
1937 |
for:aBlock |
|
1938 |
arguments:#(). |
|
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1939 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1940 |
"Modified: / 26.2.2000 / 18:01:44 / cg" |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1941 |
! |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1942 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1943 |
enqueueDelayedUpdate:something with:aParameter from:changedObject |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1944 |
"support for delayed updates - to be invoked from a concrete classes |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1945 |
#update:with:from: method. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1946 |
This will enqueue a delayed update, and resend #delayedUpdate:with:from: |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1947 |
whenever the receiver is handling events. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1948 |
Especially useful, if many updates arrive at high frequency, to avoid |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1949 |
multiple redraws." |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1950 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1951 |
^ self |
3297 | 1952 |
enqueueMessage:#delayedUpdate:with:from: |
1953 |
for:self |
|
1954 |
arguments:(Array |
|
1955 |
with:something |
|
1956 |
with:aParameter |
|
1957 |
with:changedObject). |
|
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1958 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1959 |
"Modified: / 26.2.2000 / 18:01:44 / cg" |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1960 |
! |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1961 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1962 |
enqueueMessage:selector for:someone arguments:argList |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1963 |
"enqueue a message to be sent to myself later, when my process |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1964 |
is back in its eventLoop. Also, filter duplicates. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1965 |
This is useful, to buffer redraws and avoid flicker due to multiple |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1966 |
redraws (especially in browsers, when reacting on changeMessages resulting |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1967 |
from changes made in other browsers)" |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1968 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1969 |
|window sensor| |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1970 |
|
2561 | 1971 |
|
1972 |
self isWebService ifTrue:[ |
|
3297 | 1973 |
self breakPoint:#sr. |
1974 |
^ self |
|
2561 | 1975 |
]. |
1976 |
||
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1977 |
(window := self window) notNil ifTrue:[ |
3297 | 1978 |
sensor := window sensor. |
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1979 |
]. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1980 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1981 |
sensor isNil ifTrue:[ |
3297 | 1982 |
"no window (yet or any longer)" |
1983 |
someone perform:selector withArguments:argList. |
|
1984 |
^ self. |
|
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1985 |
]. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1986 |
|
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1987 |
"/ |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1988 |
"/ if such a message is already in the queue, ignore it. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1989 |
"/ Otherwise push it as an event, to be handled when my thread is |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1990 |
"/ back in the event loop. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1991 |
"/ |
3294 | 1992 |
sensor criticalUserEventQueueAccess:[ |
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1993 |
(sensor hasEvent:selector for:someone withArguments:argList) ifFalse:[ |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1994 |
sensor pushUserEvent:selector for:someone withArguments:argList |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1995 |
]. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1996 |
]. |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
1997 |
|
2902
c47d671282f9
comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents:
2898
diff
changeset
|
1998 |
"Created: / 26-02-2000 / 18:01:31 / cg" |
c47d671282f9
comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents:
2898
diff
changeset
|
1999 |
"Modified: / 23-03-2011 / 19:46:41 / cg" |
2556
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
2000 |
! ! |
7b4fce0b3b2a
changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents:
2555
diff
changeset
|
2001 |
|
1419 | 2002 |
!ApplicationModel methodsFor:'drag & drop'! |
2003 |
||
2557 | 2004 |
canDropObjects:aCollectionOfDropObjects |
1419 | 2005 |
"drop manager asked if a drop is possible |
2006 |
- should be redefined by apps which can do it, to return true" |
|
2007 |
||
2008 |
^ false |
|
2557 | 2009 |
! |
2010 |
||
2011 |
canDropObjects:aCollectionOfDropObjects in:aComponent |
|
2012 |
"drop manager asked if a drop is possible |
|
2013 |
- should be redefined by apps which can do it, to return true" |
|
2014 |
||
3297 | 2015 |
^ self canDropObjects:aCollectionOfDropObjects |
1419 | 2016 |
! |
2017 |
||
2261 | 2018 |
canDropObjects:aCollectionOfDropObjects in:aComponent at:position |
2405 | 2019 |
"drop manager asked if a drop is possible. |
2020 |
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
|
2021 |
|
2261 | 2022 |
^ self canDropObjects:aCollectionOfDropObjects in:aComponent |
2023 |
||
2024 |
"Created: / 13-10-2006 / 15:52:20 / cg" |
|
2079 | 2025 |
! |
2026 |
||
2557 | 2027 |
dropObjects:aCollectionOfDropObjects |
2079 | 2028 |
"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
|
2029 |
This is ony sent, if #canDrop: returned true. |
2865 | 2030 |
Must be redefined in order for drop to work." |
2031 |
||
2032 |
^ self subclassResponsibility |
|
2252
c7cf598af103
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
2033 |
|
2262 | 2034 |
"Created: / 13-10-2006 / 18:25:06 / cg" |
2079 | 2035 |
! |
2036 |
||
2557 | 2037 |
dropObjects:aCollectionOfDropObjects in:aComponent |
2038 |
"drop manager wants to drop. |
|
2039 |
This is ony sent, if #canDrop: returned true. |
|
2040 |
Must be redefine in order for drop to work." |
|
2041 |
||
2042 |
^ self dropObjects:aCollectionOfDropObjects |
|
2043 |
||
2044 |
! |
|
2045 |
||
2262 | 2046 |
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint |
1419 | 2047 |
"drop manager wants to drop. |
2048 |
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
|
2049 |
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
|
2050 |
|
2557 | 2051 |
^ self dropObjects:aCollectionOfDropObjects in:aComponent |
2262 | 2052 |
|
2053 |
"Created: / 13-10-2006 / 18:25:13 / cg" |
|
2824 | 2054 |
! |
2055 |
||
2056 |
droppedFile:aFilename in:aComponent |
|
2057 |
"ignored here - only sent by textView components, sometimes" |
|
1419 | 2058 |
! ! |
2059 |
||
2060 |
!ApplicationModel methodsFor:'easy bindings'! |
|
2061 |
||
2062 |
registerInterestIn:aValueModel using:aSelectorOrArray |
|
2063 |
"Register interest in a change in aValueModel using information in aSelectorOrArray. |
|
3297 | 2064 |
aSelectorOrArray can be one of three things: |
2065 |
||
2066 |
1) nil in which case no interest is registered |
|
2067 |
2) a selector in which case the receiver is understood to be self |
|
2068 |
3) an Array in which case the size is two where the first element is the |
|
2069 |
message to be sent and the second element is the receiver." |
|
1419 | 2070 |
|
2071 |
aSelectorOrArray isNil ifTrue:[^ aValueModel]. |
|
2072 |
||
2073 |
(aSelectorOrArray isArray) ifTrue:[ |
|
3297 | 2074 |
aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2) |
1419 | 2075 |
] ifFalse: [ |
3297 | 2076 |
aValueModel onChangeSend:aSelectorOrArray to:self |
1419 | 2077 |
]. |
2078 |
^aValueModel |
|
2079 |
||
2080 |
"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
|
2081 |
! |
3764f680134d
allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents:
978
diff
changeset
|
2082 |
|
1419 | 2083 |
valueHolderFor:aSelector initialValue:anObject |
3297 | 2084 |
"Return a ValueHolder on anObject." |
1419 | 2085 |
|
2086 |
^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil |
|
2087 |
||
2088 |
||
2089 |
! |
|
2090 |
||
2091 |
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil |
|
3297 | 2092 |
"Return a ValueHolder on anObject. aSelectorOrArrayOrNil is the change information |
2093 |
for the ValueHolder. This argument is either a Symbol or an Array of two elements. |
|
1419 | 2094 |
If it is a Symbol, then it is the change message and the interested object is understood |
3297 | 2095 |
to be the reciever. If it is an Array, then the first element is the change message and |
2096 |
the second element is the interested object. " |
|
1419 | 2097 |
|
2098 |
|holder| |
|
2099 |
||
2100 |
(builder bindings includesKey:aSelector) ifFalse:[ |
|
3297 | 2101 |
holder := ValueHolder with:anObject. |
2102 |
builder aspectAt:aSelector put:holder. |
|
2103 |
aSelectorOrArrayOrNil notNil ifTrue:[ |
|
2104 |
^ self registerInterestIn:holder using:aSelectorOrArrayOrNil |
|
2105 |
]. |
|
2106 |
^ holder |
|
1419 | 2107 |
]. |
2108 |
^ builder aspectAt:aSelector |
|
2109 |
||
2110 |
"Modified: / 21.5.1998 / 03:31:28 / cg" |
|
2111 |
! ! |
|
2112 |
||
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2113 |
!ApplicationModel methodsFor:'forced actions'! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2114 |
|
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2115 |
doAcceptByReturnKey |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2116 |
|acceptAction| |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2117 |
|
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2118 |
builder notNil ifTrue:[ |
3297 | 2119 |
acceptAction := builder bindingAt:#doAccept. |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2120 |
]. |
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2121 |
acceptAction notNil ifTrue:[ |
3297 | 2122 |
acceptAction value |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2123 |
] ifFalse:[ |
3297 | 2124 |
self doAccept |
2009
cb68fe9cdb72
care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents:
1997
diff
changeset
|
2125 |
] |
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2126 |
! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2127 |
|
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2128 |
doCancelByEscapeKey |
2010 | 2129 |
|cancelAction| |
2130 |
||
2131 |
builder notNil ifTrue:[ |
|
3297 | 2132 |
cancelAction := builder bindingAt:#doCancel. |
2010 | 2133 |
]. |
2134 |
cancelAction notNil ifTrue:[ |
|
3297 | 2135 |
cancelAction value |
2010 | 2136 |
] ifFalse:[ |
3297 | 2137 |
self doCancel |
2010 | 2138 |
] |
1880
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2139 |
! ! |
064c4f74b8e8
doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents:
1851
diff
changeset
|
2140 |
|
1419 | 2141 |
!ApplicationModel methodsFor:'help'! |
2142 |
||
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2143 |
aboutImage |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2144 |
"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
|
2145 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
2146 |
^ self class aboutImage |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2147 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2148 |
"Modified: / 13.11.2001 / 12:32:44 / cg" |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2149 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2150 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2151 |
aboutThisApplicationLabel |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2152 |
"label for an about box for this application." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2153 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
2154 |
^ self class aboutThisApplicationLabel |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2155 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2156 |
|
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2157 |
aboutThisApplicationText |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2158 |
"text for an about box for this application." |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2159 |
|
1674
3000bc98f043
about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents:
1670
diff
changeset
|
2160 |
^ self class aboutThisApplicationText |
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2161 |
! |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2162 |
|
3240 | 2163 |
activeHelpViewFor:text onDevice:aDevice |
3297 | 2164 |
"redefinable to allow for applications to provide their own active help |
3239 | 2165 |
(aka tooltip) bubble window" |
2166 |
||
3240 | 2167 |
^ ActiveHelpView for:text onDevice:aDevice |
3239 | 2168 |
! |
2169 |
||
2520
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2170 |
flyByHelpDependsOnPositionIn:aView |
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2171 |
"subclasses where the help-text depends upon the pointer position might |
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2172 |
want to redefine this" |
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2173 |
|
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2174 |
^ false |
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2175 |
! |
b4cb0d37c0d4
+ flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents:
2510
diff
changeset
|
2176 |
|
1526
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2177 |
openAboutThisApplication |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2178 |
"opens an about box for this application. |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2179 |
Can be specialized by redefining #aboutThisApplicationText |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2180 |
and #aboutThisApplicationLabel" |
02941e80a146
refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents:
1523
diff
changeset
|
2181 |
|
1531 | 2182 |
Dialog |
3297 | 2183 |
about:(self translateString:self aboutThisApplicationText) |
2184 |
label:(self translateString:self aboutThisApplicationLabel) |
|
2185 |
icon:self aboutImage |
|
1531 | 2186 |
|
2187 |
"Modified: / 17.11.2001 / 23:05:52 / cg" |
|
1419 | 2188 |
! |
2189 |
||
2190 |
openHelpViewOnFile:pathToHelpText |
|
2191 |
"open a help viewer (as opened by the help buttons). |
|
2192 |
The argument is a relative path within the help directory |
|
2193 |
(but a file under the current directory is tried first)" |
|
2194 |
||
2195 |
self withWaitCursorDo:[ |
|
3297 | 2196 |
HTMLDocumentView openFullOnHelpFile:pathToHelpText |
1419 | 2197 |
] |
2198 |
||
2199 |
! |
|
2200 |
||
2201 |
showActiveHelp:aHelpText for:view |
|
2202 |
"This is invoked from the activeHelp event listener, to display some popup-help |
|
2203 |
for a component. If false is returned, the help manager will pop up |
|
2204 |
some active help bubble; if true is returned, it will assume that the |
|
2205 |
help text has been already displayed and will not do any further actions. |
|
2206 |
Here, we accept the help text, and push an event into out own input |
|
2207 |
queue, so that the help text will be displayed asyncronously by myself, |
|
2208 |
vis the #showHelp:for: method. |
|
2209 |
This can be redefined in concrete classes to handle active help differently." |
|
2210 |
||
2211 |
|wg mySensor| |
|
2212 |
||
2213 |
self showingHelp ifFalse: [ |
|
3297 | 2214 |
^ true |
1419 | 2215 |
]. |
2216 |
||
2217 |
"/ masterApplication notNil ifTrue:[ |
|
2218 |
"/ (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[ |
|
2219 |
"/ ^ true |
|
2220 |
"/ ] |
|
2221 |
"/ ]. |
|
2222 |
||
2223 |
"/ NEW: push it into the event queue, to have it displayed |
|
2224 |
"/ syncronously with other events. |
|
2225 |
"/ (also any errors are reported as occurring in my context; |
|
2226 |
"/ instead of occurring in the activeHelp context). |
|
2227 |
||
2228 |
(wg := self windowGroup) notNil ifTrue:[ |
|
3297 | 2229 |
mySensor := wg sensor. |
2230 |
mySensor notNil ifTrue:[ |
|
2231 |
mySensor flushEventsFor:self withType:#showHelp:for:. |
|
2232 |
mySensor |
|
2233 |
pushUserEvent:#showHelp:for: for:self |
|
2234 |
withArguments:(Array with:aHelpText with:view). |
|
2235 |
^ true |
|
2236 |
] |
|
1419 | 2237 |
]. |
2238 |
||
2239 |
"/ mhmh - can this happen ? |
|
2240 |
||
2241 |
^ true |
|
2242 |
||
2243 |
"Modified: / 21.8.1998 / 16:00:37 / cg" |
|
2244 |
! |
|
2245 |
||
2246 |
showHelp:aHelpText for:view |
|
2247 |
"actual method which is supposed to display the help text. |
|
2248 |
Should be redefined in concrete classes, to put the help text |
|
2249 |
into some info label, or the windows title bar. |
|
2250 |
Here, the help text is ignored." |
|
2251 |
||
2252 |
masterApplication notNil ifTrue:[ |
|
3297 | 2253 |
masterApplication showHelp:aHelpText for:view |
1419 | 2254 |
]. |
2255 |
||
2256 |
"Modified: / 31.7.1998 / 19:13:59 / cg" |
|
2257 |
! |
|
2258 |
||
2259 |
showingHelp |
|
2260 |
"return true, if the activeHelp manager should invoke my #showHelp:for: |
|
2261 |
method, when the mouse pointer is moved over my widgets. |
|
2262 |
The default here is true, however, the #showHelp:for: methods are empty. |
|
2263 |
These should be redefined to put the help text into some info label, |
|
2264 |
or into the views title bar. |
|
2265 |
You may also redefine the showingHelp/showingHelp: methods, to |
|
2266 |
remember the flag setting." |
|
2267 |
||
2268 |
^ true |
|
2269 |
||
2270 |
"Modified: / 31.7.1998 / 17:55:31 / cg" |
|
2271 |
! ! |
|
2272 |
||
2977 | 2273 |
!ApplicationModel methodsFor:'help texts'! |
2274 |
||
2275 |
basicFlyByHelpTextForKey:aKey |
|
2983
8e31ab670ea3
comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
2276 |
"flyByHelp interface: return some short help text for a key. |
2977 | 2277 |
key is the symbol associated with some widget or menu item. |
2278 |
Return the original (english) text; needs to be translated as per language" |
|
2279 |
||
2280 |
|helpSpecFromBindings helpText helpSpec "resourceArgs"| |
|
2281 |
||
3108 | 2282 |
helpSpecFromBindings := self aspectFor:#flyByHelpSpec. |
2977 | 2283 |
helpSpecFromBindings notNil ifTrue:[ |
3297 | 2284 |
helpText := helpSpecFromBindings at:aKey ifAbsent:nil. |
3108 | 2285 |
] ifFalse:[ |
3297 | 2286 |
helpSpecFromBindings := self aspectFor:#helpSpec. |
2287 |
helpSpecFromBindings notNil ifTrue:[ |
|
2288 |
helpText := helpSpecFromBindings at:aKey ifAbsent:nil. |
|
2289 |
]. |
|
2977 | 2290 |
]. |
2291 |
helpText isNil ifTrue:[ |
|
3297 | 2292 |
helpSpec := self flyByHelpSpec. |
2293 |
helpSpec notNil ifTrue:[ |
|
2294 |
helpText := helpSpec at:aKey ifAbsent:nil. |
|
2295 |
]. |
|
2977 | 2296 |
]. |
2297 |
||
2298 |
"/ new: allow for a collection (resource-key arg1 arg2...) |
|
2299 |
helpText isNonByteCollection ifTrue:[ |
|
3297 | 2300 |
helpText := helpText first. |
2977 | 2301 |
"/ resourceArgs := helpText copyFrom:2. |
2302 |
]. |
|
2303 |
^ helpText |
|
2304 |
||
2983
8e31ab670ea3
comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
2305 |
"Modified: / 27-01-2012 / 14:30:20 / cg" |
2977 | 2306 |
! |
2307 |
||
2308 |
basicHelpTextForKey:aKey |
|
2309 |
"activeHelp interface: return some help text for a key |
|
2310 |
key is the symbol associated with some widget or menu item. |
|
2311 |
Return the original (english) text; needs to be translated as per language" |
|
2312 |
||
2313 |
|helpText helpSpec "resourceArgs"| |
|
2314 |
||
2315 |
helpSpec := self helpSpec. |
|
2316 |
helpSpec notNil ifTrue:[ |
|
3297 | 2317 |
helpText := helpSpec at:aKey ifAbsent:nil. |
2977 | 2318 |
]. |
2319 |
||
2320 |
"/ new: allow for a collection (resource-key arg1 arg2...) |
|
2321 |
helpText isNonByteCollection ifTrue:[ |
|
3297 | 2322 |
helpText := helpText first. |
2977 | 2323 |
"/ resourceArgs := helpText copyFrom:2. |
2324 |
]. |
|
2325 |
^ helpText |
|
2326 |
! |
|
2327 |
||
2328 |
flyByHelpSpec |
|
2329 |
"activeHelp interface: return some short help text for a widget component" |
|
2330 |
||
3029 | 2331 |
|specFromBuilder| |
2332 |
||
2333 |
builder notNil ifTrue:[ |
|
3297 | 2334 |
(specFromBuilder := builder bindingAt:#flyByHelpSpec) notNil ifTrue:[ |
2335 |
^ specFromBuilder |
|
2336 |
]. |
|
3029 | 2337 |
|
2338 |
]. |
|
2977 | 2339 |
^ self class flyByHelpSpec |
2340 |
! |
|
2341 |
||
2342 |
flyByHelpTextFor:aComponent |
|
2343 |
"activeHelp interface: return some short help text for a widget component" |
|
2344 |
||
2345 |
|key| |
|
2346 |
||
2347 |
builder notNil ifTrue:[ |
|
3297 | 2348 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
2349 |
^ self flyByHelpTextForKey:key |
|
2350 |
] |
|
2977 | 2351 |
]. |
2352 |
masterApplication notNil ifTrue:[ |
|
3297 | 2353 |
^ masterApplication flyByHelpTextFor:aComponent |
2977 | 2354 |
]. |
2355 |
^ nil |
|
2356 |
||
2357 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
|
2358 |
! |
|
2359 |
||
2360 |
flyByHelpTextForKey:aKey |
|
2361 |
"flyByHelp interface: return some short help text for a key |
|
2362 |
key is the symbol associated with some widget or menu item. |
|
2363 |
(from my flyByHelpSpec); return a language variant (if available)" |
|
2364 |
||
2365 |
|helpText translatedHelpText translatedKey| |
|
2366 |
||
2367 |
ActiveHelp debugging ifTrue:[ Transcript showCR:'help key: ', aKey]. |
|
2368 |
||
2369 |
helpText := self basicFlyByHelpTextForKey:aKey. |
|
2370 |
helpText isNil ifTrue:[ |
|
3297 | 2371 |
masterApplication notNil ifTrue:[ |
2372 |
"here we get an already translated helpText" |
|
2373 |
helpText := masterApplication flyByHelpTextForKey:aKey. |
|
2374 |
]. |
|
2375 |
helpText isNil ifTrue:[ |
|
2376 |
"there is no help text - resolve key from resources" |
|
2377 |
helpText := (self translateString:aKey) withCRs. |
|
2378 |
]. |
|
2379 |
^ helpText. |
|
2977 | 2380 |
]. |
2381 |
"/ kludge to allow for dynamic translation by the application itself, avoiding the key translation below. |
|
2382 |
helpText isBlock ifTrue:[ |
|
3297 | 2383 |
^ helpText value. |
2977 | 2384 |
]. |
2385 |
||
2386 |
"get the translation" |
|
2387 |
translatedHelpText := self translateString:helpText. |
|
2983
8e31ab670ea3
comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
2388 |
(helpText = aKey and:[ translatedHelpText = helpText ]) ifTrue:[ |
3297 | 2389 |
"there is no translation in the resources - maybe there is one for the key?" |
2390 |
translatedKey := self translateString:aKey. |
|
2391 |
translatedKey ~~ aKey ifTrue:[ |
|
2392 |
translatedHelpText := translatedKey. |
|
2393 |
]. |
|
2977 | 2394 |
]. |
2395 |
^ translatedHelpText withCRs. |
|
2396 |
||
2983
8e31ab670ea3
comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents:
2981
diff
changeset
|
2397 |
"Modified: / 27-01-2012 / 14:33:54 / cg" |
2977 | 2398 |
! |
2399 |
||
2400 |
flyByHelpTextForKey:aKey row:aRowNr |
|
2401 |
"Special interface for DataSet - get the active help text for a specific row" |
|
2402 |
||
2403 |
"Default: no row specific help" |
|
2404 |
||
2405 |
^ self flyByHelpTextForKey:aKey. |
|
2406 |
! |
|
2407 |
||
2408 |
helpSpec |
|
2409 |
"activeHelp interface: return some short help text for a widget component" |
|
2410 |
||
2411 |
^ self class helpSpec |
|
2412 |
! |
|
2413 |
||
2414 |
helpTextFor:aComponent |
|
2415 |
"activeHelp interface: return some help text for a widget component" |
|
2416 |
||
2417 |
|key| |
|
2418 |
||
2419 |
builder notNil ifTrue:[ |
|
3297 | 2420 |
(key := builder helpKeyFor:aComponent) notNil ifTrue:[ |
2421 |
^ self helpTextForKey:key |
|
2422 |
] |
|
2977 | 2423 |
]. |
2424 |
masterApplication notNil ifTrue:[ |
|
3297 | 2425 |
^ masterApplication helpTextFor:aComponent |
2977 | 2426 |
]. |
2427 |
^ nil |
|
2428 |
||
2429 |
"Modified: / 31.7.1998 / 23:03:10 / cg" |
|
2430 |
! |
|
2431 |
||
2432 |
helpTextForKey:aKey |
|
2433 |
"activeHelp interface: return some help text for a key |
|
2434 |
key is the symbol associated with some widget or menu item. |
|
2435 |
(from my helpSpec); return a language variant (if available)" |
|
2436 |
||
2437 |
|helpText translatedHelpText translatedKey| |
|
2438 |
||
2439 |
helpText := self basicHelpTextForKey:aKey. |
|
2440 |
helpText isNil ifTrue:[ |
|
3297 | 2441 |
masterApplication notNil ifTrue:[ |
2442 |
"here we get an already translated helpText" |
|
2443 |
helpText := masterApplication helpTextForKey:aKey. |
|
2444 |
]. |
|
2445 |
helpText isNil ifTrue:[ |
|
2446 |
"there is no help text - resolve key from resources" |
|
2447 |
helpText := (self translateString:aKey) withCRs. |
|
2448 |
]. |
|
2449 |
^ helpText. |
|
2977 | 2450 |
|
2451 |
"/ aKey isSymbol ifFalse:[ |
|
2452 |
"/ ^ nil |
|
2453 |
"/ ]. |
|
2454 |
"/ "/ mhmh - is this a good idea ? |
|
2455 |
"/ "/ if someone already maps the flyByHelpTexts to the helpTexts |
|
2456 |
"/ helpText := self flyByHelpTextForKey:aKey. |
|
2457 |
"/ helpText notNil ifTrue:[ ^ helpText ]. |
|
3297 | 2458 |
^ nil. |
2977 | 2459 |
"/ ^ self resources string:'Sorry, no help for: %1' with:aKey "/ nil |
2460 |
]. |
|
2461 |
||
2462 |
"/ kludge to allow for dynamic translation by the application itself. |
|
2463 |
helpText isBlock ifTrue:[ |
|
3297 | 2464 |
^ helpText value. |
2977 | 2465 |
]. |
2466 |
||
2467 |
"get the translation" |
|
2468 |
translatedHelpText := self translateString:helpText. |
|
2469 |
translatedHelpText == helpText ifTrue:[ |
|
3297 | 2470 |
"there is no translation in the resources - maybe there is one for the key?" |
2471 |
translatedKey := self translateString:aKey. |
|
2472 |
translatedKey ~~ aKey ifTrue:[ |
|
2473 |
translatedHelpText := translatedKey. |
|
2474 |
]. |
|
2977 | 2475 |
]. |
2476 |
^ translatedHelpText withCRs. |
|
2477 |
||
2478 |
"Modified: / 22-12-2011 / 11:07:03 / cg" |
|
2479 |
! ! |
|
2480 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2481 |
!ApplicationModel methodsFor:'hooks'! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2482 |
|
2185 | 2483 |
aboutToOpen:whichTopView |
2484 |
"the topView is about to be opened. |
|
2485 |
This is sent by whichTopView, right before its really open |
|
2486 |
(i.e. finally visible)" |
|
2487 |
||
2488 |
self preOpenWith:builder |
|
2489 |
! |
|
2490 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2491 |
commonPostBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2492 |
"a common hook for postBuildWith: and postBuildAsSubcanvasWith:." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2493 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2494 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2495 |
commonPostOpen |
2921 | 2496 |
"a common hook for postOpenWith:, postOpenAsSubcanvasWith: and postOpenAsDialogWith:." |
2497 |
||
2498 |
"Modified (comment): / 07-07-2011 / 17:13:39 / cg" |
|
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2499 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2500 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2501 |
commonPreBuild |
2921 | 2502 |
"a common hook for preBuildWith:, preBuildAsSubcanvasWith: and preBuildAsDialogWith:." |
2503 |
||
2504 |
"Modified (comment): / 07-07-2011 / 17:13:51 / cg" |
|
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2505 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2506 |
|
3297 | 2507 |
commonPreOpen |
2508 |
"A common hook for preOpenWith:, preOpenAsSubcanvasWith: and preOpenAsDialogWith:." |
|
2509 |
||
2510 |
"Created: / 05-03-2014 / 18:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2511 |
! |
|
2512 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2513 |
postApplicationProcessCreate:newProcess windowGroup:newGroup |
3297 | 2514 |
"this is sent whenever a new application is launched from this app, |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2515 |
which forks its own windowGroup process. Allows for process group management, |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2516 |
or process-global exception handlers to be installed. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2517 |
Nothing done here - to be redefined in concrete applications" |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2518 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2519 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2520 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2521 |
postBuildAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2522 |
"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
|
2523 |
Can be redefined in subclasses for additional setup after |
2921 | 2524 |
the subcanvas' view has been built, but not yet opened." |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2525 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2526 |
|sameApp| |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2527 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2528 |
sameApp := aBuilder application == aBuilder window topView application. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2529 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2530 |
"/ If I am opened as subcanvas in another application |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2531 |
"/ then treat this like a regular open. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2532 |
"/ otherwise ignore it. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2533 |
sameApp ifFalse:[ |
3297 | 2534 |
self postBuildWith:aBuilder. |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2535 |
] ifTrue:[ |
3297 | 2536 |
"/ I no not think, that this is a good default |
2537 |
"/ self commonPostBuild. |
|
2921 | 2538 |
]. |
2539 |
||
2540 |
"Modified (comment): / 07-07-2011 / 17:16:30 / cg" |
|
2541 |
! |
|
2542 |
||
2543 |
postBuildDialogWith:aBuilder |
|
2544 |
"this is sent after an interface is built from a spec as dialog with me |
|
2545 |
as a source (for aspects) i.e. via openDialogInterface:. |
|
2546 |
Can be redefined in subclasses for additional setup after |
|
2547 |
the dialog's view has been built, but not yet opened." |
|
2548 |
||
2549 |
|sameApp| |
|
2550 |
||
2551 |
sameApp := (aBuilder application == aBuilder window topView application). |
|
2552 |
||
2553 |
"/ If I am opened as subcanvas in another application |
|
2554 |
"/ then treat this like a regular open. |
|
2555 |
"/ otherwise ignore it. |
|
2556 |
sameApp ifFalse:[ |
|
3297 | 2557 |
self postBuildWith:aBuilder. |
2921 | 2558 |
] ifTrue:[ |
3297 | 2559 |
self commonPostBuild. |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2560 |
]. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2561 |
|
2921 | 2562 |
"Modified: / 08-07-1998 / 18:28:55 / cg" |
2563 |
"Created: / 07-07-2011 / 17:20:29 / cg" |
|
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2564 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2565 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2566 |
postBuildWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2567 |
"this is sent after an interface is built from a spec. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2568 |
Can be redefined in subclasses for additional setup after |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2569 |
the view has been built, but not yet opened." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2570 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2571 |
self commonPostBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2572 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2573 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2574 |
postOpenAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2575 |
"this is sent after the applications window is opened inside another application. |
2921 | 2576 |
Can be redefined in subclasses for actions after showing the canvas view." |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2577 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2578 |
self commonPostOpen |
2921 | 2579 |
|
2580 |
"Modified (comment): / 07-07-2011 / 17:16:46 / cg" |
|
2581 |
! |
|
2582 |
||
2583 |
postOpenDialogWith:aBuilder |
|
2584 |
"this is sent after the applications window is opened as a dialog with me |
|
2585 |
as a source (for aspects) i.e. via openDialogInterface:. |
|
2586 |
Can be redefined in subclasses for actions after opening a dialog view." |
|
2587 |
||
3297 | 2588 |
self commonPostOpen |
2589 |
||
2921 | 2590 |
"Created: / 07-07-2011 / 17:20:37 / cg" |
3297 | 2591 |
"Modified: / 05-03-2014 / 18:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2592 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2593 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2594 |
postOpenWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2595 |
"this is sent after the applications main window is opened. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2596 |
Can be redefined in subclasses for actions after opening the view." |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2597 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2598 |
self commonPostOpen |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2599 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2600 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2601 |
preBuildAsSubcanvasWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2602 |
"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
|
2603 |
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
|
2604 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2605 |
self commonPreBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2606 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2607 |
|
2921 | 2608 |
preBuildDialogWith:aBuilder |
2609 |
"this is sent before an interface is built from a spec as a dialog with me |
|
2610 |
as a source (for aspects) i.e. via openDialogInterface:. |
|
2611 |
Can be redefined for apps which need to be informed about that." |
|
2612 |
||
2613 |
"Created: / 07-07-2011 / 17:20:48 / cg" |
|
2614 |
! |
|
2615 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2616 |
preBuildWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2617 |
"this is sent before an interface is built from a spec. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2618 |
Can be redefined in subclasses. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2619 |
mhmh - what should this do here ?" |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2620 |
|
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2621 |
self commonPreBuild |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2622 |
! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2623 |
|
3297 | 2624 |
preOpenAsSubcanvasWith:aBuilder |
2625 |
"this is sent before the applications window is opened inside another application. |
|
2626 |
Can be redefined in subclasses for actions after showing the canvas view." |
|
2627 |
||
2628 |
self commonPreOpen |
|
2629 |
||
2630 |
"Created: / 05-03-2014 / 18:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2631 |
! |
|
2632 |
||
2633 |
preOpenDialogWith:aBuilder |
|
2634 |
"this is sent after the applications window is opened as a dialog with me |
|
2635 |
as a source (for aspects) i.e. via openDialogInterface:. |
|
2636 |
Can be redefined in subclasses for actions after opening a dialog view." |
|
2637 |
||
2638 |
self commonPreOpen |
|
2639 |
||
2640 |
"Created: / 05-03-2014 / 18:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2641 |
! |
|
2642 |
||
1991
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2643 |
preOpenWith:aBuilder |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2644 |
"this is sent before the applications main window is opened. |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2645 |
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
|
2646 |
! ! |
b74357a16333
commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents:
1988
diff
changeset
|
2647 |
|
1419 | 2648 |
!ApplicationModel methodsFor:'initialization'! |
2649 |
||
2650 |
addTopViewsToCurrentProject |
|
2651 |
"add all of my topViews to the current projects list of views. |
|
2652 |
This allows hiding views on a per-project basis. |
|
2653 |
Applications which do not want to be switched with projects |
|
2654 |
(such as the Launcher), may redefine this to a noop." |
|
2655 |
||
1972 | 2656 |
|wg| |
2657 |
||
2658 |
(wg := self windowGroup) notNil ifTrue:[ |
|
3297 | 2659 |
(wg topViews ? #()) do:[:aView | |
2660 |
aView addToCurrentProject |
|
2661 |
] |
|
1419 | 2662 |
] |
2663 |
||
2664 |
"Modified: 17.1.1997 / 19:43:39 / cg" |
|
2665 |
! |
|
2666 |
||
2667 |
basicInitialize |
|
2668 |
"initialize the application. |
|
2669 |
Since ST-80 applications seem commonly to redefine #initialize |
|
2670 |
without doing a super initialize, the real initialization is |
|
2671 |
done here ..." |
|
2672 |
||
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2673 |
self initializeDevice. |
1419 | 2674 |
|
2675 |
"claus: I wanted to delay the creation & assignment of the |
|
2676 |
builder till later, to allow setting to another builder. |
|
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2677 |
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
|
2678 |
creation, which might lead to trouble. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2679 |
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
|
2680 |
late. |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2681 |
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
|
2682 |
" |
1419 | 2683 |
|
2684 |
"/ builder := self builderClass new. |
|
2685 |
"/ builder notNil ifTrue:[builder application:self]. |
|
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2686 |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2687 |
self initializeResources. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2688 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2689 |
"Modified: / 13-09-2006 / 12:39:30 / cg" |
1419 | 2690 |
! |
2691 |
||
2692 |
initialize |
|
2693 |
"nothing done here; |
|
2694 |
but can be redefined in concrete applications" |
|
2695 |
! |
|
2696 |
||
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2697 |
initializeDevice |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2698 |
self isWebService ifTrue:[ |
3297 | 2699 |
self initializeWebServiceDevice |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2700 |
] ifFalse:[ |
3297 | 2701 |
self initializeScreenDevice |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2702 |
]. |
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2703 |
! |
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2704 |
|
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2705 |
initializeResources |
2365
4050feaebfc2
slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents:
2364
diff
changeset
|
2706 |
"initialize the applications resources (NLS support)." |
2211
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2707 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2708 |
resources := self class classResources. |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2709 |
|
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2710 |
"Created: / 13-09-2006 / 12:39:22 / cg" |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2711 |
! |
66b7109e72e6
better resource flushing support
Claus Gittinger <cg@exept.de>
parents:
2185
diff
changeset
|
2712 |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2713 |
initializeScreenDevice |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2714 |
Screen notNil ifTrue:[ |
3297 | 2715 |
device := Screen current. |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2716 |
] |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2717 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2718 |
|
1419 | 2719 |
setDevice:aDevice |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
2720 |
"set the device (i.e. some Screen), where the application shall open its view(s). |
1419 | 2721 |
The default device (if not set here) will be the current screen." |
2722 |
||
2723 |
device := aDevice |
|
2724 |
||
2725 |
"Created: 5.7.1996 / 12:01:40 / cg" |
|
2726 |
"Modified: 17.1.1997 / 19:44:09 / cg" |
|
2727 |
! ! |
|
2728 |
||
2729 |
!ApplicationModel methodsFor:'opening'! |
|
2730 |
||
2731 |
open |
|
2980 | 2732 |
"open a standard interface. |
2733 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1419 | 2734 |
|
2735 |
^ self openInterface |
|
2736 |
||
2980 | 2737 |
"Modified: / 03-05-1996 / 13:39:15 / cg" |
2738 |
"Modified (comment): / 27-12-2011 / 10:42:15 / cg" |
|
1419 | 2739 |
! |
2740 |
||
1592
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2741 |
openAndWaitUntilVisible |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2742 |
"open a standard interface, and wait until my window is visible" |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2743 |
|
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2744 |
self open. |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2745 |
self window waitUntilVisible. |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2746 |
! |
dd8fc50564c0
added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents:
1590
diff
changeset
|
2747 |
|
1634 | 2748 |
openAs:windowType |
2980 | 2749 |
"open a standard interface as slave, partner, dialog, popUp, undecorated etc. |
2750 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1634 | 2751 |
|
2752 |
^ self openInterfaceAs:windowType |
|
2753 |
||
2898 | 2754 |
"Modified: / 04-03-2011 / 15:03:19 / cg" |
2980 | 2755 |
"Modified (comment): / 27-12-2011 / 10:42:28 / cg" |
1634 | 2756 |
! |
2757 |
||
2758 |
openAsSlave |
|
1726 | 2759 |
"open a standard interface as slave. |
2760 |
Notice: there is still a need to make the current window a master |
|
3297 | 2761 |
(see code and comments in WindowBuilder >> openAt:withExtent:andType:)" |
1634 | 2762 |
|
2763 |
^ self openAs:#slave |
|
1724 | 2764 |
|
2765 |
" |
|
2766 |
WorkspaceApplication new openAsSlave. |
|
2767 |
" |
|
1634 | 2768 |
! |
2769 |
||
1419 | 2770 |
openAt:aPoint |
2771 |
"open a standard interface at some point" |
|
2772 |
||
2773 |
^ self openInterfaceAt:aPoint |
|
2774 |
||
2775 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2776 |
"Created: 14.2.1997 / 20:17:41 / cg" |
|
2777 |
! |
|
2778 |
||
3181 | 2779 |
openAtPointer |
2780 |
"open a standard interface at the current pointer position. |
|
2781 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
2782 |
||
2783 |
^ self openInterfaceAt:(device pointerPosition) |
|
2784 |
! |
|
2785 |
||
1419 | 2786 |
openInterface |
2787 |
"open a standard interface. |
|
2788 |
||
3297 | 2789 |
Subclasses which do not have an interfaceSpec |
1419 | 2790 |
should redefine this method and create & open their view(s) there. |
2980 | 2791 |
(see Launcher as an example). |
2792 |
||
2793 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1419 | 2794 |
|
1985 | 2795 |
^ self openInterface:(self defaultWindowSpecName) |
1419 | 2796 |
|
2980 | 2797 |
"Modified: / 09-09-1996 / 22:39:23 / stefan" |
2798 |
"Modified: / 23-01-1998 / 18:16:50 / cg" |
|
2799 |
"Modified (comment): / 27-12-2011 / 10:42:04 / cg" |
|
1419 | 2800 |
! |
2801 |
||
2802 |
openInterface:aSymbol |
|
2895 | 2803 |
"open a specific interface. |
2804 |
||
1419 | 2805 |
The argument, aSymbol specifies which interface. The concrete |
2806 |
application subclass must provide a method with that name, |
|
3297 | 2807 |
which must return an interfaceSpec. |
2895 | 2808 |
This is forwarded to the builder to create the views. |
2980 | 2809 |
Typically, applications only use one interface, returned by the #windowSpec method. |
2810 |
||
2811 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1419 | 2812 |
|
2813 |
self allButOpenInterface:aSymbol. |
|
2814 |
self openWindow. |
|
2815 |
^ builder |
|
2816 |
||
2895 | 2817 |
"Modified: / 03-03-2011 / 18:57:04 / cg" |
2980 | 2818 |
"Modified (comment): / 27-12-2011 / 10:41:54 / cg" |
1419 | 2819 |
! |
2820 |
||
1634 | 2821 |
openInterface:aSymbol as:windowType |
2895 | 2822 |
"open a specific interface in a special mode. |
2823 |
||
3297 | 2824 |
The argument, aSymbol specifies which interface. |
1634 | 2825 |
The concrete application subclass must provide a method with that name, |
2826 |
which must return an interfaceSpec. This is forwarded to the builder to create the views. |
|
2827 |
Typically, applications only use one interface, returned by the #windowSpec method. |
|
2980 | 2828 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc. |
2829 |
||
2830 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1634 | 2831 |
|
2832 |
self allButOpenInterface:aSymbol. |
|
2833 |
self openWindowAs:windowType. |
|
2834 |
^ builder |
|
2835 |
||
2895 | 2836 |
"Modified: / 03-03-2011 / 18:56:23 / cg" |
2980 | 2837 |
"Modified (comment): / 27-12-2011 / 10:42:37 / cg" |
1634 | 2838 |
! |
2839 |
||
1419 | 2840 |
openInterface:aSymbol at:aLocation |
3297 | 2841 |
"open a specific interface at a location in default mode. |
1419 | 2842 |
|
2843 |
The argument, aSymbol specifies which interface. The concrete |
|
2844 |
application subclass must provide a method with that name, |
|
2845 |
which must return an interfaceSpec. This is forwarded to |
|
2846 |
the builder to create the views. |
|
3297 | 2847 |
Typically, applications only use one interface, |
1419 | 2848 |
returned by the #windowSpec method." |
2849 |
||
2850 |
self allButOpenInterface:aSymbol. |
|
2851 |
self openWindowAt:aLocation. |
|
2852 |
^ builder |
|
2853 |
||
2895 | 2854 |
"Created: / 14-02-1997 / 20:19:44 / cg" |
2855 |
"Modified: / 03-03-2011 / 18:55:26 / cg" |
|
1419 | 2856 |
! |
2857 |
||
1634 | 2858 |
openInterfaceAs:windowType |
2895 | 2859 |
"open a standard interface in a special mode. |
2860 |
||
2898 | 2861 |
The windowType can be any of #slave, #partner, #dialog, #popUp, #undecorated etc." |
1634 | 2862 |
|
1985 | 2863 |
^ self openInterface:(self defaultWindowSpecName) as:windowType |
1634 | 2864 |
|
2895 | 2865 |
"Modified: / 09-09-1996 / 22:39:23 / stefan" |
2898 | 2866 |
"Modified: / 04-03-2011 / 15:03:28 / cg" |
1634 | 2867 |
! |
2868 |
||
1419 | 2869 |
openInterfaceAt:aLocation |
2870 |
"open a standard interface." |
|
2871 |
||
1985 | 2872 |
^ self openInterface:(self defaultWindowSpecName) at:aLocation |
1419 | 2873 |
|
2874 |
"Created: / 14.2.1997 / 20:18:20 / cg" |
|
2875 |
"Modified: / 23.1.1998 / 18:17:13 / cg" |
|
2876 |
! |
|
2877 |
||
2878 |
openInterfaceModal |
|
2980 | 2879 |
"open a standard interface as a modal dialog. |
2880 |
Sorry, but for visualworks compatibility, the builder is returned" |
|
1419 | 2881 |
|
1985 | 2882 |
^ self openInterfaceModal:(self defaultWindowSpecName) |
1419 | 2883 |
|
2895 | 2884 |
"Modified: / 09-09-1996 / 22:39:23 / stefan" |
2885 |
"Modified: / 03-03-2011 / 18:54:48 / cg" |
|
2980 | 2886 |
"Modified (comment): / 27-12-2011 / 10:42:53 / cg" |
1419 | 2887 |
! |
2888 |
||
2889 |
openInterfaceModal:aSymbol |
|
3297 | 2890 |
"open a specific interface as a modal dialog. |
1419 | 2891 |
The argument, aSymbol specifies which interface. The concrete |
2892 |
application subclass must provide a method with that name, |
|
2893 |
which must return an interfaceSpec. This is forwarded to |
|
2894 |
the builder to create the views. |
|
3297 | 2895 |
Typically, applications only use one interface, |
1419 | 2896 |
returned by the #windowSpec method." |
2897 |
||
2898 |
self allButOpenInterface:aSymbol. |
|
2899 |
self openWindowModal. |
|
2900 |
^ builder |
|
2901 |
||
2902 |
"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
|
2903 |
! |
ac96df5a2f97
oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents:
967
diff
changeset
|
2904 |
|
1419 | 2905 |
openInterfaceModal:aSymbol at:location |
3297 | 2906 |
"open a specific interface modal at some screen location. |
1419 | 2907 |
The argument, aSymbol specifies which interface. The concrete |
2908 |
application subclass must provide a method with that name, |
|
2909 |
which must return an interfaceSpec. This is forwarded to |
|
2910 |
the builder to create the views. |
|
3297 | 2911 |
Typically, applications only use one interface, |
1419 | 2912 |
returned by the #windowSpec method." |
2913 |
||
2914 |
self allButOpenInterface:aSymbol. |
|
2915 |
self openWindowModalAt:location. |
|
2916 |
^ builder |
|
2917 |
||
2918 |
"Modified: 14.2.1997 / 20:25:33 / cg" |
|
2919 |
! |
|
2920 |
||
2921 |
openModal |
|
2922 |
"open a standard interface as a modal dialog" |
|
2923 |
||
2924 |
^ self openInterfaceModal |
|
2925 |
||
2926 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
2927 |
! |
|
2928 |
||
2929 |
openOnDevice:aDevice |
|
2930 |
"open a standard interface on some other device" |
|
2931 |
||
2932 |
self setDevice:aDevice. |
|
3365 | 2933 |
Screen currentScreenQuerySignal |
2934 |
answer:aDevice |
|
2935 |
do:[ |
|
2936 |
^ self open |
|
2937 |
] |
|
1419 | 2938 |
|
2939 |
"Created: 13.1.1997 / 21:24:11 / cg" |
|
2940 |
"Modified: 13.1.1997 / 21:24:30 / cg" |
|
2941 |
! |
|
2942 |
||
2943 |
openSpec:anInterfaceSpec |
|
2944 |
"open a view as specified in anInterfaceSpec." |
|
2945 |
||
2946 |
self allButOpenFrom:anInterfaceSpec. |
|
2947 |
self openWindow. |
|
2948 |
^ builder |
|
2949 |
||
2950 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
|
2951 |
"Created: / 20.5.1998 / 20:08:51 / cg" |
|
2952 |
! |
|
2953 |
||
2393 | 2954 |
openSpec:anInterfaceSpec withBindings:bindings |
2955 |
"open a view as specified in anInterfaceSpec." |
|
2956 |
||
2624 | 2957 |
self openSpec:anInterfaceSpec withBindings:bindings modal:false |
2958 |
! |
|
2959 |
||
2960 |
openSpec:anInterfaceSpec withBindings:bindings modal:modal |
|
2961 |
"open a view as specified in anInterfaceSpec." |
|
2962 |
||
2393 | 2963 |
self createBuilder. |
3297 | 2964 |
builder bindings:bindings. |
2393 | 2965 |
self allButOpenFrom:anInterfaceSpec. |
2624 | 2966 |
modal ifTrue:[ |
3297 | 2967 |
self openWindowModal. |
2624 | 2968 |
] ifFalse:[ |
3297 | 2969 |
self openWindow. |
2624 | 2970 |
] |
2393 | 2971 |
! |
2972 |
||
1419 | 2973 |
openSpecModal:anInterfaceSpec |
2974 |
"open an interface spec modal" |
|
2975 |
||
2976 |
self allButOpenFrom:anInterfaceSpec. |
|
2977 |
self openWindowModal. |
|
2978 |
^ builder |
|
2979 |
||
2980 |
"Modified: / 14.2.1997 / 20:25:33 / cg" |
|
2981 |
"Created: / 20.5.1998 / 20:20:21 / cg" |
|
2982 |
! |
|
2983 |
||
2984 |
openWindow |
|
3297 | 2985 |
"open the window |
2921 | 2986 |
- assumes that the builder has already setup the interface." |
2987 |
||
2988 |
builder "openWindow." |
|
3297 | 2989 |
openAt:nil |
2990 |
withExtent:(self defaultWindowExtent) |
|
2991 |
andType:(self defaultWindowType) |
|
1419 | 2992 |
|
2270
a7c797806d46
correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents:
2262
diff
changeset
|
2993 |
"Created: / 14-02-1997 / 20:20:39 / cg" |
2923 | 2994 |
"Modified: / 11-07-2011 / 22:30:27 / cg" |
1419 | 2995 |
! |
2996 |
||
1634 | 2997 |
openWindowAs:windowType |
3297 | 2998 |
"open the window - assumes that the builder has already setup the interface. |
1634 | 2999 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc." |
3000 |
||
3297 | 3001 |
builder |
3002 |
openAt:nil |
|
3003 |
withExtent:(self defaultWindowExtent) |
|
3004 |
andType:windowType |
|
2921 | 3005 |
|
2923 | 3006 |
"Modified: / 11-07-2011 / 22:30:35 / cg" |
1634 | 3007 |
! |
3008 |
||
2931 | 3009 |
openWindowAs:windowType at:originOrNil |
3297 | 3010 |
"open the window - assumes that the builder has already setup the interface. |
2931 | 3011 |
The windowType can be any of #slave, #partner, #dialog, #popUp etc." |
3012 |
||
3297 | 3013 |
builder |
3014 |
openAt:originOrNil |
|
3015 |
withExtent:(self defaultWindowExtent) |
|
3016 |
andType:windowType |
|
2931 | 3017 |
|
3018 |
"Modified: / 11-07-2011 / 22:30:35 / cg" |
|
3019 |
"Created: / 25-07-2011 / 16:00:24 / cg" |
|
3020 |
! |
|
3021 |
||
2921 | 3022 |
openWindowAt:aPoint |
3297 | 3023 |
"open the window |
2921 | 3024 |
- assumes that the builder has already setup the interface." |
3025 |
||
3026 |
builder "openWindowAt:aLocation." |
|
3297 | 3027 |
openAt:aPoint |
3028 |
withExtent:(self defaultWindowExtent) |
|
3029 |
andType:(self defaultWindowType) |
|
2921 | 3030 |
|
3031 |
"Created: / 14-02-1997 / 20:20:55 / cg" |
|
1419 | 3032 |
! |
3033 |
||
3034 |
openWindowAtCenter |
|
3035 |
"open the window centered on the screen |
|
3036 |
- assumes that the builder has already setup the interface." |
|
3037 |
||
3038 |
builder openWindowAt:#center |
|
3039 |
||
3040 |
"Created: 14.2.1997 / 20:20:55 / cg" |
|
3041 |
! |
|
3042 |
||
3043 |
openWindowModal |
|
2921 | 3044 |
"open the window as a modal dialog |
3045 |
- assumes that the builder has already setup the interface." |
|
1419 | 3046 |
|
3047 |
"/ builder openDialog. |
|
3048 |
builder |
|
3297 | 3049 |
openAt:nil |
3050 |
withExtent:(self defaultWindowExtent) |
|
3051 |
andType:#dialog |
|
1419 | 3052 |
|
2921 | 3053 |
"Created: / 14-02-1997 / 20:20:39 / cg" |
1419 | 3054 |
! |
3055 |
||
3056 |
openWindowModalAt:aLocation |
|
2921 | 3057 |
"open the window as a modal dialog |
3058 |
- assumes that the builder has already setup the interface." |
|
1419 | 3059 |
|
3060 |
builder openDialogAt:aLocation. |
|
3061 |
||
2921 | 3062 |
"Created: / 14-02-1997 / 20:20:55 / cg" |
1419 | 3063 |
! |
3064 |
||
1478 | 3065 |
openWithExtent:extPoint |
3066 |
"open a standard interface with given extent" |
|
3067 |
||
3068 |
|bldr| |
|
3069 |
||
3070 |
bldr := self allButOpen. |
|
3071 |
bldr openWithExtent:extPoint. |
|
3072 |
^ bldr |
|
3073 |
||
3074 |
"Modified: 3.5.1996 / 13:39:15 / cg" |
|
3075 |
! |
|
3076 |
||
1968 | 3077 |
opened:whichTopView |
3078 |
"the topView has been opened. |
|
3079 |
This is sent by whichTopView, when its really open |
|
3080 |
(i.e. finally visible)" |
|
3081 |
||
3082 |
self addTopViewsToCurrentProject. |
|
3083 |
self postOpenWith:builder |
|
1419 | 3084 |
! ! |
3085 |
||
2921 | 3086 |
!ApplicationModel methodsFor:'opening-dialogs'! |
3087 |
||
3088 |
openDialog |
|
3297 | 3089 |
"open my window as a modal dialog |
2921 | 3090 |
- assumes that the builder has already setup the interface." |
3091 |
||
3092 |
self window beToolDialog. |
|
3093 |
^ builder openDialog. |
|
3094 |
||
3095 |
"Modified: / 14-02-1997 / 20:32:52 / cg" |
|
3096 |
"Modified (comment): / 07-07-2011 / 17:25:45 / cg" |
|
3097 |
! |
|
3098 |
||
3099 |
openDialogInterface:aSelector |
|
3100 |
"open a dialog" |
|
3101 |
||
3102 |
"/ Notice: the opened dialog will be technically another instance |
|
3103 |
"/ (of SimpleDialog) but use me as aspect provider. |
|
3104 |
"/ It will call postOpenDialog: and postBuildDialog: as callbacks. |
|
3105 |
||
3106 |
^ self openDialogInterface:aSelector withBindings:nil |
|
3107 |
||
3108 |
"Modified: / 28-02-1997 / 14:08:01 / cg" |
|
3109 |
"Modified (comment): / 07-07-2011 / 17:25:26 / cg" |
|
3110 |
! |
|
3111 |
||
3112 |
openDialogInterface:aSelector withBindings:bindings |
|
3113 |
"open a dialog, given a spec-selector" |
|
3114 |
||
3115 |
"/ Notice: the opened dialog will be technically another instance |
|
3116 |
"/ (of SimpleDialog) but use me as aspect provider. |
|
3117 |
"/ It will call postOpenDialog: and postBuildDialog: as callbacks. |
|
3118 |
||
3297 | 3119 |
^ SimpleDialog new |
3120 |
openFor:self |
|
3121 |
interface:aSelector |
|
3122 |
withBindings:bindings |
|
2921 | 3123 |
|
3124 |
"Created: / 28-02-1997 / 14:07:45 / cg" |
|
3125 |
"Modified: / 23-01-1998 / 18:18:14 / cg" |
|
3126 |
"Modified (comment): / 07-07-2011 / 17:25:23 / cg" |
|
3127 |
! |
|
3128 |
||
3129 |
openDialogInterfaceSpec:aSpec withBindings:bindings |
|
3130 |
"open a dialog, given a spec" |
|
3131 |
||
3132 |
"/ Notice: the opened dialog will be technically another instance |
|
3133 |
"/ (of SimpleDialog) but use me as aspect provider. |
|
3134 |
"/ It will call postOpenDialog: and postBuildDialog: as callbacks. |
|
3135 |
||
3297 | 3136 |
^ SimpleDialog new |
3137 |
openFor:self |
|
3138 |
interfaceSpec:aSpec |
|
3139 |
withBindings:bindings |
|
2921 | 3140 |
|
3141 |
"Created: / 28-02-1997 / 14:07:45 / cg" |
|
3142 |
"Modified: / 23-01-1998 / 18:18:14 / cg" |
|
3143 |
"Modified (comment): / 07-07-2011 / 17:25:20 / cg" |
|
3144 |
! |
|
3145 |
||
3146 |
openDialogSpec:aSpec withBindings:bindings |
|
3147 |
"open a dialog" |
|
3148 |
||
3149 |
"/ Notice: the opened dialog will be technically another instance |
|
3150 |
"/ (of SimpleDialog) but use me as aspect provider. |
|
3151 |
"/ It will call postOpenDialog: and postBuildDialog: as callbacks. |
|
3152 |
||
3297 | 3153 |
^ SimpleDialog new |
3154 |
openFor:self |
|
3155 |
spec:aSpec |
|
3156 |
withBindings:bindings |
|
2921 | 3157 |
|
3158 |
"Modified: / 23-01-1998 / 18:18:14 / cg" |
|
3159 |
"Created: / 20-05-1998 / 20:27:56 / cg" |
|
3160 |
! ! |
|
3161 |
||
2380 | 3162 |
!ApplicationModel methodsFor:'opening-webInterface'! |
3163 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3164 |
addToService |
3297 | 3165 |
self service |
3166 |
addPage:(builder page) |
|
3167 |
link:(self webLink) |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3168 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3169 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3170 |
createWebBuilder |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3171 |
"create a Web-UIBuilder if not already present" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3172 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3173 |
builder isNil ifTrue:[ |
3297 | 3174 |
builder := self webBuilderClass new. |
3175 |
builder application:self. |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3176 |
] |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3177 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3178 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3179 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3180 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3181 |
defaultPageSpecName |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3182 |
^ #pageSpec |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3183 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3184 |
|
2380 | 3185 |
defineInterface |
3186 |
"define a standard interface. |
|
3187 |
||
3297 | 3188 |
Subclasses which do not have an interfaceSpec |
2380 | 3189 |
should redefine this method and create their page there." |
3190 |
||
3191 |
^ self defineInterface:(self defaultPageSpecName) |
|
3192 |
! |
|
3193 |
||
3194 |
defineInterface:aSpecSymbol |
|
3195 |
"define an interface." |
|
3196 |
||
3197 |
^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol) |
|
3198 |
! |
|
3199 |
||
3200 |
defineInterfaceFrom:aSpec |
|
3201 |
"define an interface (setup a page), given a spec." |
|
3202 |
||
3203 |
|page| |
|
3204 |
||
3205 |
builder isNil ifTrue:[ |
|
3297 | 3206 |
self createWebBuilder. |
2380 | 3207 |
]. |
3208 |
||
3209 |
self preBuildWith:builder. |
|
3210 |
builder buildPageFromSpec:aSpec. |
|
3211 |
page := builder page. |
|
3212 |
page application:self. |
|
3213 |
||
3214 |
self postBuildWith:builder. |
|
3215 |
||
3216 |
"Modified: / 19.6.1998 / 03:35:31 / cg" |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3217 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3218 |
|
2554
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3219 |
httpServerPort |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3220 |
"on which port will a HTTP server be started" |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3221 |
|
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3222 |
^ self class defaultHttpServerPort |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3223 |
! |
d76514961c2f
Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents:
2549
diff
changeset
|
3224 |
|
2547
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3225 |
initializeAsWebServiceOnWebDevice:webDevice |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3226 |
self setDevice:(WebApplicationDevice new). |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3227 |
self initialize. |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3228 |
self initializeWebServiceDevice. |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3229 |
self initializeResources. |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3230 |
! |
b0896e2b4a9c
changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents:
2545
diff
changeset
|
3231 |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3232 |
initializeWebServiceDevice |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3233 |
"no real device here; instead, we need a web service in which I register. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3234 |
The device is a dummy one, to make the protocol transparent & compatible" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3235 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3236 |
|server| |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3237 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3238 |
self service isNil ifTrue:[ |
3297 | 3239 |
server := HTTPServer serverOnPort:(self httpServerPort). |
3240 |
||
3241 |
self service:(server |
|
3242 |
serviceForLink:(self serviceLinkName) |
|
3243 |
ifAbsent:[ |
|
3244 |
|service| |
|
3245 |
||
3246 |
service := HTTPPortalService new. |
|
3247 |
service linkName:(self serviceLinkName). |
|
3248 |
service class unRegisterServiceOn:server. |
|
3249 |
service registerServiceOn:server. |
|
3250 |
service |
|
3251 |
]). |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3252 |
]. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3253 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3254 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3255 |
pageSpecs |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3256 |
^ self class pageSpecs |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3257 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3258 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3259 |
service |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3260 |
device isNil ifTrue:[^ nil]. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3261 |
self assert:(device isWebServiceDevice). |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3262 |
^ device service |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3263 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3264 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3265 |
service:something |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3266 |
self device service:something. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3267 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3268 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3269 |
serviceLinkName |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3270 |
^ self class defaultServiceLinkName |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3271 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3272 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3273 |
startAsWebService |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3274 |
device isNil ifTrue:[ |
3297 | 3275 |
self initializeDevice. |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3276 |
]. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3277 |
self startInPortalService:self service |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3278 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3279 |
" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3280 |
self new startInWebService |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3281 |
" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3282 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3283 |
|
3297 | 3284 |
startInPortalService:aPortalServiceOrSession |
2632
ced2473521b1
changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3285 |
aPortalServiceOrSession application:self. |
ced2473521b1
changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents:
2631
diff
changeset
|
3286 |
self service:aPortalServiceOrSession. |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3287 |
self defineInterface. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3288 |
self addToService. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3289 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3290 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3291 |
webBuilderClass |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3292 |
"return the UIBuilder class for me. |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3293 |
This method can be redefined if (eventually) there are |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3294 |
spec readers for other UI languages (motif UIL ?)" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3295 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3296 |
^ WebPageBuilder |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3297 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3298 |
"Created: / 19.6.1998 / 01:39:26 / cg" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3299 |
"Modified: / 19.6.1998 / 01:45:24 / cg" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3300 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3301 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3302 |
webLink |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3303 |
"if nil is returned, I will install my page(s) right under the serviceLink (i.e. /portal/nn). |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3304 |
Otherwise, they will be under (i.e. /portal/link/nn)" |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3305 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3306 |
^ self device webLink |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3307 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3308 |
|
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3309 |
webLink:something |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3310 |
self device webLink:something |
2380 | 3311 |
! ! |
3312 |
||
1419 | 3313 |
!ApplicationModel methodsFor:'private'! |
3314 |
||
3315 |
builderClass |
|
3316 |
"return the UIBuilder class for me. |
|
3317 |
This method can be redefined if (eventually) there are |
|
3318 |
spec readers for other UI languages (motif UIL ?)" |
|
3319 |
||
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3320 |
self isWebService ifTrue:[ |
3297 | 3321 |
^ self webBuilderClass |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3322 |
]. |
1419 | 3323 |
^ UIBuilder |
3324 |
||
3325 |
"Created: / 19.6.1998 / 01:39:26 / cg" |
|
3326 |
"Modified: / 19.6.1998 / 01:45:24 / cg" |
|
3327 |
! |
|
3328 |
||
3329 |
createBuilder |
|
1431 | 3330 |
"create a WindowBuilder if not already present" |
3331 |
||
1419 | 3332 |
builder isNil ifTrue:[ |
3297 | 3333 |
builder := self builderClass new. |
3334 |
builder application:self. |
|
1419 | 3335 |
] |
3336 |
||
3337 |
"Created: / 19.6.1998 / 03:32:37 / cg" |
|
3338 |
! ! |
|
3339 |
||
3340 |
!ApplicationModel methodsFor:'queries'! |
|
3341 |
||
2923 | 3342 |
defaultWindowExtent |
3203 | 3343 |
^ self class defaultExtentFor:self class |
2923 | 3344 |
|
3345 |
"Created: / 11-07-2011 / 22:30:12 / cg" |
|
3346 |
! |
|
3347 |
||
1985 | 3348 |
defaultWindowSpecName |
3349 |
^ #windowSpec |
|
3350 |
! |
|
3351 |
||
1419 | 3352 |
defaultWindowType |
3353 |
"Applications come up non-modal, by default" |
|
3354 |
||
3355 |
^ #normal |
|
3356 |
||
3357 |
"Created: 17.1.1997 / 19:57:34 / cg" |
|
3358 |
! |
|
3359 |
||
3360 |
graphicsDevice |
|
3361 |
"return the device I want to open my views on. |
|
3362 |
The default (if not created with #onDevice:) is the currently |
|
3363 |
active screen." |
|
3364 |
||
3365 |
^ device |
|
3366 |
||
3367 |
"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
|
3368 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
3369 |
|
2373 | 3370 |
interfaceSpecFor:aSelectorOrSpec |
1419 | 3371 |
"return an interface spec. |
3372 |
Here, the query is forwarded to my class. |
|
3373 |
Can be refefined in subclasses which want to provide per-instance specs." |
|
3374 |
||
3297 | 3375 |
aSelectorOrSpec isSymbol ifFalse:[ |
3376 |
(aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec]. |
|
2373 | 3377 |
]. |
3378 |
^ self class interfaceSpecFor:aSelectorOrSpec |
|
3379 |
||
3380 |
"Created: / 25-01-1998 / 19:45:12 / cg" |
|
3381 |
"Modified: / 14-01-2008 / 17:54:29 / cg" |
|
1419 | 3382 |
! |
3383 |
||
1481
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3384 |
isOpen |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3385 |
"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
|
3386 |
|
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3387 |
|win| |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3388 |
|
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3389 |
^ (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
|
3390 |
! |
e1922b505268
Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents:
1479
diff
changeset
|
3391 |
|
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3392 |
isWebService |
2545 | 3393 |
^ device notNil and:[ device askFor:#isWebServiceDevice ] |
2541
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3394 |
! |
08d27acc9fe1
merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents:
2528
diff
changeset
|
3395 |
|
1419 | 3396 |
processName |
3397 |
"return a name to be shown for me in the process monitor" |
|
3398 |
||
3399 |
self class == ApplicationModel ifTrue:[ |
|
3297 | 3400 |
^ 'Application' |
1419 | 3401 |
]. |
3402 |
^ self class nameWithoutPrefix |
|
3403 |
||
3404 |
"Modified: / 4.12.1997 / 12:39:14 / cg" |
|
3405 |
! |
|
3406 |
||
3407 |
resolveClassNamed:something inClass:aClass |
|
3408 |
"return the class from something, a class, symbol, string or nil. |
|
1548 | 3409 |
first we are looking in the namespace of the application, then in the |
3410 |
current namespace and finally in Smalltalk |
|
1419 | 3411 |
" |
3412 |
||
3413 |
^ Smalltalk resolveName:something inClass:aClass. |
|
3414 |
! |
|
3415 |
||
3304 | 3416 |
resolveFont:something |
3308 | 3417 |
"resolve the font. Delegate to windowBuilder" |
3418 |
||
3304 | 3419 |
^ builder resolveFont:something |
3420 |
! |
|
3421 |
||
1419 | 3422 |
resolveName:something |
3423 |
"return the class from something, a class, symbol, string or nil. |
|
1548 | 3424 |
first we are looking in the namespace of the application, then in the |
2099 | 3425 |
current namespace and finally in Smalltalk" |
3426 |
||
1419 | 3427 |
^ self resolveName:something inClass:self class |
3428 |
! |
|
3429 |
||
3430 |
resolveName:something inClass:aClass |
|
3431 |
"return the class from something, a class, symbol, string or nil. |
|
3297 | 3432 |
first we are looking in the namespace of the application, |
2099 | 3433 |
then in the current namespace and finally in Smalltalk" |
3434 |
||
1419 | 3435 |
|cls| |
3436 |
||
3437 |
aClass notNil ifTrue:[ |
|
3297 | 3438 |
(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[ |
3439 |
^ cls |
|
3440 |
]. |
|
3441 |
||
3442 |
masterApplication notNil ifTrue:[ |
|
3443 |
^ masterApplication resolveName:something |
|
3444 |
] |
|
1419 | 3445 |
]. |
3446 |
^ nil |
|
3447 |
! |
|
3448 |
||
2380 | 3449 |
selfResponsibleFor:aKey |
3450 |
"internal: return true, if I am to provide a value for some aspect." |
|
3451 |
||
2586
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3452 |
<resource: #obsolete> |
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3453 |
|
023716eba50a
code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents:
2581
diff
changeset
|
3454 |
self obsoleteMethodWarning:'obsoleted for de-obfuscation'. |
2380 | 3455 |
^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]]) |
3456 |
! |
|
3457 |
||
3192 | 3458 |
shouldRememberLastExtent |
3459 |
"to be redefined by concrete applications: |
|
3460 |
if true is answered, the application's extent is remembered on close |
|
3461 |
and used as a default when opened the next time" |
|
3462 |
||
3463 |
^ self class shouldRememberLastExtent |
|
3464 |
! |
|
3465 |
||
1419 | 3466 |
topApplication |
3467 |
"return the top-master application" |
|
3468 |
||
3469 |
masterApplication isNil ifTrue:[ |
|
3297 | 3470 |
^ self |
1419 | 3471 |
]. |
3472 |
^ masterApplication topApplication |
|
3473 |
||
3474 |
"Created: / 6.6.1998 / 19:40:42 / cg" |
|
3475 |
! ! |
|
3476 |
||
1766 | 3477 |
!ApplicationModel methodsFor:'startup & release'! |
1419 | 3478 |
|
3479 |
applicationWindowClass |
|
1431 | 3480 |
"return the class used for my (top-) windows" |
3481 |
||
1419 | 3482 |
^ ApplicationWindow |
3483 |
! |
|
3484 |
||
3485 |
close |
|
3486 |
"this is sent by my topView when about to be closed |
|
3487 |
by the program (not by the windowManager). |
|
3488 |
Notice, that we get a closeRequest message if closed by the windowManager, |
|
3489 |
which can be rejected by the app (or confirmed via a dialog) |
|
3490 |
Could be redefined in subclasses." |
|
3491 |
||
3492 |
self closeDownViews |
|
1132
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
3493 |
! |
b801d744051b
kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents:
1118
diff
changeset
|
3494 |
|
1419 | 3495 |
closeDownViews |
3203 | 3496 |
"close down the application's view(s)" |
1419 | 3497 |
|
2893 | 3498 |
|wg wgProcess window| |
1419 | 3499 |
|
3500 |
self release. |
|
3501 |
ActiveHelp stopFor:self. |
|
3502 |
||
3192 | 3503 |
window := self window. |
3504 |
||
3193 | 3505 |
self shouldRememberLastExtent ifTrue:[ |
3297 | 3506 |
self rememberLastExtent. |
3193 | 3507 |
]. |
3297 | 3508 |
((wg := self windowGroup) notNil |
3203 | 3509 |
and:[ wg isModal not ]) ifTrue:[ |
3297 | 3510 |
wgProcess := wg process. |
3511 |
(Processor activeProcess ~~ wgProcess |
|
3512 |
and:[wgProcess notNil]) ifTrue:[ |
|
3513 |
wgProcess terminate |
|
3514 |
] ifFalse:[ |
|
3515 |
wg closeDownViews. |
|
3516 |
] |
|
2890 | 3517 |
] ifFalse:[ |
3297 | 3518 |
window notNil ifTrue:[ |
3519 |
window destroy. |
|
3520 |
] |
|
2890 | 3521 |
]. |
3522 |
||
3203 | 3523 |
"Modified: / 31-07-2013 / 17:41:08 / cg" |
1419 | 3524 |
! |
3525 |
||
3526 |
closeRequest |
|
3527 |
"this is sent by my topView when about to be closed by the windowManager. |
|
3528 |
Could be redefined in subclasses to suppress close or confirm." |
|
3529 |
||
1528 | 3530 |
|sav window| |
3531 |
||
3532 |
window := self window. |
|
3533 |
window isNil ifTrue:[ |
|
3297 | 3534 |
'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR. |
3535 |
^ self |
|
1461
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
3536 |
]. |
f3ad0001d240
fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents:
1454
diff
changeset
|
3537 |
|
1831 | 3538 |
window isTopView ifFalse:[ |
3297 | 3539 |
window topView isModal ifTrue:[ |
3540 |
WindowGroup leaveSignal raise. |
|
3541 |
]. |
|
3542 |
||
3543 |
'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR. |
|
3544 |
^ self |
|
1419 | 3545 |
]. |
3546 |
||
3547 |
"/ In multiView apps, tell my master. |
|
3548 |
"/ (but not if I am a modal reincarnation) |
|
3297 | 3549 |
(masterApplication notNil |
1528 | 3550 |
and:[window isModal not]) ifTrue:[ |
1419 | 3551 |
|
3297 | 3552 |
"/ temporary clear my masterApplication to prevent |
3553 |
"/ endless recursion, in case the master sends me |
|
3554 |
"/ a closeRequest (although, it is supposed to |
|
3555 |
"/ send me a closeDownViews ...) |
|
3556 |
||
3557 |
sav := masterApplication. |
|
3558 |
masterApplication := nil. |
|
3559 |
sav closeRequestFor:window. |
|
3560 |
||
3561 |
"/ restore - in case master did not want me to close ... |
|
3562 |
masterApplication := sav. |
|
1419 | 3563 |
] ifFalse:[ |
3297 | 3564 |
"/ ST/X does close-check by redefining this message without |
3565 |
"/ a supersend; |
|
3566 |
"/ VW does it by returning false from requestForWindowClose |
|
3567 |
"/ sigh. |
|
3568 |
||
3569 |
self requestForWindowClose ifTrue:[ |
|
3570 |
window isSlave ifTrue:[ |
|
3571 |
window destroy |
|
3572 |
] ifFalse:[ |
|
3573 |
self closeDownViews |
|
3574 |
] |
|
3575 |
] |
|
1419 | 3576 |
]. |
3577 |
||
3578 |
"Modified: / 19.6.1998 / 01:37:17 / cg" |
|
3579 |
! |
|
3580 |
||
3581 |
closeRequestFor:aTopView |
|
3582 |
"this is sent by any of my topViews when about to be closed by the |
|
3583 |
windowmanager. For backward compatibility with single-view applications, |
|
3584 |
this is forwarded here to a simple (non topView-specific) closeRequest, |
|
3585 |
effectively closing all of my views. |
|
3586 |
MultiView applications should redefine this method if closing of individual |
|
3587 |
views closing is to be caught and/or should not close all of them." |
|
3588 |
||
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3589 |
|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
|
3590 |
|
ea35a676f0b1
do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
3591 |
myWindow := self window. |
1419 | 3592 |
|
3593 |
"/ In multiView apps, tell my master. |
|
3594 |
"/ (but not if I am a modal reincarnation) |
|
3297 | 3595 |
(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
|
3596 |
and:[myWindow topView isModal not]) ifTrue:[ |
1419 | 3597 |
|
3297 | 3598 |
"/ temporary clear my masterApplication to prevent |
3599 |
"/ endless recursion, in case the master sends me |
|
3600 |
"/ a closeRequest (although, it is supposed to |
|
3601 |
"/ send me a closeDownViews ...) |
|
3602 |
||
3603 |
savedMaster := masterApplication. |
|
3604 |
masterApplication := nil. |
|
3605 |
aTopView isSlave ifTrue:[ |
|
3606 |
savedMaster closeRequestFor:aTopView. |
|
3607 |
] ifFalse:[ |
|
3608 |
savedMaster closeRequestFor:myWindow. |
|
3609 |
]. |
|
3610 |
||
3611 |
"/ restore - in case master did not want me to close ... |
|
3612 |
masterApplication := savedMaster. |
|
3613 |
^ self |
|
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3614 |
]. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3615 |
|
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3616 |
(aTopView == myWindow) ifTrue:[ |
3297 | 3617 |
self closeRequest. |
3618 |
^ self |
|
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3619 |
]. |
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3620 |
|
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3621 |
(aTopView isPartner or:[aTopView isMaster]) ifTrue:[ |
3297 | 3622 |
aTopView application closeRequest. |
3623 |
self closeRequest. |
|
3624 |
^ self. |
|
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
3625 |
]. |
1924 | 3626 |
aTopView isSlave ifTrue:[ |
3297 | 3627 |
aTopView closeRequest |
1924 | 3628 |
] ifFalse:[ |
3297 | 3629 |
aTopView application closeRequest. |
1924 | 3630 |
] |
1419 | 3631 |
! |
3632 |
||
3633 |
doAccept |
|
3634 |
"this is invoked by the Return-Key (if returnIsOK) or |
|
3635 |
the ok-button (if any), IFF the application has been |
|
3636 |
opened modal (i.e. as a dialog)." |
|
3637 |
||
3638 |
"/ the following is a bad kludge - |
|
3639 |
"/ actually, modal apps should inherit from SimpleDialog |
|
3640 |
"/ (then, things would be clean) |
|
3641 |
"/ However, it may be useful, to open some app (which is normally |
|
3642 |
"/ modeless) as a modal one as well. |
|
3643 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
|
3644 |
"/ to remember the accept vs. cancel case. |
|
3645 |
"/ |
|
3646 |
self window isModal ifTrue:[ |
|
3297 | 3647 |
masterApplication notNil ifTrue:[ |
3648 |
masterApplication window topView == self window topView ifTrue:[ |
|
3649 |
masterApplication window isModal ifTrue:[ |
|
3650 |
masterApplication doAccept. |
|
3651 |
^ self. |
|
3652 |
]. |
|
3653 |
]. |
|
3654 |
]. |
|
3655 |
||
3656 |
"/ mhmh - is this a good idea ? |
|
3657 |
self perform:#accept ifNotUnderstood:[self closeRequest]. |
|
3658 |
^ self |
|
1419 | 3659 |
]. |
3660 |
||
3661 |
^ self "/ nothing done here ... |
|
3662 |
! |
|
3663 |
||
3664 |
doCancel |
|
3665 |
"this is invoked by the Escape-Key (if escapeIsCancel) or |
|
3666 |
the cancel-button (if any), IFF the application has been |
|
3667 |
opened modal (i.e. as a dialog)." |
|
3668 |
||
3669 |
"/ the following is a bad kludge - |
|
3670 |
"/ actually, modal apps should inherit from SimpleDialog |
|
3671 |
"/ (then, things would be clean) |
|
3672 |
"/ However, it may be useful, to open some app (which is normally |
|
3673 |
"/ modeless) as a modal one as well. |
|
3674 |
"/ In that, case, we have no acceptHolder (see SimpleDialog), |
|
3675 |
"/ to remember the accept vs. cancel case. |
|
1417 | 3676 |
"/ |
1419 | 3677 |
self window isModal ifTrue:[ |
3297 | 3678 |
"/ mhmh - is this a good idea ? |
3679 |
self perform:#cancel ifNotUnderstood:[self closeRequest]. |
|
3680 |
^ self |
|
1419 | 3681 |
]. |
3682 |
^ self "/ nothing done here ... |
|
3683 |
! |
|
3684 |
||
3685 |
releaseAsSubCanvas |
|
3686 |
"a subcanvas is closed or switching to a new application. |
|
3687 |
Can be redefined to perform a self release in this case." |
|
3688 |
||
3689 |
"/ used to self release here, |
|
3690 |
"/ but that is incompatible to VW (RefactoryBrowser). |
|
3691 |
"/ Therefore, if you need it, you MUST now redefine |
|
3692 |
"/ this method. |
|
3693 |
! |
|
3694 |
||
3203 | 3695 |
rememberLastExtent |
3696 |
"remember my current extent for the next open" |
|
3697 |
||
3698 |
|window| |
|
3699 |
||
3700 |
window := self window. |
|
3701 |
(window notNil and:[window isTopView]) ifTrue:[ |
|
3297 | 3702 |
DefaultExtents isNil ifTrue:[ |
3703 |
DefaultExtents := Dictionary new. |
|
3704 |
]. |
|
3705 |
DefaultExtents at:self class name put:(window extent). |
|
3203 | 3706 |
]. |
3707 |
||
3708 |
"Created: / 31-07-2013 / 14:41:33 / cg" |
|
3709 |
! |
|
3710 |
||
1419 | 3711 |
restarted |
3712 |
"sent by my topWindow, when restarted from an image. |
|
3713 |
Nothing done here, but can be redefined to perform any actions |
|
3714 |
required to reset the application after an image-restart. |
|
3715 |
(for example: check if application files are still around, restart |
|
3716 |
subprocesses etc.)." |
|
3717 |
||
3718 |
"Modified: 1.6.1996 / 16:55:50 / cg" |
|
3719 |
! |
|
3720 |
||
3721 |
saveAndTerminateRequest |
|
3722 |
"some windowManagers send this to shut down an application |
|
3723 |
and have it save its state for restart. |
|
3724 |
Can be redefined in subclasses" |
|
3725 |
||
3726 |
self closeRequest |
|
3727 |
! |
|
3728 |
||
3729 |
saveAndTerminateRequestFor:aTopView |
|
3730 |
"some windowManagers send this to shut down an application |
|
3731 |
and have it save its state for restart. |
|
3732 |
Can be redefined in subclasses" |
|
3733 |
||
3734 |
self saveAndTerminateRequest |
|
3735 |
! ! |
|
3736 |
||
2528
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3737 |
!ApplicationModel methodsFor:'translating'! |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3738 |
|
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3739 |
translateString:aString |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3740 |
"translate aString to the current language. |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3741 |
We use the resorces as default. |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3742 |
Subclasses may redefine this to use another mechanism" |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3743 |
|
2609
a78a9e0380b1
added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents:
2605
diff
changeset
|
3744 |
^ self resources string:aString |
2528
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3745 |
! ! |
abeb2b5c60da
New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents:
2527
diff
changeset
|
3746 |
|
2869 | 3747 |
!ApplicationModel methodsFor:'user interaction & notifications'! |
3748 |
||
3749 |
beep |
|
3750 |
"output an audible beep or bell on my screen device" |
|
3751 |
||
3752 |
device notNil ifTrue:[ |
|
3297 | 3753 |
device beep. |
2869 | 3754 |
]. |
3755 |
! |
|
3756 |
||
3757 |
information:aString |
|
3758 |
"like Objects information, but translates the string via the |
|
3759 |
resourcePack, thus giving a translated string automatically" |
|
3760 |
||
3761 |
super information:(self translateString:aString) withCRs |
|
3762 |
||
3763 |
"Created: / 20.5.1998 / 03:48:43 / cg" |
|
3764 |
! |
|
3765 |
||
3766 |
notify:aString |
|
3767 |
"like Objects notify, but translates the string via the |
|
3768 |
resourcePack, thus giving a translated string automatically" |
|
3769 |
||
3770 |
super notify:(self translateString:aString) withCRs |
|
3771 |
||
3772 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
|
3773 |
"Modified: / 13.11.2001 / 20:10:12 / cg" |
|
3774 |
! |
|
3775 |
||
3776 |
openDocumentationFile:aFilename |
|
3777 |
HTMLDocumentView notNil ifTrue:[ |
|
3297 | 3778 |
HTMLDocumentView openFullOnDocumentationFile:aFilename. |
2869 | 3779 |
]. |
3780 |
! |
|
3781 |
||
3782 |
restoreCursors |
|
3783 |
"restore the original cursors in all of my views" |
|
3784 |
||
3785 |
^ self window windowGroup restoreCursors |
|
3786 |
||
3787 |
"Created: 1.6.1996 / 17:01:24 / cg" |
|
3788 |
! |
|
3789 |
||
3790 |
showCursor:aCursor |
|
3791 |
"set all of my views cursor to aCursor. |
|
3792 |
It can be restored with #restoreCursor." |
|
3793 |
||
3794 |
^ self window windowGroup showCursor:aCursor |
|
3795 |
||
3796 |
"Created: 1.6.1996 / 17:01:09 / cg" |
|
3797 |
! |
|
3798 |
||
3799 |
warn:aString |
|
3179 | 3800 |
"like Object's warn, but translates the string via the |
2869 | 3801 |
resourcePack, thus giving a translated string automatically" |
3802 |
||
3803 |
self warn:aString translate:true |
|
3804 |
||
3805 |
"Created: / 20.5.1998 / 01:14:52 / cg" |
|
3806 |
"Modified: / 13.11.2001 / 20:10:12 / cg" |
|
3807 |
! |
|
3808 |
||
3809 |
warn:aString translate:aBoolean |
|
3810 |
"like Objects warn, but optionally translates the string via the |
|
3811 |
resourcePack, thus giving a translated string automatically" |
|
3812 |
||
3297 | 3813 |
super warn:(aBoolean |
3814 |
ifTrue:[ (self translateString:aString) withCRs ] |
|
3815 |
ifFalse:[ aString ]). |
|
2869 | 3816 |
! |
3817 |
||
3818 |
warn:aString with:arg |
|
3819 |
"like Objects warn, but translates the string via the |
|
3820 |
resourcePack, thus giving a translated string automatically" |
|
3821 |
||
3822 |
self warn:aString withArguments:(Array with:arg) |
|
3823 |
! |
|
3824 |
||
3825 |
warn:aString with:arg1 with:arg2 |
|
3826 |
"like Objects warn, but translates the string via the |
|
3827 |
resourcePack, thus giving a translated string automatically" |
|
3828 |
||
3829 |
self warn:aString withArguments:(Array with:arg1 with:arg2) |
|
3830 |
! |
|
3831 |
||
3832 |
warn:aString with:arg1 with:arg2 with:arg3 |
|
3833 |
"like Objects warn, but translates the string via the |
|
3834 |
resourcePack, thus giving a translated string automatically" |
|
3835 |
||
3836 |
self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3) |
|
3837 |
! |
|
3838 |
||
3839 |
warn:aString with:arg1 with:arg2 with:arg3 with:arg4 |
|
3840 |
"like Objects warn, but translates the string via the |
|
3841 |
resourcePack, thus giving a translated string automatically" |
|
3842 |
||
3843 |
self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3 with:arg4) |
|
3844 |
||
3845 |
"Created: / 23.2.2000 / 09:43:04 / cg" |
|
3846 |
! |
|
3847 |
||
3848 |
warn:aString withArguments:argArray |
|
3849 |
"like Objects warn, but translates the string via the |
|
3850 |
resourcePack, thus giving a translated string automatically. |
|
3851 |
Also translates \'s to newLine." |
|
3852 |
||
3853 |
|translatedString stream| |
|
3854 |
||
3855 |
translatedString := self translateString:aString. |
|
3856 |
stream := TextStream on:(translatedString species new:translatedString size + (argArray size * 10)). |
|
3857 |
translatedString withCRs expandPlaceholdersWith:argArray on:stream. |
|
3858 |
||
3859 |
self warn:(stream contents) translate:false. |
|
3860 |
! |
|
3861 |
||
3862 |
withCursor:aCursor do:aBlock |
|
3863 |
"evaluate aBlock, showing aCursor in my topView and all of its subviews. |
|
3864 |
Return the value of aBlock." |
|
3865 |
||
3317 | 3866 |
|w| |
2869 | 3867 |
|
3868 |
w := self window. |
|
3869 |
w notNil ifTrue:[ |
|
3317 | 3870 |
^ w topView withCursor:aCursor do:aBlock |
2869 | 3871 |
]. |
3317 | 3872 |
^ aCursor showWhile:aBlock. |
2869 | 3873 |
|
3874 |
"Modified: / 23.9.1998 / 17:00:25 / cg" |
|
3875 |
! |
|
3876 |
||
3877 |
withExecuteCursorDo:aBlock |
|
3878 |
"evaluate aBlock, showing an executeCursor in my topView and all of its subviews. |
|
3879 |
Return the value of aBlock." |
|
3880 |
||
3881 |
^ self withCursor:(Cursor execute) do:aBlock |
|
3882 |
||
3883 |
"Created: 14.12.1995 / 20:57:03 / cg" |
|
3884 |
! |
|
3885 |
||
3886 |
withReadCursorDo:aBlock |
|
3887 |
"evaluate aBlock, showing a readCursor in my topView and all of its subviews. |
|
3888 |
Return the value of aBlock." |
|
3889 |
||
3890 |
^ self withCursor:(Cursor read) do:aBlock |
|
3891 |
||
3892 |
"Created: 14.12.1995 / 20:56:47 / cg" |
|
3893 |
"Modified: 14.12.1995 / 20:57:36 / cg" |
|
3894 |
! |
|
3895 |
||
3297 | 3896 |
withVisibleCursor:aCursor do:aBlock |
2869 | 3897 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
3898 |
Return the value of aBlock. |
|
2940
4d8f61704b4a
comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3899 |
Ensure, that the cursor is visible by the user for a minimal amount of time." |
3297 | 3900 |
|
2869 | 3901 |
|ret| |
3902 |
||
3297 | 3903 |
self |
3904 |
withCursor:aCursor do:[ |
|
3905 |
|time| |
|
3906 |
||
3907 |
time := Time millisecondsToRun:[ ret := aBlock value]. |
|
3908 |
time := UserPreferences current waitCursorVisibleTime - time. |
|
3909 |
time > 0 ifTrue:[ |
|
3910 |
Delay waitForMilliseconds:time. |
|
3911 |
]. |
|
3912 |
]. |
|
2869 | 3913 |
^ ret. |
2940
4d8f61704b4a
comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3914 |
|
4d8f61704b4a
comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents:
2936
diff
changeset
|
3915 |
"Modified (comment): / 12-09-2011 / 12:14:31 / cg" |
2869 | 3916 |
! |
3917 |
||
3918 |
withWaitCursorDo:aBlock |
|
3919 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
|
3920 |
Return the value of aBlock." |
|
3921 |
||
3922 |
^ self withCursor:(Cursor wait) do:aBlock |
|
3923 |
! |
|
3924 |
||
3297 | 3925 |
withWaitCursorVisibleDo:aBlock |
2869 | 3926 |
"evaluate aBlock, showing a waitCursor in my topView and all of its subviews. |
3927 |
Return the value of aBlock. |
|
3928 |
Guarantee, that the cursor is visible by the user for a minimal amount of time." |
|
3929 |
||
3930 |
^ self withVisibleCursor:(Cursor wait) do:aBlock |
|
3013 | 3931 |
! |
3932 |
||
3933 |
withWriteCursorDo:aBlock |
|
3934 |
"evaluate aBlock, showing a writeCursor in my topView and all of its subviews. |
|
3935 |
Return the value of aBlock." |
|
3936 |
||
3937 |
^ self withCursor:(Cursor write) do:aBlock |
|
3938 |
||
3939 |
"Created: / 27-07-2012 / 09:42:53 / cg" |
|
2869 | 3940 |
! ! |
3941 |
||
1419 | 3942 |
!ApplicationModel methodsFor:'window events'! |
3943 |
||
3116 | 3944 |
autoRaise:oneOfMyViews |
3945 |
"called with a delay by the focusIn code, iff the userPref setting is active. |
|
3946 |
Some (a small number only) may want to prevent autoraise in certain situations |
|
3947 |
- for example, if one view is controlling another. These get a chance to redefine this |
|
3948 |
method" |
|
3949 |
||
3950 |
oneOfMyViews raise. |
|
3951 |
! |
|
3952 |
||
2522
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3953 |
clientMessage:msgType format:msgFormat eventData:msgData |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3954 |
"a client message - very X-Window specific and only useful for special applications. |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3955 |
Subclasses prepared to receive them should redefine this method" |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3956 |
! |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3957 |
|
2526
d2be37e49195
changed #copyDataEvent:eventData:
Claus Gittinger <cg@exept.de>
parents:
2522
diff
changeset
|
3958 |
copyDataEvent:parameter eventData:msgData |
2522
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3959 |
"a client message - very Win32 specific and only useful for special applications. |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3960 |
Subclasses prepared to receive them should redefine this method" |
2527 | 3961 |
|
3962 |
|messageStream command argument| |
|
3963 |
||
3964 |
messageStream := msgData asString readStream. |
|
3965 |
command := messageStream upTo: $:. |
|
3966 |
argument := messageStream upTo: Character null. |
|
3967 |
self processApplicationCommand:command with:argument |
|
2522
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3968 |
! |
ff119836dbec
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
2520
diff
changeset
|
3969 |
|
1419 | 3970 |
dispatchEvent:event |
3971 |
"dispatch a user-pushed event. |
|
3972 |
This allows for events for an appModel to be pushed into the event queue |
|
3973 |
the same way as events for a view are pushable." |
|
3974 |
||
3297 | 3975 |
^ self |
3976 |
dispatchEvent:event |
|
3977 |
withFocusOn:nil |
|
3978 |
delegate:true |
|
1419 | 3979 |
|
3980 |
! |
|
3981 |
||
3982 |
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
|
3983 |
"dispatch a user-pushed event. |
|
3984 |
This allows for events for an appModel to be pushed into the event queue |
|
3985 |
the same way as events for a view are pushable." |
|
3986 |
||
3987 |
self perform:evType withArguments:evArgs |
|
3988 |
||
3989 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
3990 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
1290 | 3991 |
! |
3992 |
||
1419 | 3993 |
dispatchEvent:ev type:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate |
3994 |
"dispatch a user-pushed event. |
|
3995 |
This allows for events for an appModel to be pushed into the event queue |
|
3996 |
the same way as events for a view are pushable." |
|
3997 |
||
3998 |
self perform:evType withArguments:evArgs |
|
3999 |
||
4000 |
"Created: / 20.6.1998 / 16:36:54 / cg" |
|
4001 |
"Modified: / 20.6.1998 / 16:44:05 / cg" |
|
4002 |
! |
|
4003 |
||
3297 | 4004 |
dispatchEvent:event withFocusOn:focusViewOrNil |
1419 | 4005 |
"dispatch a user-pushed event. |
4006 |
This allows for events for an appModel to be pushed into the event queue |
|
4007 |
the same way as events for a view are pushable." |
|
4008 |
||
3297 | 4009 |
^ self |
4010 |
dispatchEvent:event |
|
4011 |
withFocusOn:focusViewOrNil |
|
4012 |
delegate:true |
|
1419 | 4013 |
|
4014 |
||
4015 |
! |
|
4016 |
||
4017 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
|
4018 |
"dispatch a user-pushed event. |
|
4019 |
This allows for events for an appModel to be pushed into the event queue |
|
4020 |
the same way as events for a view are pushable." |
|
4021 |
||
3297 | 4022 |
^ self |
4023 |
dispatchEvent:event |
|
4024 |
type:event type |
|
4025 |
arguments:(event arguments) |
|
4026 |
withFocusOn:focusViewOrNil |
|
4027 |
delegate:doDelegate |
|
1419 | 4028 |
|
4029 |
||
4030 |
! |
|
4031 |
||
4032 |
noticeOfWindowClose:aWindow |
|
1432
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4033 |
"sent when a topView or applicationSubView has been closed. |
1419 | 4034 |
Can be redefined in subclasses for cleanup." |
4035 |
||
1432
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4036 |
"/ ST-80 compatibility |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4037 |
self windowEvent:(#close -> aWindow) from:aWindow. |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4038 |
^ self |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4039 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4040 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4041 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4042 |
! |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4043 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4044 |
noticeOfWindowOpen:aWindow |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4045 |
"sent when a topView or applicationSubView has been opened. |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4046 |
Can be redefined in subclasses." |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4047 |
|
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4048 |
"/ ST-80 compatibility |
6dc94e38fa8e
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
1431
diff
changeset
|
4049 |
self windowEvent:(#open -> aWindow) from:aWindow. |
1419 | 4050 |
^ self |
4051 |
||
4052 |
"Created: / 18.6.1998 / 18:56:31 / cg" |
|
4053 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
|
4054 |
! |
|
4055 |
||
2527 | 4056 |
processApplicationCommand:command with:argument |
4057 |
"a message from a secondary application instance (the exe has been started again). |
|
4058 |
Typically, the command is one like 'openPath:', as generated in StandaloneStartup." |
|
4059 |
||
4060 |
command = 'openPath' ifTrue:[ |
|
3297 | 4061 |
self processOpenPathCommand:argument. |
4062 |
^ self. |
|
2527 | 4063 |
]. |
4064 |
||
4065 |
Transcript showCR: 'Invalid command received: ', command. |
|
4066 |
! |
|
4067 |
||
4068 |
processOpenPathCommand:argument |
|
4069 |
"a message from a secondary application instance (the exe has been started again) |
|
4070 |
to open another window on document as found in the pathName argument. |
|
4071 |
Left blank (i.e. ignored) here, but can be redefined to open up another application |
|
4072 |
editor window if supported." |
|
4073 |
! |
|
4074 |
||
3200
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4075 |
processShortcut:aKeyEvent |
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4076 |
"a shortcut key event as forwarded from the keyboardProcessor - if there is the |
3297 | 4077 |
shortcut key defined, process the shortcut and return true - otherwise false." |
3200
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4078 |
|
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4079 |
^false |
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4080 |
|
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4081 |
"Created: / 23-07-2013 / 18:10:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4082 |
! |
009ddfb1e69a
Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3195
diff
changeset
|
4083 |
|
1419 | 4084 |
requestForWindowClose |
4085 |
"the applicationWindow wants to know, if a close |
|
4086 |
is ok. Return false if not." |
|
4087 |
||
4088 |
|w k| |
|
4089 |
||
4090 |
builder notNil ifTrue:[ |
|
3297 | 4091 |
(w := builder window) notNil ifTrue:[ |
4092 |
(k := w keyboardProcessor) notNil ifTrue:[ |
|
4093 |
^ k requestForWindowClose |
|
4094 |
] |
|
4095 |
] |
|
1419 | 4096 |
]. |
4097 |
^ true |
|
4098 |
||
4099 |
"Modified: / 18.6.1998 / 19:14:16 / cg" |
|
4100 |
"Created: / 19.6.1998 / 01:34:58 / cg" |
|
4101 |
! |
|
4102 |
||
4103 |
showActivity:someMessage |
|
4104 |
"some activityNotification shalt be communicated to |
|
4105 |
the user. Forwarded from the topView and ignored here. |
|
4106 |
Can be redefined in concrete applications to show the |
|
4107 |
message either in some infoView (infoLabel as in Windows) |
|
4108 |
or in the title area (as done in the browsers)" |
|
4109 |
||
4110 |
^ self |
|
4111 |
||
4112 |
"Created: 16.12.1995 / 18:41:04 / cg" |
|
4113 |
"Modified: 24.4.1996 / 09:34:22 / cg" |
|
4114 |
! |
|
4115 |
||
4116 |
windowEvent:anEvent from:anApplicationWindow |
|
4117 |
"dummy: windowEvent forwarding is not yet implemented" |
|
4118 |
||
4119 |
^ self |
|
4120 |
||
4121 |
"Modified: 24.4.1996 / 09:32:50 / cg" |
|
4122 |
! ! |
|
4123 |
||
4124 |
!ApplicationModel class methodsFor:'documentation'! |
|
4125 |
||
2977 | 4126 |
version |
3365 | 4127 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.358 2014-08-03 12:36:49 cg Exp $' |
2977 | 4128 |
! |
4129 |
||
2753
f8c6eadde7bb
changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents:
2747
diff
changeset
|
4130 |
version_CVS |
3365 | 4131 |
^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.358 2014-08-03 12:36:49 cg Exp $' |
85 | 4132 |
! ! |
1633
07765ef65021
fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents:
1622
diff
changeset
|
4133 |
|
3108 | 4134 |
|
1419 | 4135 |
ApplicationModel initialize! |