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