AppModel.st
author ca
Tue, 18 Feb 1997 12:00:46 +0100
changeset 437 092e025be49e
parent 435 68081adabd45
child 438 c3d379e83de7
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     1
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     3
	      All Rights Reserved
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     4
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
53bc56e07e8f Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    11
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    12
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    13
Model subclass:#ApplicationModel
310
3c3dbc074dbd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 302
diff changeset
    14
	instanceVariableNames:'builder resources device'
389
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
    15
	classVariableNames:'DefaultLabels DefaultVisuals'
142
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    16
	poolDictionaries:''
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
	category:'Interface-Framework'
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    18
!
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    19
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    20
ApplicationModel class instanceVariableNames:'ClassResources'
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    21
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    22
"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    23
 The following class instance variables are inherited by this class:
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    24
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    25
	Model - 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    26
	Object - 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    27
"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    28
!
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
    29
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
    30
!ApplicationModel class methodsFor:'documentation'!
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    31
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    32
copyright
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    33
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    34
 COPYRIGHT (c) 1995 by Claus Gittinger
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    35
	      All Rights Reserved
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    36
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    37
 This software is furnished under a license and may be used
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    38
 only in accordance with the terms of that license and with the
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    39
 inclusion of the above copyright notice.   This software may not
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    40
 be provided or otherwise made available to, or used by, any
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    41
 other person.  No title to or ownership of the software is
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    42
 hereby transferred.
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    43
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    44
!
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    45
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    46
documentation
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    47
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    48
    Since many ST-80 classes are subclasses of ApplicationModel, this class
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    49
    is provided here to allow easier porting of ST-80 code.
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
    50
429
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
    51
    It does not (currently) provide all functionality and is NOT
63
claus
parents: 61
diff changeset
    52
    compatible to the corresponding ST80 class; therefore, manual
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    53
    changes have to be made to get those applications to run under ST/X.
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
    54
    (but at least, this enables you to fileIn that code and have a superclass
78
claus
parents: 72
diff changeset
    55
     for them)
claus
parents: 72
diff changeset
    56
claus
parents: 72
diff changeset
    57
    As time goes by, ST/X applications are going to be converted to
330
d7ce98930ad3 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 313
diff changeset
    58
    become subclasses of this abstract class - see Launcher for a
78
claus
parents: 72
diff changeset
    59
    first concrete example.
claus
parents: 72
diff changeset
    60
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    61
78
claus
parents: 72
diff changeset
    62
    ApplicationModel is prepared to build a view from a windowSpec, as
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    63
    created by the windowBuilder. If your subclass does not provide such
78
claus
parents: 72
diff changeset
    64
    a spec, you should at least redefine:
claus
parents: 72
diff changeset
    65
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    66
        #openInterface   - to create a topview and open it
78
claus
parents: 72
diff changeset
    67
claus
parents: 72
diff changeset
    68
    you may want to redefine:
claus
parents: 72
diff changeset
    69
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    70
        #closeRequest    - to catch window closing
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    71
        #focusSequence   - to define a sequence for focus-stepping
78
claus
parents: 72
diff changeset
    72
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
    73
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    74
    Once the interfaceBuilder is finished & released, subclasses can
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    75
    alternatively provide the spec via a #windowSpec method.
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    76
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
    77
    The classResources have been put into this class to allow ST/X
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
    78
    applications (which used to be subclasses of StandardSystemView)
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
    79
    to migrate smoothly into ApplicationModels (which is better design ...).
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
    80
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
    81
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    82
    [Instance variables:]
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    83
        resources    ResourcePack       language string translation
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    84
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    85
        builder      WindowBuilder      a builder who knows how to create
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    86
                                        a window hierarchy from a specification
78
claus
parents: 72
diff changeset
    87
claus
parents: 72
diff changeset
    88
claus
parents: 72
diff changeset
    89
    Notice: this class was implemented using protocol information
claus
parents: 72
diff changeset
    90
    from alpha testers and PD code - it may not be complete or compatible to
claus
parents: 72
diff changeset
    91
    the corresponding ST-80 class. If you encounter any incompatibilities,
claus
parents: 72
diff changeset
    92
    please forward a note to the ST/X team.
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    93
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    94
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
    95
    [author:]
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
    96
        Claus Gittinger
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
    97
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    98
    [see also:]
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
    99
        StandardSystemView
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   100
        WindowGroup DeviceWorkstation
50
53bc56e07e8f Initial revision
claus
parents:
diff changeset
   101
"
53bc56e07e8f Initial revision
claus
parents:
diff changeset
   102
! !
53bc56e07e8f Initial revision
claus
parents:
diff changeset
   103
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   104
!ApplicationModel class methodsFor:'initialization'!
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   105
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   106
initialize 
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   107
    self == ApplicationModel ifTrue:[
389
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   108
        Smalltalk addDependent:self
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   109
    ].
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   110
    DefaultLabels isNil ifTrue:[
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   111
        DefaultLabels := IdentityDictionary new
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   112
    ].
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   113
    DefaultVisuals isNil ifTrue:[
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   114
        DefaultVisuals := IdentityDictionary new
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   115
    ].
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   116
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   117
    "
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   118
     ApplicationModel initialize
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   119
    "
389
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   120
1af1890c6f0b ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   121
    "Modified: 28.1.1997 / 12:31:38 / cg"
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   122
! !
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   123
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   124
!ApplicationModel class methodsFor:'instance creation'!
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   125
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   126
new
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   127
    "return a new initialized instance"
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   128
63
claus
parents: 61
diff changeset
   129
    ^ super new basicInitialize initialize
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   130
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   131
    "Modified: 24.4.1996 / 09:42:14 / cg"
311
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   132
!
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   133
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   134
onDevice:aDevice
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   135
    "return a new initialized instance, which shall open its interface
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   136
     on aDevice."
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   137
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   138
    ^ (super new basicInitialize
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   139
        setDevice:aDevice) initialize
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   140
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   141
    "Modified: 24.4.1996 / 09:42:14 / cg"
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   142
    "Created: 5.7.1996 / 12:19:15 / cg"
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   143
! !
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   144
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   145
!ApplicationModel class methodsFor:'accessing'!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   146
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   147
application
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   148
    ^ self
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   149
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   150
! !
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   151
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   152
!ApplicationModel class methodsFor:'bindings'!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   153
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   154
actionFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   155
    "sent by the builder to ask for an actionBlock for
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   156
     a Button. The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   157
     for a buttons #action property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   158
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   159
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   160
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   161
     actionBlocks from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   162
     Typically, a block is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   163
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   164
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   165
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   166
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   167
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   168
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   169
aspectFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   170
    "sent by the builder to ask for an aspect (a data model).
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   171
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   172
     for a components #aspect property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   173
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   174
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   175
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   176
     holders from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   177
     Typically, a valueHolder is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   178
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   179
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   180
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   181
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   182
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   183
clientFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   184
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   185
     subcanvas's application.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   186
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   187
     for a subcanvas's #client property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   188
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   189
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   190
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   191
     appModels from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   192
     Typically, an applicationModel is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   193
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   194
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   195
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   196
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   197
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   198
componentFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   199
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   200
     component.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   201
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   202
     for a viewHolders #view property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   203
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   204
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   205
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   206
     holders from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   207
     Typically, a view is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   208
427
e8dffb2f3e1e checkin from browser
ca
parents: 421
diff changeset
   209
    (self respondsTo:aKey) ifTrue:[
e8dffb2f3e1e checkin from browser
ca
parents: 421
diff changeset
   210
        ^ self perform:aKey
e8dffb2f3e1e checkin from browser
ca
parents: 421
diff changeset
   211
    ].
e8dffb2f3e1e checkin from browser
ca
parents: 421
diff changeset
   212
    ^ nil
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   213
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   214
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   215
labelFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   216
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   217
     label for a component.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   218
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   219
     for a components #label property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   220
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   221
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   222
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   223
     labels from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   224
     Typically, a string is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   225
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   226
    (self application respondsTo:aKey) ifTrue:[
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   227
        ^ self application perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   228
    ].
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   229
    ^ self application labelAt:aKey ifAbsent:nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   230
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   231
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   232
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   233
listFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   234
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   235
     holder for a list.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   236
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   237
     for a listWidgets #list property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   238
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   239
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   240
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   241
     holders from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   242
     Typically, a list-holding model (SelectionInList) is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   243
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   244
    ^ self application perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   245
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   246
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   247
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   248
menuFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   249
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   250
     holder for a menu.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   251
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   252
     for a widgets #menu property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   253
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   254
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   255
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   256
     holders from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   257
     Typically, a menu or a menu-holding valueHolder is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   258
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   259
    ^ self application perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   260
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   261
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   262
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   263
specificationFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   264
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   265
     component.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   266
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   267
     for a viewHolders #specification property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   268
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   269
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   270
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   271
     holders from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   272
     Typically, a view is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   273
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   274
    ^ self application perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   275
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   276
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   277
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   278
visualFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   279
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   280
     image or element for a label.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   281
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   282
     for a widgets #label property, if LabelIsImage is turned on.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   283
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   284
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   285
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   286
     images from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   287
     Typically, an image is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   288
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   289
    (self application respondsTo:aKey) ifTrue:[
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   290
        ^ self application perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   291
    ].
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   292
    ^ self application visualAt:aKey ifAbsent:nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   293
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   294
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   295
! !
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   296
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   297
!ApplicationModel class methodsFor:'change & update'!
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   298
302
edd5c8754ac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   299
update:something with:aParameter from:changedObject
69
claus
parents: 63
diff changeset
   300
    "flush resources on language changes"
claus
parents: 63
diff changeset
   301
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   302
    something == #Language ifTrue:[
302
edd5c8754ac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   303
        "flush resources on language changes"
edd5c8754ac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   304
        self flushAllClassResources
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   305
    ]
302
edd5c8754ac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   306
edd5c8754ac8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 287
diff changeset
   307
    "Created: 15.6.1996 / 15:13:29 / cg"
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   308
! !
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   309
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   310
!ApplicationModel class methodsFor:'defaults'!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   311
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   312
labelAt:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   313
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   314
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   315
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   316
labelAt:aKey ifAbsent:aBlock
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   317
    ^ aBlock value
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   318
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   319
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   320
labelAt:aKey put:aValue
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   321
    "/ not yet implemented
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   322
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   323
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   324
labels
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   325
    "/ not yet implemented
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   326
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   327
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   328
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   329
visualAt:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   330
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   331
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   332
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   333
visualAt:aKey ifAbsent:aBlock
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   334
    ^ aBlock value
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   335
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   336
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   337
visualAt:aKey put:aValue
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   338
    "/ not yet implemented
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   339
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   340
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   341
visuals
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   342
    "/ not yet implemented
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   343
    ^ nil
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   344
! !
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   345
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   346
!ApplicationModel class methodsFor:'queries'!
63
claus
parents: 61
diff changeset
   347
claus
parents: 61
diff changeset
   348
interfaceSpecFor:aSelector
69
claus
parents: 63
diff changeset
   349
    "return an interface spec"
claus
parents: 63
diff changeset
   350
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   351
    ^ UISpecification from:(self application specificationFor:aSelector)
63
claus
parents: 61
diff changeset
   352
! !
claus
parents: 61
diff changeset
   353
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   354
!ApplicationModel class methodsFor:'resources'!
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   355
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   356
classResources
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   357
    "if not already loaded, get the classes resourcePack
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   358
     and return it"
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   359
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   360
    ClassResources isNil ifTrue:[
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   361
	ClassResources := ResourcePack for:self.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   362
    ].
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   363
    ^ ClassResources
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   364
!
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   365
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   366
classResources:aResourcePack
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   367
    "allow setting of the classResources"
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   368
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   369
    ClassResources := aResourcePack
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   370
!
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   371
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   372
flushAllClassResources
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   373
    "flush all classes resource translations.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   374
     Needed after a resource file / language setting has changed."
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   375
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   376
    ResourcePack flushCachedResourcePacks.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   377
    self flushClassResources.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   378
    self allSubclassesDo:[:aClass |
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   379
	aClass flushClassResources.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   380
    ]
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   381
!
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   382
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   383
flushClassResources
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   384
    "flush classes resource string translations.
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   385
     Needed whenever a resource file / language setting has changed"
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   386
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   387
    ClassResources := nil.
63
claus
parents: 61
diff changeset
   388
!
claus
parents: 61
diff changeset
   389
claus
parents: 61
diff changeset
   390
updateClassResources
claus
parents: 61
diff changeset
   391
    "update my classResources"
claus
parents: 61
diff changeset
   392
claus
parents: 61
diff changeset
   393
    ClassResources := nil.
claus
parents: 61
diff changeset
   394
    self classResources
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   395
! !
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   396
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   397
!ApplicationModel class methodsFor:'startup'!
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   398
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   399
open
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   400
    "create an instance of the application and open its view"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   401
240
09028fa9ff5f return app in class>>open
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   402
    ^ self new open
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   403
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   404
    "
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   405
     Launcher open
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   406
    "
240
09028fa9ff5f return app in class>>open
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   407
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   408
    "Modified: 13.1.1997 / 20:54:50 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   409
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   410
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   411
openAt:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   412
    "create an instance of the application and open its view
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   413
     at some position."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   414
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   415
    ^ self new openAt:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   416
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   417
    "Modified: 14.2.1997 / 20:28:41 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   418
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   419
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   420
openDialogInterface:anInterfaceSymbol
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   421
    "create an instance of the application and open a view as
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   422
     specified by anInterfaceSymbol."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   423
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   424
    ^ self new openDialogInterface:anInterfaceSymbol
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   425
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   426
    "Modified: 5.9.1995 / 17:54:50 / claus"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   427
    "Modified: 13.1.1997 / 20:55:02 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   428
    "Created: 14.2.1997 / 20:33:10 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   429
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   430
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   431
openInterface:anInterfaceSymbol
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   432
    "create an instance of the application and open a view as
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   433
     specified by anInterfaceSymbol."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   434
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   435
    ^ self new openInterface:anInterfaceSymbol
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   436
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   437
    "Modified: 5.9.1995 / 17:54:50 / claus"
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   438
    "Modified: 13.1.1997 / 20:55:02 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   439
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   440
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   441
openInterface:anInterfaceSymbol at:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   442
    "create an instance of the application and open a view as
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   443
     specified by anInterfaceSymbol."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   444
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   445
    ^ self new openInterface:anInterfaceSymbol at:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   446
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   447
    "Modified: 14.2.1997 / 20:28:47 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   448
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   449
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   450
openOn:anApplicationModel
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   451
    "send an open message to the argument, anApplicationModel.
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   452
     I dont really understand what this method is useful for ..."
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   453
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   454
    ^ anApplicationModel open
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   455
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   456
    "Modified: 13.1.1997 / 20:55:05 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   457
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   458
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   459
openOnDevice:aDevice
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   460
    "create an instance of the application and open its view
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   461
     on ANOTHER device. 
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   462
     For more info, read the document on multiple display
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   463
     support and the documentation of the DeviceWorkstation class."
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   464
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   465
    ^ (self onDevice:aDevice) open
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   466
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   467
    "
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   468
     Launcher openOnDevice:Display
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   469
    "
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   470
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   471
    "Modified: 13.1.1997 / 20:55:27 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   472
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   473
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   474
!ApplicationModel methodsFor:'accessing'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   475
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   476
application
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   477
    ^ self class
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   478
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   479
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   480
builder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   481
    "return the applications builder; this one has more information
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   482
     about views, components etc."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   483
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   484
    ^ builder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   485
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   486
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   487
builder:aBuilder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   488
    "set the applications builder. Normally, you should not set it
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   489
     directly, but depend on the default builder, as created when the application
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   490
     was created."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   491
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   492
    builder := aBuilder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   493
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   494
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   495
focusSequence
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   496
    "return a focusSequence for stepping through the applications views.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   497
     The builder usually keeps track of so-called 'tabable' views.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   498
     Stepping is done with the FocusNext/FocusPrevius keys, which are 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   499
     typically bound to Meta-CursorUp/Meta-CursorDown.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   500
     Subclasses which do not use the builder (but instead build their view
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   501
     programmatically) should redefine this method to return a collection of
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   502
     views which defines the sequence."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   503
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   504
    builder notNil ifTrue:[
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   505
	^ builder focusSequence
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   506
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   507
    ^ nil
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   508
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   509
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   510
resources
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   511
    "return the applications resources - thats a ResourcePack containing
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   512
     language strings"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   513
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   514
    ^ resources
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   515
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   516
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   517
window
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   518
    "return my topWindow"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   519
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   520
    ^ builder window
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   521
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   522
187
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   523
window:aTopView
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   524
    "set my topWindow"
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   525
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   526
    builder window:aTopView
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   527
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   528
    "Created: 18.4.1996 / 14:55:26 / cg"
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   529
!
9e35ae67f07c added #window:
Claus Gittinger <cg@exept.de>
parents: 144
diff changeset
   530
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   531
windowGroup 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   532
    "return the applications windowGroup"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   533
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   534
    ^ builder window windowGroup
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   535
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   536
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   537
!ApplicationModel methodsFor:'binding access'!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   538
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   539
actionFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   540
    "sent by the builder to ask for an actionBlock for
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   541
     a Button. The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   542
     for a buttons #action property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   543
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   544
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   545
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   546
     actionBlocks from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   547
     Typically, a block is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   548
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   549
    ^ [self perform:aKey]
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   550
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   551
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   552
aspectFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   553
    "sent by the builder to ask for an aspect (a data model).
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   554
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   555
     for a components #aspect property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   556
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   557
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   558
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   559
     holders from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   560
     Typically, a valueHolder is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   561
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   562
    ^ self perform:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   563
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   564
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   565
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   566
clientFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   567
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   568
     subcanvas's application.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   569
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   570
     for a subcanvas's #client property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   571
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   572
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   573
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   574
     appModels from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   575
     Typically, an applicationModel is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   576
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   577
    ^ self perform:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   578
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   579
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   580
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   581
componentFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   582
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   583
     component.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   584
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   585
     for a viewHolders #view property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   586
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   587
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   588
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   589
     holders from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   590
     Typically, a view is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   591
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   592
    (self respondsTo:aKey) ifTrue:[
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   593
        ^ self perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   594
    ].
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   595
    ^ self application componentFor:aKey
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   596
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   597
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   598
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   599
labelFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   600
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   601
     label for a component.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   602
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   603
     for a components #label property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   604
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   605
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   606
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   607
     labels from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   608
     Typically, a string is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   609
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   610
    ^ self application labelFor:aKey
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   611
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   612
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   613
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   614
listFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   615
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   616
     holder for a list.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   617
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   618
     for a listWidgets #list property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   619
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   620
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   621
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   622
     holders from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   623
     Typically, a list-holding model (SelectionInList) is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   624
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   625
    (self respondsTo:aKey) ifTrue:[
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   626
        ^ self perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   627
    ].
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   628
    ^ self application listFor:aKey
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   629
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   630
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   631
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   632
menuFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   633
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   634
     holder for a menu.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   635
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   636
     for a widgets #menu property.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   637
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   638
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   639
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   640
     holders from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   641
     Typically, a menu or a menu-holding valueHolder is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   642
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   643
    (self respondsTo:aKey) ifTrue:[
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   644
        ^ self perform:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   645
    ].
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   646
    ^ self application menuFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   647
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   648
!
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   649
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   650
specificationFor:aKey
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   651
    "sent by the builder to ask for an application provided
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   652
     subcanvas's application.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   653
     The argument, aKey comes from an UI-spec
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   654
     for a subcanvas's #specification property.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   655
     Here, a corresponding message is sent to myself,
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   656
     which ought to be defined in the application subclass.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   657
     Alternatively, a subclass may redefine this method, to provide
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   658
     appModels from a Dictionary or whatever.
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   659
     Typically, an applicationModel is returned there."
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   660
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   661
    ^ self perform:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   662
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   663
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   664
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   665
visualFor:aKey
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   666
    "sent by the builder to ask for an application provided
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   667
     image or element for a label.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   668
     The argument, aKey comes from an UI-spec
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   669
     for a widgets #label property, if LabelIsImage is turned on.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   670
     Here, a corresponding message is sent to myself,
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   671
     which ought to be defined in the application subclass.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   672
     Alternatively, a subclass may redefine this method, to provide
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   673
     images from a Dictionary or whatever.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   674
     Typically, an image is returned there."
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   675
421
e163e734b31c changed binding access
ca
parents: 402
diff changeset
   676
    ^ self application visualFor:aKey
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   677
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   678
! !
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   679
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   680
!ApplicationModel methodsFor:'component manipulations'!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   681
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   682
components:aSymbolOrArray do:aBlock
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   683
    "evaluate aBlock for all components listed aSymbolOrArray."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   684
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   685
    |coll|
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   686
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   687
    aSymbolOrArray isSymbol ifTrue:[
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   688
        "/ a single components name
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   689
        coll := Array with:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   690
    ] ifFalse:[
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   691
        coll := aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   692
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   693
    coll do:[:aSymbol |
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   694
        |component|
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   695
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   696
        (component := self component:aSymbol) isNil ifFalse:[
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   697
            aBlock value:component
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   698
        ]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   699
    ]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   700
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   701
    "Modified: 14.2.1997 / 17:36:42 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   702
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   703
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   704
disable:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   705
    "disable the components whose id's are aSymbolOrArray."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   706
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   707
    self components:aSymbolOrArray do:[:comp | comp disable]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   708
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   709
    "Modified: 14.2.1997 / 17:32:09 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   710
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   711
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   712
enable:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   713
    "enables the component(s) identified by aSymbolOrArray."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   714
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   715
    self components:aSymbolOrArray do:[:comp | comp enable]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   716
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   717
    "Modified: 14.2.1997 / 17:32:19 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   718
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   719
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   720
invalidate:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   721
    "invalidates the component(s) identified by aSymbolOrArray."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   722
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   723
    self components:aSymbolOrArray do:[:comp | comp invalidate]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   724
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   725
    "Modified: 14.2.1997 / 17:32:28 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   726
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   727
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   728
makeInvisible:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   729
    "makes the components whose id's are aSymbolOrArray invisible"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   730
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   731
    self components:aSymbolOrArray do:[:comp | comp beInvisible]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   732
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   733
    "Modified: 14.2.1997 / 17:32:42 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   734
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   735
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   736
makeReadOnly:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   737
    "make all components identified by aSymbolOrArray read only
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   738
     (for editText components)."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   739
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   740
    self components:aSymbolOrArray do:[:comp | comp readOnly:true]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   741
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   742
    "Modified: 14.2.1997 / 17:36:22 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   743
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   744
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   745
makeVisible:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   746
    "makes the components whose id's are aSymbolOrArray visible"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   747
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   748
    self components:aSymbolOrArray do:[:comp | comp beVisible]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   749
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   750
    "Modified: 14.2.1997 / 17:32:52 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   751
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   752
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   753
makeWritable:aSymbolOrArray
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   754
    "make all components identified by aSymbolOrArray writable 
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   755
     (for editText components)."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   756
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   757
    self components:aSymbolOrArray do:[:comp | comp readOnly:false]
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   758
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   759
    "Created: 14.2.1997 / 17:36:17 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   760
! !
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   761
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   762
!ApplicationModel methodsFor:'drag & drop'!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   763
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   764
canDrop:anObjectOrCollection in:aComponent
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   765
    "drop manager asked if a drop is possible
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   766
     - should be redefined by apps which can do it, to return true"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   767
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   768
    ^ false
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   769
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   770
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   771
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   772
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   773
drop:anObjectOrCollection in:aComponent at:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   774
    "drop manager wants to drop.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   775
     This is ony sent, if #canDrop:in: returned true.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   776
     Must be redefined in apps which return true to #canDrop."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   777
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   778
    self subclassResponsibility
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   779
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   780
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   781
! !
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   782
429
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   783
!ApplicationModel methodsFor:'easy bindings'!
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   784
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   785
registerInterestIn: aValueModel using: aSelectorOrArray
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   786
    "Register interest in a change in aValueModel using information in aSelectorOrArray.
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   787
     aSelectorOrArray can be one of three things:  
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   788
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   789
            1) nil                  in which case no interest is registered
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   790
            2) a selector           in which case the receiver is understood to be self
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   791
            3) an Array             in which case the size is two where the first element is the
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   792
                                            message to be sent and the second element is the receiver."
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   793
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   794
    aSelectorOrArray isNil ifTrue: [^ aValueModel].
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   795
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   796
    (aSelectorOrArray isKindOf:Array) ifTrue:[
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   797
        aValueModel onChangeSend:(aSelectorOrArray at: 1) to:(aSelectorOrArray at: 2)
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   798
    ] ifFalse: [
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   799
        aValueModel onChangeSend:aSelectorOrArray to:self
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   800
    ].
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   801
    ^aValueModel
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   802
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   803
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   804
!
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   805
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   806
valueHolderFor:aSelector initialValue:anObject
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   807
    "Return a ValueHolder on anObject." 
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   808
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   809
    ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   810
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   811
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   812
!
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   813
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   814
valueHolderFor: aSelector initialValue: anObject changeMessage: aSelectorOrArray
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   815
    "Return a ValueHolder on anObject.  aSelectorOrArray is the change information 
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   816
     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.  
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   817
     If it is a Symbol, then it is the change message and the interested object is understood
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   818
     to be the reciever.  If it is an Array, then the first element is the change message and 
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   819
     the second element is the interested object. " 
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   820
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   821
    (self builder bindings includesKey:aSelector) ifFalse:[
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   822
        ^ self registerInterestIn:(ValueHolder with:anObject) using:aSelectorOrArray
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   823
    ].
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   824
    ^ self builder aspectAt:aSelector
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   825
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   826
! !
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   827
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   828
!ApplicationModel methodsFor:'initialization'!
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   829
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   830
addTopViewsToCurrentProject
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   831
    "add all of my topViews to the current projects list of views.
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   832
     This allows hiding views on a per-project basis.
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   833
     Applications which do not want to be switched with projects
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   834
     (such as the Launcher), may redefine this to a noop."
85
claus
parents: 83
diff changeset
   835
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   836
    self windowGroup topViews do:[:aView |
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   837
        aView addToCurrentProject
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   838
    ]
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   839
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   840
    "Modified: 17.1.1997 / 19:43:39 / cg"
85
claus
parents: 83
diff changeset
   841
!
claus
parents: 83
diff changeset
   842
63
claus
parents: 61
diff changeset
   843
basicInitialize
69
claus
parents: 63
diff changeset
   844
    "initialize the application.
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   845
     Since ST-80 applications seem commonly to redefine #initialize
69
claus
parents: 63
diff changeset
   846
     without doing a super initialize, the real initialization is
claus
parents: 63
diff changeset
   847
     done here ..."
claus
parents: 63
diff changeset
   848
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   849
    super initialize.
72
claus
parents: 71
diff changeset
   850
311
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   851
    device := Screen current.
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   852
72
claus
parents: 71
diff changeset
   853
    "claus: I wanted to delay the creation & assignment of the
claus
parents: 71
diff changeset
   854
     builder till later, to allow setting to another builder.
claus
parents: 71
diff changeset
   855
     however, some ST-80 code accesses the builder right after instance
claus
parents: 71
diff changeset
   856
     creation ..."
claus
parents: 71
diff changeset
   857
claus
parents: 71
diff changeset
   858
"/    "
claus
parents: 71
diff changeset
   859
"/     Create a windowBuilder to have someone around which
claus
parents: 71
diff changeset
   860
"/     understands the builder protocol. Since UIBuilder is not present
claus
parents: 71
diff changeset
   861
"/     in all systems, this allows operation without one (unless a spec
claus
parents: 71
diff changeset
   862
"/     is read later ...)
claus
parents: 71
diff changeset
   863
"/    "
85
claus
parents: 83
diff changeset
   864
    builder := self createBuilder.
78
claus
parents: 72
diff changeset
   865
    builder notNil ifTrue:[builder application:self].
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   866
    resources := self class classResources.
311
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   867
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   868
    "Modified: 17.1.1997 / 19:41:59 / cg"
63
claus
parents: 61
diff changeset
   869
!
claus
parents: 61
diff changeset
   870
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   871
createBuilder 
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   872
    "create a UI Builder for me.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   873
     This method can be redefined if (eventually) there are
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   874
     spec readers for other UI languages (motif UIL ?)"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   875
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   876
    |cls|
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   877
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   878
    (cls := UIBuilder) isNil ifTrue:[
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   879
	(cls := WindowBuilder) isNil ifTrue:[
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   880
	    ^ nil
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   881
	]
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   882
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   883
    ^ cls new
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   884
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   885
63
claus
parents: 61
diff changeset
   886
initialize
83
claus
parents: 81
diff changeset
   887
    "nothing done here;
claus
parents: 81
diff changeset
   888
     but can be redefined in concrete applications"
311
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   889
!
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   890
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   891
setDevice:aDevice
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   892
    "set the device (i.e. some Screen), where the application
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   893
     shall open its view(s).
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   894
     The default device (if not set here) will be the current screen."
311
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   895
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   896
    device := aDevice
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   897
fa222d8a208c allow opening an app on another device
Claus Gittinger <cg@exept.de>
parents: 310
diff changeset
   898
    "Created: 5.7.1996 / 12:01:40 / cg"
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   899
    "Modified: 17.1.1997 / 19:44:09 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   900
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   901
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   902
!ApplicationModel methodsFor:'misc'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   903
287
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   904
restoreCursors
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   905
    "restore the original cursors in all of my views"
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   906
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   907
    ^ self window windowGroup restoreCursors
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   908
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   909
    "Created: 1.6.1996 / 17:01:24 / cg"
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   910
!
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   911
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   912
showCursor:aCursor
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   913
    "set all of my views cursor to aCursor.
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   914
     It can be restored with #restoreCursor."
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   915
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   916
    ^ self window windowGroup showCursor:aCursor
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   917
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   918
    "Created: 1.6.1996 / 17:01:09 / cg"
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   919
!
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   920
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   921
withCursor:aCursor do:aBlock
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   922
    "evaluate aBlock, showing aCursor in my topView and all of its subviews.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   923
     Return the value of aBlock."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   924
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   925
    ^ self window withCursor:aCursor do:aBlock
63
claus
parents: 61
diff changeset
   926
!
claus
parents: 61
diff changeset
   927
142
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   928
withExecuteCursorDo:aBlock
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   929
    "evaluate aBlock, showing an executeCursor in my topView and all of its subviews.
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   930
     Return the value of aBlock."
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   931
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   932
    ^ self withCursor:(Cursor execute) do:aBlock
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   933
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   934
    "Created: 14.12.1995 / 20:57:03 / cg"
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   935
!
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   936
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   937
withReadCursorDo:aBlock
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   938
    "evaluate aBlock, showing a readCursor in my topView and all of its subviews.
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   939
     Return the value of aBlock."
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   940
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   941
    ^ self withCursor:(Cursor read) do:aBlock
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   942
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   943
    "Created: 14.12.1995 / 20:56:47 / cg"
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   944
    "Modified: 14.12.1995 / 20:57:36 / cg"
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   945
!
6c6259d788a4 added withReadCursorDo: / withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
   946
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   947
withWaitCursorDo:aBlock
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   948
    "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   949
     Return the value of aBlock."
63
claus
parents: 61
diff changeset
   950
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   951
    ^ self withCursor:Cursor wait do:aBlock
52
6dc870beba69 *** empty log message ***
claus
parents: 50
diff changeset
   952
! !
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
   953
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   954
!ApplicationModel methodsFor:'opening'!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   955
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   956
openDialog
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   957
    "open the window - assumes that the builder has already setup
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   958
     the interface."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   959
432
ba589e89a829 *** empty log message ***
ca
parents: 429
diff changeset
   960
    ^ builder openDialog.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   961
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   962
    "Modified: 14.2.1997 / 20:32:52 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   963
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   964
429
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   965
openDialogInterface:aSelector
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   966
    "open a dialog"
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   967
432
ba589e89a829 *** empty log message ***
ca
parents: 429
diff changeset
   968
    ^ SimpleDialog new openFor:self interface:aSelector
429
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   969
!
3311c88f2a0e dialog opening stuff
ca
parents: 428
diff changeset
   970
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   971
openWindow
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   972
    "open the window - assumes that the builder has already setup
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   973
     the interface."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   974
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   975
    builder openWindow.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   976
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   977
    "Created: 14.2.1997 / 20:20:39 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   978
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   979
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   980
openWindowAt:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   981
    "open the window - assumes that the builder has already setup
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   982
     the interface."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   983
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   984
    builder openWindowAt:aLocation.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   985
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   986
    "Created: 14.2.1997 / 20:20:55 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   987
! !
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   988
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   989
!ApplicationModel methodsFor:'private'!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   990
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   991
opened
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   992
    "the topView has been opened.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   993
     This is sent by my topView when its really open
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   994
     (i.e. finally visible)"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   995
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   996
    self addTopViewsToCurrentProject.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   997
    self postOpenWith:builder
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   998
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
   999
    "Modified: 14.2.1997 / 20:26:16 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1000
! !
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1001
71
claus
parents: 69
diff changeset
  1002
!ApplicationModel methodsFor:'queries'!
claus
parents: 69
diff changeset
  1003
371
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1004
defaultWindowType
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1005
    "Applications come up non-modal, by default"
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1006
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1007
    ^ #normal
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1008
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1009
    "Created: 17.1.1997 / 19:57:34 / cg"
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1010
!
ce94ec6a38ee more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
  1011
313
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1012
graphicsDevice
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1013
    "return the device I want to open my views on.
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1014
     The default (if not created with #onDevice:) is the currently
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1015
     active screen."
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1016
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1017
    ^ device
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1018
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1019
    "Created: 5.7.1996 / 17:51:31 / cg"
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1020
!
09c2e83252f4 added access to graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 311
diff changeset
  1021
71
claus
parents: 69
diff changeset
  1022
processName
claus
parents: 69
diff changeset
  1023
    "return a name to be shown for me in the process monitor"
claus
parents: 69
diff changeset
  1024
claus
parents: 69
diff changeset
  1025
    ^ 'Application'
claus
parents: 69
diff changeset
  1026
! !
claus
parents: 69
diff changeset
  1027
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1028
!ApplicationModel methodsFor:'startup / release'!
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1029
63
claus
parents: 61
diff changeset
  1030
allButOpenFrom:aSpec
69
claus
parents: 63
diff changeset
  1031
    "create my views but do not open the main window"
claus
parents: 63
diff changeset
  1032
71
claus
parents: 69
diff changeset
  1033
    |realBuilder|
claus
parents: 69
diff changeset
  1034
72
claus
parents: 71
diff changeset
  1035
"/ DISABLED; see comment in basicInitialize
claus
parents: 71
diff changeset
  1036
"/
claus
parents: 71
diff changeset
  1037
"/    "
claus
parents: 71
diff changeset
  1038
"/     here, we kludge a bit: up to now, the builder was an
claus
parents: 71
diff changeset
  1039
"/     instance of the no-op WindowBuilder. Now, it becomes
claus
parents: 71
diff changeset
  1040
"/     a UIBuilder ....
claus
parents: 71
diff changeset
  1041
"/     This allows for ApplicationModels without a UIBuilder
claus
parents: 71
diff changeset
  1042
"/     if not needed.
claus
parents: 71
diff changeset
  1043
"/    "
claus
parents: 71
diff changeset
  1044
"/    realBuilder := UIBuilder new.
claus
parents: 71
diff changeset
  1045
"/    builder := realBuilder.
claus
parents: 71
diff changeset
  1046
"/    builder application:self.
claus
parents: 71
diff changeset
  1047
"/    builder bindings:builder bindings.
71
claus
parents: 69
diff changeset
  1048
63
claus
parents: 61
diff changeset
  1049
    self preBuildWith:builder.
claus
parents: 61
diff changeset
  1050
    builder buildFromSpec:aSpec.
85
claus
parents: 83
diff changeset
  1051
    builder window model:self.
claus
parents: 83
diff changeset
  1052
    builder window application:self.
63
claus
parents: 61
diff changeset
  1053
    self postBuildWith:builder.
claus
parents: 61
diff changeset
  1054
!
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1055
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1056
allButOpenInterface:aSymbol
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1057
    "create my views but do not open the main window"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1058
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1059
    |spec|
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1060
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1061
    spec := self class interfaceSpecFor:aSymbol.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1062
    self allButOpenFrom:spec.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1063
    ^ builder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1064
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1065
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1066
close
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1067
    "this is sent by my topView when about to be closed
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1068
     by the program (not by the windowManager).
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1069
     Could be redefined in subclasses."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1070
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1071
    self closeDownViews
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1072
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1073
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1074
closeDownViews
435
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1075
    "close down the applications view(s)"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1076
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1077
    |wg views|
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1078
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1079
    (wg := self windowGroup) notNil ifTrue:[
435
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1080
        views := wg topViews.
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1081
        views notNil ifTrue:[
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1082
            views copy do:[:aView |
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1083
                aView notNil ifTrue:[aView destroy]
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1084
            ]
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1085
        ]
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1086
    ]
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1087
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1088
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1089
closeRequest
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1090
    "this is sent by my topView when about to be closed by the
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1091
     windowmanager. Can be redefined to inform & query about unsafed
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1092
     view contents, to send #close on ok, or ignore the closeRequest."
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1093
435
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1094
    self close
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1095
!
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1096
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1097
closeRequestFor:aTopView
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1098
    "this is sent by any of my topViews when about to be closed by the
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1099
     windowmanager. For backward compatibility with single-view applications,
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1100
     this is forwarded here to a simple (non topView-specific) closeRequest.
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1101
     MultiView applications should redefine this method if closing of individual
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1102
     views closing is to be cought."
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1103
68081adabd45 checkin from browser
ca
parents: 432
diff changeset
  1104
    ^ self closeRequest
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1105
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1106
69
claus
parents: 63
diff changeset
  1107
open
claus
parents: 63
diff changeset
  1108
    "open a standard interface"
claus
parents: 63
diff changeset
  1109
240
09028fa9ff5f return app in class>>open
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1110
    ^ self openInterface
09028fa9ff5f return app in class>>open
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1111
09028fa9ff5f return app in class>>open
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1112
    "Modified: 3.5.1996 / 13:39:15 / cg"
69
claus
parents: 63
diff changeset
  1113
!
claus
parents: 63
diff changeset
  1114
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1115
openAt:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1116
    "open a standard interface at some point"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1117
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1118
    ^ self openInterfaceAt:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1119
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1120
    "Modified: 3.5.1996 / 13:39:15 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1121
    "Created: 14.2.1997 / 20:17:41 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1122
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1123
63
claus
parents: 61
diff changeset
  1124
openInterface
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1125
    "open a standard interface.
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1126
78
claus
parents: 72
diff changeset
  1127
     Subclasses which do not have an interfaceSpec 
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1128
     should redefine this method and create & open their view(s) there.
330
d7ce98930ad3 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 313
diff changeset
  1129
     (see Launcher as an example)."
69
claus
parents: 63
diff changeset
  1130
63
claus
parents: 61
diff changeset
  1131
    self openInterface:#windowSpec
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1132
330
d7ce98930ad3 Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents: 313
diff changeset
  1133
    "Modified: 9.9.1996 / 22:39:23 / stefan"
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1134
    "Modified: 14.2.1997 / 20:18:26 / cg"
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1135
!
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1136
63
claus
parents: 61
diff changeset
  1137
openInterface:aSymbol
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1138
    "open a specific interface. 
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1139
     The argument, aSymbol specifies which interface. The concrete
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1140
     application subclass must provide a method with that name,
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1141
     which must return an interfaceSpec. This is forwarded to
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1142
     the builder to create the views.
69
claus
parents: 63
diff changeset
  1143
     Typically, applications only use one interface, 
78
claus
parents: 72
diff changeset
  1144
     returned by the #windowSpec method."
69
claus
parents: 63
diff changeset
  1145
85
claus
parents: 83
diff changeset
  1146
    self allButOpenInterface:aSymbol.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1147
    self openWindow.
63
claus
parents: 61
diff changeset
  1148
    ^ builder
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1149
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1150
    "Modified: 14.2.1997 / 20:25:33 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1151
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1152
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1153
openInterface:aSymbol at:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1154
    "open a specific interface. 
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1155
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1156
     The argument, aSymbol specifies which interface. The concrete
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1157
     application subclass must provide a method with that name,
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1158
     which must return an interfaceSpec. This is forwarded to
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1159
     the builder to create the views.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1160
     Typically, applications only use one interface, 
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1161
     returned by the #windowSpec method."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1162
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1163
    self allButOpenInterface:aSymbol.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1164
    self openWindowAt:aLocation.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1165
    ^ builder
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1166
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1167
    "Created: 14.2.1997 / 20:19:44 / cg"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1168
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1169
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1170
openInterfaceAt:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1171
    "open a standard interface."
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1172
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1173
    self openInterface:#windowSpec at:aLocation
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1174
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
  1175
    "Created: 14.2.1997 / 20:18:20 / cg"
63
claus
parents: 61
diff changeset
  1176
!
claus
parents: 61
diff changeset
  1177
362
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1178
openOnDevice:aDevice
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1179
    "open a standard interface on some other device"
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1180
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1181
    self setDevice:aDevice.
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1182
    ^ self open
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1183
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1184
    "Created: 13.1.1997 / 21:24:11 / cg"
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1185
    "Modified: 13.1.1997 / 21:24:30 / cg"
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1186
!
52212e2a8c84 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
  1187
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1188
postBuildWith:aBuilder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1189
    "this is sent after an interface is built from a spec.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1190
     Can be redefined in subclasses.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1191
     mhmh - what should this do here ?"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1192
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1193
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1194
postOpenWith:aBuilder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1195
    "this is sent after the applications main window is opened.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1196
     Can be redefined in subclasses.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1197
     mhmh - what should this do here ?"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1198
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1199
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1200
preBuildWith:aBuilder
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1201
    "this is sent before an interface is built from a spec.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1202
     Can be redefined in subclasses.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1203
     mhmh - what should this do here ?"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1204
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1205
69
claus
parents: 63
diff changeset
  1206
restarted
287
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
  1207
    "sent by my topWindow, when restarted from an image.
69
claus
parents: 63
diff changeset
  1208
     Nothing done here, but can be redefined to perform any actions
claus
parents: 63
diff changeset
  1209
     required to reset the application after an image-restart.
claus
parents: 63
diff changeset
  1210
     (for example: check if application files are still around, restart
287
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
  1211
      subprocesses etc.)."
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
  1212
7a733e0b5465 cursor stuff
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
  1213
    "Modified: 1.6.1996 / 16:55:50 / cg"
63
claus
parents: 61
diff changeset
  1214
!
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1215
63
claus
parents: 61
diff changeset
  1216
saveAndTerminateRequest
claus
parents: 61
diff changeset
  1217
    "some windowManagers send this to shut down an application
claus
parents: 61
diff changeset
  1218
     and have it save its state for restart.
claus
parents: 61
diff changeset
  1219
     Can be redefined in subclasses"
claus
parents: 61
diff changeset
  1220
claus
parents: 61
diff changeset
  1221
    self closeRequest
437
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1222
!
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1223
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1224
saveAndTerminateRequestFor:aTopView
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1225
    "some windowManagers send this to shut down an application
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1226
     and have it save its state for restart.
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1227
     Can be redefined in subclasses"
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1228
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1229
    self saveAndTerminateRequest
57
3984019e8f5f *** empty log message ***
claus
parents: 52
diff changeset
  1230
! !
72
claus
parents: 71
diff changeset
  1231
85
claus
parents: 83
diff changeset
  1232
!ApplicationModel methodsFor:'window events'!
claus
parents: 83
diff changeset
  1233
144
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1234
showActivity:someMessage
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1235
    "some activityNotification shalt be communicated to
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1236
     the user. Forwarded from the topView and ignored here.
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1237
     Can be redefined in concrete applications to show the
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1238
     message either in some infoView (infoLabel as in Windows)
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1239
     or in the title area (as done in the browsers)"
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1240
144
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1241
    ^ self
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1242
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1243
    "Created: 16.12.1995 / 18:41:04 / cg"
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1244
    "Modified: 24.4.1996 / 09:34:22 / cg"
144
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1245
!
a75a0c558a77 activity notification added
Claus Gittinger <cg@exept.de>
parents: 142
diff changeset
  1246
85
claus
parents: 83
diff changeset
  1247
windowEvent:anEvent from:anApplicationWindow
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1248
    "dummy: windowEvent forwarding is not yet implemented"
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1249
85
claus
parents: 83
diff changeset
  1250
    ^ self
215
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1251
369b0376e859 commentary
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
  1252
    "Modified: 24.4.1996 / 09:32:50 / cg"
85
claus
parents: 83
diff changeset
  1253
! !
claus
parents: 83
diff changeset
  1254
361
765fe20a26d1 fixed #openOnDevice:;
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
  1255
!ApplicationModel class methodsFor:'documentation'!
72
claus
parents: 71
diff changeset
  1256
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1257
version
437
092e025be49e checkin from browser
ca
parents: 435
diff changeset
  1258
    ^ '$Header: /cvs/stx/stx/libview2/Attic/AppModel.st,v 1.42 1997-02-18 11:00:46 ca Exp $'
81
claus
parents: 78
diff changeset
  1259
! !
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
  1260
ApplicationModel initialize!