ApplicationModel.st
author Claus Gittinger <cg@exept.de>
Mon, 25 Jul 2011 16:00:36 +0200
changeset 2931 0163ade8b5d8
parent 2930 5f7129ba1255
child 2936 bb406f5441f1
permissions -rw-r--r--
added: #openWindowAs:at:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     1
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
     3
	      All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     4
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     5
 This software is furnished under a license and may be used
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     6
 only in accordance with the terms of that license and with the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     8
 be provided or otherwise made available to, or used by, any
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     9
 other person.  No title to or ownership of the software is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    10
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    11
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    12
"{ Package: 'stx:libview2' }"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    13
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    14
Model subclass:#ApplicationModel
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    15
	instanceVariableNames:'builder resources device masterApplication'
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
    16
	classVariableNames:'DefaultLabels DefaultVisuals RecentlyOpenedApplications'
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    17
	poolDictionaries:''
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    18
	category:'Interface-Framework'
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    19
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    20
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    21
ApplicationModel class instanceVariableNames:'ClassResources'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    22
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    23
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    24
 No other class instance variables are inherited by this class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    25
"
1350
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    26
!
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    27
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    28
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    29
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
    30
copyright
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    31
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    32
 COPYRIGHT (c) 1995 by Claus Gittinger
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    33
	      All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    34
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    35
 This software is furnished under a license and may be used
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    36
 only in accordance with the terms of that license and with the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    38
 be provided or otherwise made available to, or used by, any
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    39
 other person.  No title to or ownership of the software is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    40
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    41
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    42
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    43
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    44
documentation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    45
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    46
    Since many ST-80 classes are subclasses of ApplicationModel, this class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    47
    is provided here to allow easier porting of ST-80 code.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    48
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    49
    It does not (currently) provide all functionality and is NOT
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    50
    compatible to the corresponding ST80 class; therefore, manual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    51
    changes have to be made to get those applications to run under ST/X.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    52
    (but at least, this enables you to fileIn that code and have a superclass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    53
     for them)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    54
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    55
    As time goes by, ST/X applications are going to be converted to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    56
    become subclasses of this abstract class - see Launcher for a
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    57
    first concrete example.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    58
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    59
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    60
    ApplicationModel is prepared to build a view from a windowSpec, as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    61
    created by the windowBuilder. If your subclass does not provide such
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    62
    a spec, you should at least redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    63
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    64
        #openInterface   - to create a topview and open it
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    65
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    66
    you may want to redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    67
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    68
        #closeRequest    - to catch window closing
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    69
        #focusSequence   - to define a sequence for focus-stepping
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    70
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    71
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    72
    Once the interfaceBuilder is finished & released, subclasses can
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    73
    alternatively provide the spec via a #windowSpec method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    74
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    75
    The classResources have been put into this class to allow ST/X
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    76
    applications (which used to be subclasses of StandardSystemView)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    77
    to migrate smoothly into ApplicationModels (which is better design ...).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    78
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    79
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    80
    [Instance variables:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    81
        resources    ResourcePack       language string translation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    82
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    83
        builder      WindowBuilder      a builder who knows how to create
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    84
                                        a window hierarchy from a specification
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    85
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    86
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    87
    Notice: this class was implemented using protocol information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    88
    from alpha testers and PD code - it may not be complete or compatible to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    89
    the corresponding ST-80 class. If you encounter any incompatibilities,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    90
    please forward a note to the ST/X team.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    91
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    92
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    93
    [author:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    94
        Claus Gittinger
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    95
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    96
    [see also:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    97
        StandardSystemView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    98
        WindowGroup DeviceWorkstation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    99
"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   100
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   101
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   102
howToDealWithMultipleApplicationInstances
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   103
"
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   104
    The following relates to StandAlone applications (i.e. compiled exe's) only.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   105
    If the user attempts to open another of the applications documents (after the first instance
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   106
    of the application has already been opened), it is sometimes required to notify the first
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   107
    application about this and to ask it to open an extra window on the second-clicked document.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   108
    In other words: to get another of the first instances' windows instead of opening a window
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   109
    by the second application.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   110
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   111
    This is implemented via the following mechanism (see StandaloneStartup):
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   112
        the first application instance leaves the information about its existence somewhere
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   113
            (under win32: in the registry, the window-ID of its main window is remembered;
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   114
             under unix, its stored into a locked file).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   115
        a mutex is created to prevent a race on this informationduring startup
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   116
            (under win32: a mutex proper; under unix, the above locked file will do)
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   117
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   118
    when the app is started the second time, it will not be able to aquire the mutex (and therefore
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   119
    knows, that its the second instance). It will then send an event-message (win32: via copyData;
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   120
    unix. via sendClientEvent), to the first instance and pass the fileName of the document which
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   121
    is to be opened. The first instance receives this event and opens another window for it.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   122
    The second instance simply exits and stops execution.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   123
    This guarantees that only one instance of an application is executing (if desired).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   124
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   125
    The implementation is found in:
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   126
        StandaloneStartup:
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   127
            checkForAndExitIfAnotherApplicationInstanceIsRunning
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   128
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   129
        here:
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   130
            processOpenPathCommand:aFilename
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   131
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   132
    By default, the event is ignored - subclasses which want to support that behavior MUST
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   133
    redefine processOpenPathCommand: in ApplicationModel and also make sure that
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   134
    checkForAndExitIfAnotherApplicationInstanceIsRunning is called for in StandaloneStartup.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   135
            
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   136
"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   137
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   138
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   139
!ApplicationModel class methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   140
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   141
initialize 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   142
    self == ApplicationModel ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   143
        Smalltalk addDependent:self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   144
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   145
    DefaultLabels isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   146
        DefaultLabels := IdentityDictionary new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   147
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   148
    DefaultVisuals isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   149
        DefaultVisuals := IdentityDictionary new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   150
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   151
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   152
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   153
     ApplicationModel initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   154
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   155
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   156
    "Modified: 28.1.1997 / 12:31:38 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   157
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   158
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   159
!ApplicationModel class methodsFor:'instance creation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   160
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   161
new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   162
    "return a new initialized instance"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   163
1977
abd5df24333e Make sure to return the new instance in #new (and not the return value
Stefan Vogel <sv@exept.de>
parents: 1972
diff changeset
   164
    ^ self basicNew basicInitialize; initialize; yourself.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   165
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   166
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   167
onDevice:aDevice
1828
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   168
    "return a new initialized instance, which shall open its interface on aDevice."
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   169
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   170
    ^ (super basicNew basicInitialize setDevice:aDevice) initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   171
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   172
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   173
!ApplicationModel class methodsFor:'accessing'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   174
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   175
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   176
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   177
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   178
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   179
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   180
!ApplicationModel class methodsFor:'active help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   181
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   182
flyByHelpSpec
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   183
    "default is: no help-spec (should be redefined by concrete class if help is wanted)."
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   184
2569
4ea35689e2df flyByHelpSpec -> helpSpec
fm
parents: 2568
diff changeset
   185
    ^ self helpSpec
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   186
!
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   187
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   188
helpSpec
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   189
    "default is: no help-spec (should be redefined by concrete class if help is wanted)."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   190
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   191
    ^ IdentityDictionary new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   192
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   193
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   194
!ApplicationModel class methodsFor:'bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   195
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   196
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   197
    "sent by the builder to ask for an actionBlock for
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   198
     a Button. The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   199
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   200
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   201
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   202
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   203
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   204
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   205
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   206
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   207
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   208
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   209
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   210
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   211
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   212
    "sent by the builder to ask for an actionBlock for
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   213
     a Button which passes a value to the actionMethod. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   214
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   215
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   216
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   217
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   218
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   219
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   220
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   221
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   222
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   223
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   224
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   225
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   226
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   227
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   228
    "sent by the builder to ask for an aspect (a data model).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   229
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   230
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   231
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   232
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   233
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   234
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   235
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   236
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   237
    ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   238
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   239
    "/ ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   240
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   241
    "Modified: / 27.10.1997 / 13:43:12 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   242
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   243
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   244
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   245
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   246
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   247
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   248
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   249
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   250
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   251
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   252
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   253
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   254
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   255
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   256
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   257
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   258
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   259
colorFor:aSymbol
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   260
    "sent by the builder to ask for an application provided color.
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   261
     The argument, aKey comes from an UI-spec
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   262
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   263
     Here, a corresponding message is sent to myself,
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   264
     which ought to be defined in the application subclass.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   265
     Alternatively, a subclass may redefine this method, to provide
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   266
     holders from a Dictionary or whatever.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   267
     Typically, a color is returned there."
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   268
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   269
    (self respondsTo:aSymbol) ifTrue:[
2615
2649ce8f0ea4 changed #colorFor: - get colors value, in case it is a ValueHolder
Stefan Vogel <sv@exept.de>
parents: 2609
diff changeset
   270
        ^ (self perform:aSymbol) value.
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   271
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   272
2481
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   273
    "fall back to a possibly well defined color name"
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   274
    ^ Color name:aSymbol ifIllegal:nil.
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   275
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   276
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   277
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   278
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   279
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   280
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   281
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   282
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   283
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   284
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   285
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   286
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   287
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   288
    (self respondsTo:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   289
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   290
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   291
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   292
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   293
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   294
fontFor:aSymbol
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   295
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   296
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   297
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   298
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   299
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   300
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   301
     holders from a Dictionary or whatever.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   302
     Typically, a font is returned there."
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   303
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   304
    (self respondsTo:aSymbol) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   305
        ^ self perform:aSymbol.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   306
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   307
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   308
"/    "fall back to a well defined font name"
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   309
"/    (Font respondsTo:aSymbol) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   310
"/        ^ Font perform:aSymbol.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   311
"/    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   312
    ^ nil
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   313
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   314
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   315
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   316
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   317
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   318
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   319
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   320
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   321
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   322
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   323
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   324
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   325
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   326
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   327
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   328
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   329
    app isNil ifTrue:[^ nil].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   330
    (app respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   331
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   332
    ].
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   333
    ^ app labelAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   334
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   335
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   336
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   337
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   338
     holder for a list.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   339
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   340
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   341
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   342
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   343
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   344
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   345
     Typically, a list-holding model (SelectionInList) is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   346
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   347
    |app|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   348
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   349
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   350
    app notNil ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   351
        (app respondsTo:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   352
            ^ app perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   353
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   354
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   355
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   356
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   357
    "Modified: 4.3.1997 / 00:53:03 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   358
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   359
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   360
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   361
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   362
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   363
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   364
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   365
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   366
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   367
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   368
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   369
     Typically, a menu or a menu-holding valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   370
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   371
    ^ self application perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   372
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   373
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   374
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   375
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   376
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   377
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   378
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   379
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   380
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   381
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   382
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   383
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   384
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   385
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   386
    ^ self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   387
        specificationFor:aKey 
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   388
        application:self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   389
        onDevice:nil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   390
!
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   391
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   392
specificationFor:aKey application:app onDevice:deviceOrNil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   393
    "sent by the builder to ask for an application provided
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   394
     specification for a subcanvas or subspecification.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   395
     The argument, aKey comes from an UI-spec
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   396
     for a subcanvases #specification property (minorKey).
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   397
     Here, a corresponding message is sent to myself,
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   398
     which ought to be defined in the application subclass.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   399
     Alternatively, a subclass may redefine this method, to provide
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   400
     interfaceSpecifications from a Dictionary or whatever.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   401
     Typically, an interfaceSpecification is returned there."
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   402
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   403
    |displayDevice displayDeviceType modifiedKey appClass|
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   404
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   405
    "/ this code is so ugly...
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   406
    "/ translate the specs name, if the display device type is different
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   407
    "/ for example, if the type is pda, the xxxSpec_pda spec will be used.
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   408
    displayDevice := deviceOrNil.
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   409
    displayDevice isNil ifTrue:[
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   410
        displayDevice := Screen current.
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   411
        displayDevice isNil ifTrue:[
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   412
            displayDevice := Screen default.
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   413
        ]
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   414
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   415
    displayDevice notNil ifTrue:[
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   416
        displayDeviceType := displayDevice deviceType.
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   417
        displayDeviceType notNil ifTrue:[
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   418
            modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   419
            modifiedKey notNil ifTrue:[
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   420
                (app respondsTo:modifiedKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   421
                    ^ app perform:modifiedKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   422
                ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   423
                app isBehavior ifFalse:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   424
                    appClass := app application.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   425
                    (appClass respondsTo:modifiedKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   426
                        ^ appClass perform:modifiedKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   427
                    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   428
                ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   429
            ]
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   430
        ]
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   431
    ].
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   432
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   433
    app isBehavior ifFalse:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   434
        (app respondsTo:aKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   435
            ^ app perform:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   436
        ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   437
        appClass := app application.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   438
        (appClass respondsTo:aKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   439
            ^ appClass perform:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   440
        ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   441
        ^ app masterApplication specificationFor:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   442
    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   443
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   444
    ^ app perform:aKey
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   445
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   446
    "Modified: / 18-07-2011 / 09:28:15 / cg"
1115
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   447
!
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   448
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   449
subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   450
    "sent by subCanvas to ask for an application inside itself. 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   451
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   452
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   453
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   454
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   455
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   456
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   457
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   458
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   459
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   460
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   461
    (app respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   462
        ^ app perform:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   463
    ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   464
    ^ nil
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   465
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   466
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   467
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   468
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   469
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   470
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   471
     for a widgets #label property, if LabelIsImage is turned on.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   472
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   473
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   474
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   475
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   476
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   477
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   478
    |app|
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   479
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   480
    app := self application.
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   481
    (app respondsTo:aKey) ifTrue:[
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   482
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   483
    ].
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   484
    ^ app visualAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   485
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   486
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   487
!ApplicationModel class methodsFor:'change & update'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   488
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   489
update:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   490
    "flush resources on language changes"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   491
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   492
    something == #Language ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   493
        self flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   494
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   495
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   496
    "Created: 15.6.1996 / 15:13:29 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   497
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   498
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   499
!ApplicationModel class methodsFor:'defaults'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   500
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   501
defaultHttpServerPort
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   502
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   503
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   504
    ^ HTTPServer defaultPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   505
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   506
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   507
defaultIcon
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   508
    "default is: no icon (should be redefined by concrete class if an icon is wanted)."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   509
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   510
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   511
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   512
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   513
defaultIconForAboutBox
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   514
    "the icon to be shown in my about-this-app dialog"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   515
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   516
    ^ self defaultIcon
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   517
!
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   518
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   519
defaultServiceLinkName
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   520
    "old web server interface - remove me"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   521
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   522
    <resource: #obsolete>
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   523
    ^ '/portal'
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   524
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   525
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   526
labelAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   527
    "default is: no label (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   528
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   529
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   530
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   531
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   532
labelAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   533
    "default is: no label (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   534
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   535
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   536
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   537
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   538
labelAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   539
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   540
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   541
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   542
labels
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   543
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   544
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   545
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   546
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   547
visualAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   548
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   549
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   550
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   551
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   552
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   553
visualAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   554
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   555
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   556
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   557
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   558
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   559
visualAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   560
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   561
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   562
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   563
visuals
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   564
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   565
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   566
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   567
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   568
!ApplicationModel class methodsFor:'help'!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   569
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   570
aboutImage
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   571
    "bitmap image or nil for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   572
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   573
    ^ self defaultIcon
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   574
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   575
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   576
aboutThisApplicationLabel
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   577
    "label for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   578
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   579
    ^ 'About This Application'
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   580
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   581
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   582
aboutThisApplicationText
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   583
    "text for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   584
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   585
    |rev clsRev msg|
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   586
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   587
    rev := ''.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   588
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   589
    (clsRev := self revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   590
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   591
    msg := '\' withCRs , self name asBoldText, rev.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   592
    ^ msg
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   593
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   594
    "Created: / 13.11.2001 / 12:28:36 / cg"
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   595
!
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   596
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   597
documentationPath
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   598
    |packageDir|
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   599
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   600
    packageDir := Smalltalk getPackageDirectoryForPackage:(self package).
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   601
    packageDir isNil ifTrue:[
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   602
        packageDir := Filename defaultDirectory
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   603
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   604
    #(
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   605
        'documentation'
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   606
        'doc'
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   607
    ) do:[:subDir |
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   608
        (packageDir construct:subDir) exists ifTrue:[
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   609
            ^ packageDir construct:subDir
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   610
        ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   611
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   612
    ^ packageDir construct:'doc'
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   613
! !
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   614
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   615
!ApplicationModel class methodsFor:'history'!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   616
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   617
forgetRecentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   618
    RecentlyOpenedApplications := nil
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   619
!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   620
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   621
recentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   622
    ^ RecentlyOpenedApplications ? #()
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   623
!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   624
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   625
rememberRecentlyOpenedApplication
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   626
    RecentlyOpenedApplications isNil ifTrue:[
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   627
        RecentlyOpenedApplications := OrderedCollection new.
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   628
    ].
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   629
    RecentlyOpenedApplications remove:(self name) ifAbsent:[].
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   630
    RecentlyOpenedApplications addFirst:(self name).
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   631
! !
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   632
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   633
!ApplicationModel class methodsFor:'private'!
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   634
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   635
selfResponsibleFor:aKey
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   636
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   637
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   638
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   639
    ^ self respondsTo:aKey
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   640
! !
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   641
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   642
!ApplicationModel class methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   643
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   644
interfaceSpecFor:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   645
    "return an interface spec"
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   646
    
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   647
    |specOrSpecArray|
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   648
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   649
    specOrSpecArray := self application specificationFor:aSelector.
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   650
    specOrSpecArray isNil ifTrue:[^ nil].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   651
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   652
    "/ app could already return a decoded spec
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   653
    specOrSpecArray isCollection ifFalse:[^ specOrSpecArray].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   654
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   655
    "/ app returns a literal array
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   656
    specOrSpecArray class missingClassInLiteralArrayErrorSignal
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   657
        handle:[:ex |
2295
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   658
            |clsInMyNamespace className|
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   659
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   660
            className := ex parameter.
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   661
            className isSymbol ifTrue:[
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   662
                "retry with my nameSpace"
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   663
                clsInMyNamespace := self nameSpace at:className.
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   664
                clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   665
            ].
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   666
            self warn:ex description.
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   667
            ex proceedWith:nil
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   668
        ]
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   669
        do:[
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   670
            ^ UISpecification from:specOrSpecArray
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   671
        ]
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   672
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   673
    "Modified: / 25-07-2010 / 10:36:53 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   674
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   675
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   676
isVisualStartable
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   677
    "return true, if this application can be started via #open.
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   678
     (to allow start of a change browser via double-click in the browser)"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   679
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   680
    (self == ApplicationModel) ifTrue:[^ false "I am abstract"].
1556
388922a9c6eb implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   681
    ((self respondsTo:#open) or:[self class includesSelector:#openInterface]) ifFalse:[^ false].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   682
"/    (self respondsTo:#windowSpec) ifFalse:[^ false].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   683
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   684
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   685
    "Created: / 27.10.1997 / 16:38:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   686
    "Modified: / 14.3.1998 / 16:30:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   687
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   688
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   689
!ApplicationModel class methodsFor:'resources'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   690
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   691
classResources
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   692
    "if not already loaded, get the classes resourcePack and return it"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   693
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   694
    ClassResources isNil ifTrue:[
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   695
        ClassResources := super classResources.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   696
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   697
    ^ ClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   698
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   699
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   700
classResources:aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   701
    "allow setting of the classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   702
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   703
    ClassResources := aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   704
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   705
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   706
flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   707
    "flush all classes resource translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   708
     Needed after a resource file / language setting has changed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   709
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   710
    ResourcePack flushCachedResourcePacks.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   711
    self flushClassResources.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   712
    self allSubclassesDo:[:aClass |
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   713
        aClass flushClassResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   714
    ].
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   715
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   716
    WindowGroup scheduledWindowGroups
2445
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   717
        do:[:wg | 
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   718
            |app| 
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   719
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   720
            (app := wg application) notNil ifTrue:[
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   721
                app initializeResources
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   722
            ]
5ace64945a9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2442
diff changeset
   723
        ]
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   724
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   725
    "Modified: / 13-09-2006 / 12:41:31 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   726
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   727
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   728
flushClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   729
    "flush classes resource string translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   730
     Needed whenever a resource file / language setting has changed"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   731
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   732
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   733
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   734
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   735
resources
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
   736
    "return the applications resources - 
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
   737
     that's a ResourcePack containing national language strings"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   738
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   739
    ^ self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   740
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   741
    "Created: / 19.5.1998 / 20:14:00 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   742
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   743
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   744
updateClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   745
    "update my classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   746
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   747
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   748
    self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   749
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   750
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   751
!ApplicationModel class methodsFor:'startup'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   752
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   753
open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   754
    "create an instance of the application and open its view"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   755
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   756
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   757
    ^ self new open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   758
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   759
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   760
     Launcher open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   761
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   762
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   763
    "Modified: 13.1.1997 / 20:54:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   764
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   765
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   766
openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   767
    "create an instance of the application and open its view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   768
     at some position."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   769
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   770
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   771
    ^ self new openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   772
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   773
    "Modified: 14.2.1997 / 20:28:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   774
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   775
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   776
openDialogInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   777
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   778
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   779
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   780
    ^ self openDialogInterface:anInterfaceSymbol withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   781
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   782
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   783
    "Created: 14.2.1997 / 20:33:10 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   784
    "Modified: 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   785
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   786
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   787
openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   788
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   789
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   790
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   791
    ^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   792
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   793
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   794
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   795
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   796
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   797
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   798
openDialogInterfaceSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   799
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   800
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   801
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   802
    ^ self new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   803
        openDialogInterfaceSpec:anInterfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   804
        withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   805
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   806
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   807
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   808
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   809
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   810
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   811
    ^ self new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   812
        openDialogInterfaceSpec:anInterfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   813
        withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   814
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   815
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   816
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   817
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   818
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   819
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   820
openDialogSpec:aSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   821
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   822
     specified by aSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   823
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   824
    ^ self openDialogSpec:aSpec withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   825
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   826
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   827
    "Modified: / 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   828
    "Created: / 20.5.1998 / 20:27:08 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   829
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   830
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   831
openDialogSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   832
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   833
     specified by the spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   834
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   835
    ^ self new 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   836
        openDialogSpec:aSpec 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   837
        withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   838
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   839
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   840
    "Modified: / 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   841
    "Created: / 20.5.1998 / 20:26:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   842
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   843
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   844
openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   845
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   846
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   847
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   848
    ^ self new openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   849
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   850
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   851
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   852
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   853
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   854
openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   855
    "create an instance of the application and open a view as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   856
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   857
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   858
    ^ self new openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   859
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   860
    "Modified: 14.2.1997 / 20:28:47 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   861
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   862
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   863
openLauncherOnInitializedDisplayNamed:displayName
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   864
    |display app wsClass|
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   865
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   866
    wsClass := Smalltalk classNamed:#XWorkstation.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   867
    wsClass isNil ifTrue:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   868
        self error:'XWorkstation has not been loaded' 
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   869
    ].        
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   870
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   871
    [
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   872
        display := wsClass newDispatchingFor:displayName.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   873
        display deviceIOErrorSignal handlerBlock:[:ex | 
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   874
            'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   875
            display errorPrintCR.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   876
            display brokenConnection.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   877
        ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   878
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   879
        Screen currentScreenQuerySignal answer:display do:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   880
            Screen default isNil ifTrue:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   881
                Smalltalk secureFileIn:'keyboard.rc'.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   882
                "/ Smalltalk secureFileIn:'display.rc'.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   883
                display buttonTranslation:#(1 2 2 4 5 6 7).
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   884
                Screen default:display.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   885
            ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   886
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   887
            app := NewLauncher new openAndWaitUntilVisible.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   888
            app windowGroup isNil ifTrue:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   889
                "terminate event processor on error"
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   890
                display stopDispatch.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   891
                self error:'Cannot open'.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   892
            ] ifFalse:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   893
                app windowGroup process addExitAction:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   894
                    "reset the default display"
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   895
                    Screen default == display ifTrue:[
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   896
                        Screen default:nil.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   897
                    ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   898
                ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   899
            ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   900
        ]
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   901
    ] on:Screen deviceOpenErrorSignal do:[:ex|
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   902
        self error:('Cannot connect to display: <1s><br><2s>' 
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   903
                        expandMacrosWith:displayName with:ex description).
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   904
    ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   905
    ^ app
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   906
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   907
    "Created: / 01-06-2010 / 11:23:52 / sr"
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   908
!
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
   909
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   910
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   911
    "create an instance of the application and open its view modal"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   912
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   913
    ^ self new openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   914
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   915
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   916
openOn:anApplicationModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   917
    "send an open message to the argument, anApplicationModel.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   918
     I dont really understand what this method is useful for ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   919
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   920
    ^ anApplicationModel open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   921
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   922
    "Modified: 13.1.1997 / 20:55:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   923
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   924
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   925
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   926
    "create an instance of the application and open its view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   927
     on ANOTHER device. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   928
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   929
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   930
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   931
    Screen currentScreenQuerySignal 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   932
        answer:aDevice
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   933
        do:[
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   934
            ^ (self onDevice:aDevice) open
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   935
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   936
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   937
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   938
     Launcher openOnDevice:Display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   939
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   940
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   941
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   942
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   943
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   944
openOnXScreenNamed:aScreenName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   945
    "create an instance of the application and open its view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   946
     on some X display screen. The argument aScreenName must be 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   947
     a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0').
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   948
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   949
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   950
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   951
    |newDevice|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   952
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   953
    [
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   954
        newDevice := XWorkstation newDispatchingFor:aScreenName.
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   955
    ] on:Screen deviceOpenErrorSignal do:[:ex|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   956
        self warn:'Could not open display: ' , aScreenName.
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   957
        ^ self
995
63d1b9ce554b Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents: 983
diff changeset
   958
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   959
    ^ self openOnDevice:newDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   960
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   961
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   962
     Launcher openOnXScreenNamed:'sgi:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   963
     Launcher openOnXScreenNamed:'foo:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   964
     NewLauncher openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   965
     NewLauncher openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   966
     SystemBrowser openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   967
     SystemBrowser openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   968
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   969
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   970
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   971
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   972
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   973
openWithSpec:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   974
    "ST80 compatibility:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   975
     mhmh - what is the difference to #openInterface ?"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   976
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   977
    ^ self openInterface:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   978
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   979
    "Modified: 29.8.1997 / 01:16:52 / cg"
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
   980
! !
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
   981
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
   982
!ApplicationModel class methodsFor:'startup-web applications'!
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   983
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   984
initialPageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   985
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   986
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   987
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   988
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   989
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   990
pageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   991
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   992
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   993
    ^ self windowSpec
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   994
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   995
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   996
pageSpecs
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   997
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   998
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   999
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1000
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1001
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1002
startAsWebService
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1003
    "this is not yet a public interface. For internal exept use only.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1004
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1005
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1006
     Answer the webService."
2604
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1007
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1008
    ^ self startAsWebService:(self webServiceLinkName)
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1009
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1010
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1011
     self startAsWebService
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1012
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1013
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1014
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1015
startAsWebService:linkName
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1016
    "this is not yet a public interface. For internal exept use only.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1017
     Start a web service for myself on link, an URL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1018
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1019
     Answer the webService.
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1020
     Start a HTTP server, if not already running"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1021
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1022
    ^ HTTPPortalService 
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1023
        startWithApplication:self 
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1024
        link:linkName
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1025
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1026
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1027
     self startAsWebService:'hello'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1028
     UBS::UBSUsecase startAsWebService:'uuu'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1029
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1030
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1031
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1032
startAsWebService:linkName inServer:httpServer
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1033
    "this is not yet a public interface. For internal exept use only.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1034
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1035
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1036
     Answer the webService.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1037
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1038
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1039
    ^ HTTPPortalService 
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1040
        startWithApplication:self 
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1041
        inServer:httpServer
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1042
        link:linkName
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1043
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1044
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1045
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1046
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1047
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1048
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1049
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1050
startAsWebService:linkName onPort:httpPort
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1051
    "this is not yet a public interface. For internal exept use only.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1052
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1053
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1054
     Answer the webService.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1055
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1056
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1057
    ^ HTTPPortalService 
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1058
        startWithApplication:self 
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1059
        inServer:(HTTPServer serverOnPort:httpPort)
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1060
        link:linkName
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1061
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1062
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1063
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1064
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1065
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1066
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1067
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1068
startAsWebService_old
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1069
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1070
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1071
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1072
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1073
    app := self basicNew.
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  1074
    app initializeAsWebServiceOnWebDevice:(WebApplicationDevice new).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1075
    app startAsWebService.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1076
    ^ app
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1077
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1078
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1079
     PortalTests::TestApplication1 startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1080
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1081
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1082
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1083
startInPortalService:aPortalServiceOrSession
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1084
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1085
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1086
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1087
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1088
    app := self basicNew.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1089
    app setDevice:(WebApplicationDevice new).
2544
2df3456aa8f7 initialization if I am a webService
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  1090
    app initialize.
2543
df4bb767ea8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2542
diff changeset
  1091
    app initializeResources.
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1092
    app startInPortalService:aPortalServiceOrSession.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1093
    ^ app.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1094
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1095
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1096
     PortalTests::TestApplication1
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1097
        startInPortalService:
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1098
            (HTTPPortalService allInstances select:[:s | s httpServer port = 8080]) first
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1099
    "
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1100
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1101
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1102
webServiceLinkName
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1103
    "the link name, under which instances of myself are found in the httpServer"
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1104
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1105
    "/ typically, redefined as:
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1106
    ^ self name asLowercaseFirst
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1107
    "/ or
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1108
    "/  ^ 'ubs'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1109
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1110
"/    ^ self subclassResponsibility
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1111
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1112
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1113
!ApplicationModel methodsFor:'accessing'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1114
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1115
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1116
    "application knows about interfaceSpecs, menuSpecs etc.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1117
     Usually this is my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1118
     This may be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1119
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1120
    ^ self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1121
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1122
    "Modified: / 5.2.1998 / 00:45:21 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1123
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1124
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1125
builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1126
    "return the applications builder; this one has more information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1127
     about views, components etc."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1128
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1129
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1130
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1131
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1132
builder:aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1133
    "set the applications builder. Normally, you should not set it
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1134
     directly, but depend on the default builder, as created when the application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1135
     was created."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1136
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1137
    builder := aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1138
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1139
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1140
componentAt:name
2747
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1141
    "return a component identified by its name"
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1142
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1143
    ^ self builder componentAt:name
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1144
!
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1145
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1146
device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1147
    device isNil ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1148
        self isWebService ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1149
            device := WebApplicationDevice new
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1150
        ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1151
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1152
    ^ device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1153
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1154
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1155
masterApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1156
    "return the value of the instance variable 'masterApplication' (automatically generated)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1157
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1158
    ^ masterApplication
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1159
!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1160
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1161
masterApplication:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1162
    "set the value of the instance variable 'masterApplication' (automatically generated)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1163
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1164
    something == self ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1165
        self error:'an application cannot be its own masterApplication' mayProceed:true.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1166
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1167
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1168
    masterApplication := something.
2566
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1169
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1170
    "/ ensure that the device is compatible.
2567
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1171
    masterApplication notNil ifTrue:[
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1172
        device := masterApplication device.
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1173
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1174
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1175
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1176
resources
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1177
    "return the applications resources - 
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1178
     that's a ResourcePack containing national language strings"
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1179
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1180
    resources isNil ifTrue:[
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1181
        masterApplication notNil ifTrue:[
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1182
            ^ masterApplication resources
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1183
        ]
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1184
    ].
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1185
    resources isNil ifTrue:[
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1186
        ^ ResourcePack new
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1187
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1188
    ^ resources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1189
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1190
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1191
resources:aResourcePack
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1192
    "set the applications resources - usually this is done automatically,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1193
     except for manually built dialogs"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1194
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1195
    resources := aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1196
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1197
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1198
window
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1199
    "return my topWindow - or nil, if I have no window (yet)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1200
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1201
    |win|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1202
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1203
    builder isNil ifTrue:[^ nil].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1204
    (win := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1205
        ^ win
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1206
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1207
    masterApplication notNil ifTrue:[
1442
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  1208
        masterApplication ~~ self ifTrue:[
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  1209
            "/ is that true ?
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  1210
            ^ masterApplication window
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
  1211
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1212
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1213
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1214
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1215
    "Modified: / 18.9.1998 / 15:18:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1216
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1217
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1218
window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1219
    "set my topWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1220
     As a side effect, this creates a dummy builder if non has yet
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1221
     been built. This prevents non-GUI-Painter apps from failing later,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1222
     when the builder is accessed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1223
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1224
    builder isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1225
        self createBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1226
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1227
    builder window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1228
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1229
    "Created: 18.4.1996 / 14:55:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1230
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1231
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1232
windowGroup 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1233
    "return the applications windowGroup"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1234
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1235
    |w|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1236
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1237
    builder notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1238
        (w := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1239
            ^ w windowGroup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1240
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1241
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1242
    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1243
        ^ masterApplication windowGroup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1244
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1245
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1246
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1247
    "Modified: / 7.9.1998 / 23:37:00 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1248
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1249
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1250
!ApplicationModel methodsFor:'binding access'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1251
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1252
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1253
    "sent by the builder to ask for an actionBlock for
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1254
     a Button. The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1255
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1256
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1257
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1258
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1259
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1260
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1261
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1262
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1263
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1264
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1265
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1266
            ^ masterApplication actionFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1267
        ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1268
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1269
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1270
    ^ MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1271
    "/ ^ [self perform:aKey]   "/ could use:  MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1272
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1273
    "Modified: / 28-07-2010 / 11:56:49 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1274
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1275
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1276
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1277
    "sent by the builder to ask for an actionBlock for
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1278
     a Button which passes a value. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1279
     The argument, aKey comes from an UI-spec for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1280
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1281
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1282
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1283
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1284
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1285
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1286
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1287
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1288
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1289
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1290
            ^ masterApplication actionFor:aKey withValue:aValue
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1291
        ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1292
    ].
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1293
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1294
"/ sigh - too many senders of #isBlock around...
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1295
"/    ^ MessageSend receiver:self selector:aKey argument:aValue
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1296
     ^ [self perform:aKey with:aValue]
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1297
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1298
    "Modified: / 28-07-2010 / 11:56:42 / cg"
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1299
    "Modified: / 30-07-2010 / 10:40:35 / sr"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1300
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1301
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1302
actionFor:aKey withValue:value1 withValue:value2
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1303
    "sent by the builder to ask for an actionBlock for a Button which passes two values. 
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1304
     The argument, aKey comes from an UI-spec for a buttons #action property.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1305
     Here, a corresponding message is sent to myself,
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1306
     which ought to be defined in the application subclass.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1307
     Alternatively, a subclass may redefine this method, to provide
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1308
     actionBlocks from a Dictionary or whatever.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1309
     Typically, a block is returned there."
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1310
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1311
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1312
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1313
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1314
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1315
            ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1316
        ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1317
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1318
    ^ [self perform:aKey with:value1 with:value2]
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1319
!
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1320
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1321
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1322
    "sent by the builder to ask for an aspect (a data model).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1323
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1324
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1325
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1326
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1327
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1328
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1329
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1330
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1331
    aKey isNil ifTrue:[ self error:'nil aspect key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1332
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1333
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1334
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1335
            ^ masterApplication aspectFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1336
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1337
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1338
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1339
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1340
    "Modified: / 18.6.1998 / 20:33:23 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1341
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1342
1742
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1343
aspectOrNil:aKey forSubApplication:aSubApp
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1344
    ^ nil
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1345
!
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1346
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1347
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1348
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1349
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1350
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1351
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1352
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1353
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1354
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1355
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1356
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1357
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1358
    aKey isNil ifTrue:[ self error:'nil client key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1359
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1360
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1361
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1362
            ^ masterApplication clientFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1363
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1364
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1365
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1366
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1367
    "Modified: / 18.6.1998 / 20:33:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1368
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1369
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1370
colorFor:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1371
    "sent by the builder to ask for an application provided color.
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1372
     The argument, aKey comes from an UI-spec
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1373
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1374
     Here, a corresponding message is sent to myself,
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1375
     which ought to be defined in the application subclass.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1376
     Alternatively, a subclass may redefine this method, to provide
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1377
     holders from a Dictionary or whatever.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1378
     Typically, a color is returned there."
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1379
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1380
    (self respondsTo:aKey) ifTrue:[
2615
2649ce8f0ea4 changed #colorFor: - get colors value, in case it is a ValueHolder
Stefan Vogel <sv@exept.de>
parents: 2609
diff changeset
  1381
        ^ (self perform:aKey) value
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1382
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1383
    (self class respondsTo:aKey) ifTrue:[
2615
2649ce8f0ea4 changed #colorFor: - get colors value, in case it is a ValueHolder
Stefan Vogel <sv@exept.de>
parents: 2609
diff changeset
  1384
        ^ (self class perform:aKey) value
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1385
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1386
    masterApplication notNil ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1387
        ^ masterApplication colorFor:aKey
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1388
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1389
    ^ self class colorFor:aKey.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1390
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1391
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1392
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1393
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1394
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1395
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1396
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1397
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1398
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1399
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1400
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1401
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1402
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1403
    aKey isNil ifTrue:[ self error:'nil component key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1404
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1405
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1406
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1407
            ^ masterApplication componentFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1408
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1409
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1410
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1411
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1412
    "Modified: / 18.6.1998 / 20:33:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1413
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1414
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1415
fontFor:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1416
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1417
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1418
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1419
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1420
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1421
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1422
     holders from a Dictionary or whatever.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1423
     Typically, a font is returned there."
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1424
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1425
    (self respondsTo:aKey) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1426
        ^ self perform:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1427
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1428
    (self class respondsTo:aKey) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1429
        ^ self class perform:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1430
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1431
    masterApplication notNil ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1432
        ^ masterApplication fontFor:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1433
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1434
    ^ self class fontFor:aKey.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1435
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1436
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1437
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1438
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1439
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1440
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1441
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1442
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1443
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1444
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1445
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1446
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1447
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1448
    aKey isNil ifTrue:[ self error:'nil label key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1449
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1450
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1451
        (self respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1452
            ^ masterApplication labelFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1453
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1454
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1455
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1456
    (self respondsTo:aKey) ifFalse:[
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1457
        (self class respondsTo:aKey) ifTrue:[
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1458
            ^ self class perform:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1459
        ].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1460
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1461
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1462
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1463
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1464
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1465
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1466
     holder for a list (for example, a popUpLists list).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1467
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1468
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1469
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1470
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1471
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1472
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1473
     Typically, a list-holding model (SelectionInList) is returned there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1474
     If the instance does not provide a value, a corresponding aspect
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1475
     is asked for. If that fails as well, the app class is asked as a last
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1476
     chance."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1477
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1478
    |a|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1479
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1480
    aKey isNil ifTrue:[ self error:'nil list key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1481
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1482
    a := self aspectFor:aKey.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1483
    a notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1484
        ^ a
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1485
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1486
    ^ self application listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1487
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1488
    "Modified: / 18.6.1998 / 20:33:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1489
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1490
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1491
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1492
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1493
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1494
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1495
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1496
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1497
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1498
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1499
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1500
     Typically, a menu or a menu-holding valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1501
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1502
    aKey isNil ifTrue:[ self error:'nil menu key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1503
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1504
    masterApplication notNil ifTrue:[
2829
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1505
        (self respondsTo:aKey) ifFalse:[
e23fc319064d code deobfuscated:
Claus Gittinger <cg@exept.de>
parents: 2828
diff changeset
  1506
            (self class respondsTo:aKey) ifFalse:[
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1507
                ^ masterApplication clientFor:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1508
            ]
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1509
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1510
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1511
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1512
    (self respondsTo:aKey) ifFalse:[
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1513
        (self class respondsTo:aKey) ifTrue:[
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1514
            ^ self class perform:aKey
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1515
        ].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1516
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1517
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1518
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1519
    "Modified: / 18.6.1998 / 20:33:56 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1520
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1521
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1522
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1523
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1524
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1525
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1526
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1527
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1528
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1529
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1530
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1531
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1532
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1533
    ^ ApplicationModel
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1534
        specificationFor:aKey 
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1535
        application:self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1536
        onDevice:(self graphicsDevice)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1537
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1538
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1539
subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1540
    "sent by subCanvas to ask for an application inside itself. 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1541
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1542
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1543
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1544
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1545
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1546
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1547
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1548
     (self respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1549
         ^ self perform:aKey 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1550
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1551
     masterApplication notNil ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1552
         ^ masterApplication subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1553
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1554
     ^ nil.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1555
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1556
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1557
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1558
    "sent by the builder to ask for an application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1559
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1560
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1561
     for a widgets #label property, if LabelIsImage is turned on.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1562
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1563
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1564
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1565
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1566
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1567
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1568
    ^ self application visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1569
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1570
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1571
!ApplicationModel methodsFor:'binding access-help'!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1572
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1573
basicFlyByHelpTextForKey:aKey
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1574
    "flyByHelp interface: return some short help text for a key
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1575
     key is the symbol associated with some widget or menu item.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1576
     Return the original (english) text; needs to be translated as per language"
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1577
2930
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1578
    |helpSpecFromBindings helpText helpSpec "resourceArgs"|
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1579
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1580
    helpSpecFromBindings := self aspectFor:#helpSpec.
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1581
    helpSpecFromBindings notNil ifTrue:[
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1582
        helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1583
    ].
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1584
    helpText isNil ifTrue:[
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1585
        helpSpec := self flyByHelpSpec.
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1586
        helpSpec notNil ifTrue:[
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1587
            helpText := helpSpec at:aKey ifAbsent:nil.
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1588
        ].
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1589
    ].
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1590
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1591
    "/ new: allow for a collection (resource-key arg1 arg2...)
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1592
    helpText isNonByteCollection ifTrue:[
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1593
        helpText := helpText first.
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1594
"/        resourceArgs := helpText copyFrom:2.
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1595
    ].
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1596
    ^ helpText
2930
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1597
5f7129ba1255 changed: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2926
diff changeset
  1598
    "Modified: / 22-07-2011 / 10:47:35 / cg"
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1599
!
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1600
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1601
basicHelpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1602
    "activeHelp interface: return some help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1603
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1604
     Return the original (english) text; needs to be translated as per language"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1605
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1606
    |helpText helpSpec "resourceArgs"|
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1607
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1608
    helpSpec := self helpSpec.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1609
    helpSpec notNil ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1610
        helpText := helpSpec at:aKey ifAbsent:nil.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1611
    ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1612
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1613
    "/ new: allow for a collection (resource-key arg1 arg2...)
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1614
    helpText isNonByteCollection ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1615
        helpText := helpText first.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1616
"/        resourceArgs := helpText copyFrom:2.
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1617
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1618
    ^ helpText
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1619
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1620
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1621
flyByHelpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1622
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1623
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1624
    ^ self class flyByHelpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1625
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1626
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1627
flyByHelpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1628
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1629
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1630
    |key|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1631
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1632
    builder notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1633
        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1634
            ^ self flyByHelpTextForKey:key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1635
        ]
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1636
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1637
    masterApplication notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1638
        ^ masterApplication flyByHelpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1639
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1640
    ^ nil
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1641
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1642
    "Modified: / 31.7.1998 / 23:03:10 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1643
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1644
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1645
flyByHelpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1646
    "flyByHelp interface: return some short help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1647
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1648
     (from my flyByHelpSpec); return a language variant (if available)"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1649
2831
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1650
    |helpText translatedHelpText translatedKey|
2088
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
  1651
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
  1652
    helpText := self basicFlyByHelpTextForKey:aKey.
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  1653
    helpText isNil ifTrue:[
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1654
        masterApplication notNil ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1655
            "here we get an already translated helpText"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1656
            helpText := masterApplication flyByHelpTextForKey:aKey.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1657
        ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1658
        helpText isNil ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1659
            "there is no help text - resolve key from resources"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1660
            helpText := (self translateString:aKey) withCRs.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1661
        ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1662
        ^ helpText.
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1663
    ].
2849
c921b72b96d7 comment/format in: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2843
diff changeset
  1664
    "/ kludge to allow for dynamic translation by the application itself, avoiding the key translation below.
2753
f8c6eadde7bb changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
  1665
    helpText isBlock ifTrue:[
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1666
        ^ helpText value.
2753
f8c6eadde7bb changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
  1667
    ].
2831
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1668
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1669
    "get the translation"
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1670
    translatedHelpText := self translateString:helpText.
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1671
    translatedHelpText == helpText ifTrue:[
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1672
        "there is no translation in the resources - maybe there is one for the key?"
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1673
        translatedKey := self translateString:aKey.
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1674
        translatedKey ~~ aKey ifTrue:[
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1675
             translatedHelpText := translatedKey.
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1676
        ].
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1677
    ].
268d46d45ebd changed: #flyByHelpTextForKey:
Stefan Vogel <sv@exept.de>
parents: 2829
diff changeset
  1678
    ^ translatedHelpText withCRs.
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1679
2849
c921b72b96d7 comment/format in: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2843
diff changeset
  1680
    "Modified: / 24-07-2010 / 01:54:25 / cg"
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1681
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1682
2510
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1683
flyByHelpTextForKey:aKey row:aRowNr
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1684
    "Special interface for DataSet - get the active help text for a specific row"
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1685
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1686
    "Default: no row specific help"
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1687
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1688
    ^ self flyByHelpTextForKey:aKey.
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1689
!
491f20d60c08 Row specific active help (with DataSet)
Stefan Vogel <sv@exept.de>
parents: 2496
diff changeset
  1690
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1691
helpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1692
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1693
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1694
    ^ self class helpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1695
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1696
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1697
helpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1698
    "activeHelp interface: return some help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1699
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1700
    |key|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1701
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1702
    builder notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1703
        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1704
            ^ self helpTextForKey:key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1705
        ]
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1706
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1707
    masterApplication notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1708
        ^ masterApplication helpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1709
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1710
    ^ nil
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1711
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1712
    "Modified: / 31.7.1998 / 23:03:10 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1713
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1714
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1715
helpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1716
    "activeHelp interface: return some help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1717
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1718
     (from my helpSpec); return a language variant (if available)"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1719
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1720
    |helpText translatedHelpText translatedKey|
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1721
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1722
    helpText := self basicHelpTextForKey:aKey.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1723
    helpText isNil ifTrue:[
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1724
        masterApplication notNil ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1725
            "here we get an already translated helpText"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1726
            helpText := masterApplication helpTextForKey:aKey.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1727
        ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1728
        helpText isNil ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1729
            "there is no help text - resolve key from resources"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1730
            helpText := (self translateString:aKey) withCRs.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1731
        ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1732
        ^ helpText.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1733
2828
4c1b1b0e2814 changed: #helpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2824
diff changeset
  1734
"/        aKey isSymbol ifFalse:[
4c1b1b0e2814 changed: #helpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2824
diff changeset
  1735
"/            ^ nil
4c1b1b0e2814 changed: #helpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2824
diff changeset
  1736
"/        ].
2549
7c715b1cfadc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
  1737
"/        "/ mhmh - is this a good idea ?
7c715b1cfadc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
  1738
"/        "/ if someone already maps the flyByHelpTexts to the helpTexts
7c715b1cfadc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
  1739
"/        helpText := self flyByHelpTextForKey:aKey.
7c715b1cfadc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2547
diff changeset
  1740
"/        helpText notNil ifTrue:[ ^ helpText ].
2828
4c1b1b0e2814 changed: #helpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2824
diff changeset
  1741
        ^ nil.
4c1b1b0e2814 changed: #helpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2824
diff changeset
  1742
"/        ^ self resources string:'Sorry, no help for: %1' with:aKey "/ nil
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1743
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1744
2841
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1745
    "/ kludge to allow for dynamic translation by the application itself.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1746
    helpText isBlock ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1747
        ^ helpText value.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1748
    ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1749
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1750
    "get the translation"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1751
    translatedHelpText := self translateString:helpText.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1752
    translatedHelpText == helpText ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1753
        "there is no translation in the resources - maybe there is one for the key?"
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1754
        translatedKey := self translateString:aKey.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1755
        translatedKey ~~ aKey ifTrue:[
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1756
             translatedHelpText := translatedKey.
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1757
        ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1758
    ].
6a4dde15bfc8 changed:
Stefan Vogel <sv@exept.de>
parents: 2831
diff changeset
  1759
    ^ translatedHelpText withCRs.
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1760
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1761
    "Modified: / 4.2.2000 / 15:30:16 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1762
! !
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1763
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1764
!ApplicationModel methodsFor:'building'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1765
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1766
allButOpen
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1767
    "create my views from the windowSpec, but do not open the main window."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1768
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1769
    ^ self allButOpenInterface:(self defaultWindowSpecName).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1770
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1771
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1772
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1773
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1774
allButOpenFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1775
    "create my views but do not open the main window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1776
     The argument is a spec which defines the interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1777
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1778
    |window|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1779
2691
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1780
    window notNil ifTrue:[
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1781
        self error:'building twice (window is already built) ?' mayProceed:true.
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1782
    ].
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1783
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1784
"/ DISABLED; see comment in basicInitialize
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1785
"/
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1786
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1787
"/     here, we kludge a bit: up to now, the builder was an
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1788
"/     instance of the no-op WindowBuilder. Now, it becomes
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1789
"/     a UIBuilder ....
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1790
"/     This allows for ApplicationModels without a UIBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1791
"/     if not needed.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1792
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1793
"/    realBuilder := UIBuilder new.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1794
"/    builder := realBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1795
"/    builder application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1796
"/    builder bindings:builder bindings.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1797
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1798
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1799
        self createBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1800
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1801
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1802
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1803
    builder buildWindowFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1804
    window := builder window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1805
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1806
    window model:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1807
    (window respondsTo:#application:) ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1808
        window application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1809
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1810
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1811
    self showingHelp ifTrue: [ActiveHelp startFor: self].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1812
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1813
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1814
    "Modified: / 19.6.1998 / 03:35:31 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1815
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1816
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1817
allButOpenInterface:aSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1818
    "create my views but do not open the main window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1819
     The argument specifies a selector of a method,
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1820
     which when sent to myself should return a spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1821
     Notice, this returns the windowBuilder."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1822
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1823
    self allButOpenFrom:(self interfaceSpecFor:aSymbol).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1824
    ^ builder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1825
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1826
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1827
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1828
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1829
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1830
    "build a subcanvases spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1831
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1832
    |sameApp prevSpec prevSource|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1833
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1834
    aBuilder notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1835
        prevSpec := aBuilder spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1836
        prevSource := aBuilder source.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1837
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1838
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1839
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1840
        builder := aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1841
        aBuilder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1842
            self createBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1843
        ]
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1844
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1845
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1846
    aBuilder source:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1847
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1848
    "/ if the subcanvases appModel is NOT the same as
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1849
    "/ the topApp, it must be pre/post-built.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1850
    "/ Otherwise, we invoke pre/post-builtAsSubcanvas.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1851
    "/ which provides a hook for redefinition in concrete appModels.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1852
    "/ This avoids invoking pre/postBuild twice for subCanvases which
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1853
    "/ have the topApp as appModel.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1854
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1855
    sameApp := aBuilder application == aBuilder window topView application.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1856
    sameApp ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1857
        self preBuildAsSubcanvasWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1858
    ] ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1859
        self preBuildWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1860
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1861
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1862
    aBuilder buildFromSpec:specToBuild.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1863
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1864
    sameApp ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1865
        self postBuildAsSubcanvasWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1866
    ] ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1867
        self postBuildWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1868
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1869
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1870
    prevSpec notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1871
        "/ restore state in builder if original builder was used
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1872
        aBuilder spec:prevSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1873
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1874
    prevSource notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1875
        "/ restore state in builder if original builder was used
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1876
        aBuilder source:prevSource.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1877
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1878
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1879
    ^ aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1880
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1881
    "Created: / 18-06-1998 / 20:08:45 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1882
    "Modified: / 27-10-2006 / 11:45:25 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1883
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1884
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1885
buildSubCanvas:spec withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1886
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1887
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1888
    self buildSubCanvas:spec withMenu:false withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1889
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1890
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1891
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1892
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1893
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1894
    |specToBuild|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1895
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1896
    specToBuild := spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1897
    withMenuBoolean ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1898
        "/ subapps should not build the menu and other fullSpec stuff.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1899
        spec class == FullSpec ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1900
            specToBuild := spec component.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1901
        ]
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1902
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1903
    self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1904
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1905
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1906
!ApplicationModel methodsFor:'component manipulations'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1907
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1908
components:aSymbolOrArray do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1909
    "evaluate aBlock for all components listed aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1910
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1911
    |coll|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1912
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1913
    aSymbolOrArray isSymbol ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1914
        "/ a single components name
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1915
        coll := Array with:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1916
    ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1917
        coll := aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1918
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1919
    coll do:[:aSymbol |
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1920
        |component|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1921
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1922
        (component := self componentFor:aSymbol) isNil ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1923
            aBlock value:component
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1924
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1925
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1926
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1927
    "Modified: 26.3.1997 / 16:23:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1928
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1929
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1930
disable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1931
    "disable the components whose id's are aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1932
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1933
    self components:aSymbolOrArray do:[:comp | comp disable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1934
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1935
    "Modified: 14.2.1997 / 17:32:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1936
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1937
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1938
enable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1939
    "enables the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1940
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1941
    self components:aSymbolOrArray do:[:comp | comp enable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1942
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1943
    "Modified: 14.2.1997 / 17:32:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1944
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1945
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1946
invalidate:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1947
    "invalidates the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1948
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1949
    self components:aSymbolOrArray do:[:comp | comp invalidate]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1950
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1951
    "Modified: 14.2.1997 / 17:32:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1952
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1953
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1954
makeInvisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1955
    "makes the components whose id's are aSymbolOrArray invisible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1956
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1957
    self components:aSymbolOrArray do:[:comp | comp beInvisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1958
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1959
    "Modified: 14.2.1997 / 17:32:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1960
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1961
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1962
makeReadOnly:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1963
    "make all components identified by aSymbolOrArray read only
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1964
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1965
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1966
    self components:aSymbolOrArray do:[:comp | comp readOnly:true]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1967
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1968
    "Modified: 14.2.1997 / 17:36:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1969
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1970
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1971
makeVisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1972
    "makes the components whose id's are aSymbolOrArray visible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1973
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1974
    self components:aSymbolOrArray do:[:comp | comp beVisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1975
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1976
    "Modified: 14.2.1997 / 17:32:52 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1977
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1978
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1979
makeWritable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1980
    "make all components identified by aSymbolOrArray writable 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1981
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1982
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1983
    self components:aSymbolOrArray do:[:comp | comp readOnly:false]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1984
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1985
    "Created: 14.2.1997 / 17:36:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1986
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1987
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1988
!ApplicationModel methodsFor:'copying'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1989
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1990
postCopy
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1991
    builder := device := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1992
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1993
    "Created: / 19.4.1998 / 11:44:44 / cg"
2053
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1994
!
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1995
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1996
postDeepCopy
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1997
    builder := device := nil.
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1998
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1999
    "Created: / 19.4.1998 / 11:44:44 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2000
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2001
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2002
!ApplicationModel methodsFor:'delayed actions (enqueue)'!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2003
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2004
delayedUpdate:something with:aParameter from:changedObject
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2005
    "support for delayed updates - 
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2006
     subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:)
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2007
     must also redefine this method, and perform the actual update there."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2008
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2009
    ^ self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2010
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2011
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2012
enqueueDelayedAction:aBlock
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2013
    "This will enqueue a delayed action - the application-process will
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2014
     eventually execute aBlock.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2015
     Useful for synchronization"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2016
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2017
    ^ self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2018
        enqueueMessage:#value
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2019
        for:aBlock
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2020
        arguments:#().
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2021
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2022
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2023
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2024
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2025
enqueueDelayedUpdate:something with:aParameter from:changedObject
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2026
    "support for delayed updates - to be invoked from a concrete classes
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2027
     #update:with:from: method.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2028
     This will enqueue a delayed update, and resend #delayedUpdate:with:from:
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2029
     whenever the receiver is handling events.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2030
     Especially useful, if many updates arrive at high frequency, to avoid
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2031
     multiple redraws."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2032
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2033
    ^ self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2034
        enqueueMessage:#delayedUpdate:with:from:
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2035
        for:self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2036
        arguments:(Array 
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2037
                        with:something 
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2038
                        with:aParameter 
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2039
                        with:changedObject).
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2040
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2041
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2042
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2043
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2044
enqueueMessage:selector for:someone arguments:argList
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2045
    "enqueue a message to be sent to myself later, when my process
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2046
     is back in its eventLoop. Also, filter duplicates.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2047
     This is useful, to buffer redraws and avoid flicker due to multiple
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2048
     redraws (especially in browsers, when reacting on changeMessages resulting
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2049
     from changes made in other browsers)"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2050
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2051
    |window sensor|
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2052
2561
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2053
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2054
    self isWebService ifTrue:[
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2055
        self breakPoint:#sr.
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2056
        ^ self
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2057
    ].
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2058
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2059
    (window := self window) notNil ifTrue:[
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2060
        sensor := window sensor.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2061
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2062
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2063
    sensor isNil ifTrue:[
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2064
        "no window (yet or any longer)"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2065
        someone perform:selector withArguments:argList.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2066
        ^ self.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2067
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2068
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2069
    "/
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2070
    "/ if such a message is already in the queue, ignore it.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2071
    "/ Otherwise push it as an event, to be handled when my thread is
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2072
    "/ back in the event loop.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2073
    "/
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2074
    sensor synchronized:[
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2075
        (sensor hasEvent:selector for:someone withArguments:argList) ifFalse:[
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2076
            sensor pushUserEvent:selector for:someone withArguments:argList
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2077
        ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2078
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2079
2902
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2080
    "Created: / 26-02-2000 / 18:01:31 / cg"
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2081
    "Modified: / 23-03-2011 / 19:46:41 / cg"
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2082
! !
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2083
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2084
!ApplicationModel methodsFor:'drag & drop'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2085
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2086
canDropObjects:aCollectionOfDropObjects
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2087
    "drop manager asked if a drop is possible
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2088
     - should be redefined by apps which can do it, to return true"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2089
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2090
    ^ false
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2091
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2092
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2093
canDropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2094
    "drop manager asked if a drop is possible
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2095
     - should be redefined by apps which can do it, to return true"
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2096
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2097
    ^ self canDropObjects:aCollectionOfDropObjects 
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2098
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2099
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2100
canDropObjects:aCollectionOfDropObjects in:aComponent at:position
2405
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2101
    "drop manager asked if a drop is possible.
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2102
     Should be redefined by apps which can do it, to return true"
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2103
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2104
    ^ self canDropObjects:aCollectionOfDropObjects in:aComponent
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2105
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2106
    "Created: / 13-10-2006 / 15:52:20 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2107
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2108
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2109
dropObjects:aCollectionOfDropObjects
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2110
    "drop manager wants to drop.
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2111
     This is ony sent, if #canDrop: returned true.
2865
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2112
     Must be redefined in order for drop to work."
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2113
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2114
    ^ self subclassResponsibility
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2115
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2116
    "Created: / 13-10-2006 / 18:25:06 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2117
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2118
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2119
dropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2120
    "drop manager wants to drop.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2121
     This is ony sent, if #canDrop: returned true.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2122
     Must be redefine in order for drop to work."
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2123
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2124
    ^ self dropObjects:aCollectionOfDropObjects
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2125
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2126
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2127
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2128
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2129
    "drop manager wants to drop.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2130
     This is ony sent, if #canDrop:in: returned true.
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2131
     Can be redefined in apps which return true to #canDrop."
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2132
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2133
    ^ self dropObjects:aCollectionOfDropObjects in:aComponent
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2134
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2135
    "Created: / 13-10-2006 / 18:25:13 / cg"
2824
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2136
!
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2137
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2138
droppedFile:aFilename in:aComponent
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2139
    "ignored here - only sent by textView components, sometimes"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2140
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2141
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2142
!ApplicationModel methodsFor:'easy bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2143
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2144
registerInterestIn:aValueModel using:aSelectorOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2145
    "Register interest in a change in aValueModel using information in aSelectorOrArray.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2146
     aSelectorOrArray can be one of three things:  
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2147
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2148
            1) nil                  in which case no interest is registered
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2149
            2) a selector           in which case the receiver is understood to be self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2150
            3) an Array             in which case the size is two where the first element is the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2151
                                    message to be sent and the second element is the receiver."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2152
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2153
    aSelectorOrArray isNil ifTrue:[^ aValueModel].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2154
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2155
    (aSelectorOrArray isArray) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2156
        aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2157
    ] ifFalse: [
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2158
        aValueModel onChangeSend:aSelectorOrArray to:self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2159
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2160
    ^aValueModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2161
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2162
    "Modified: / 31.10.1997 / 18:19:44 / cg"
980
3764f680134d allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  2163
!
3764f680134d allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  2164
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2165
valueHolderFor:aSelector initialValue:anObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2166
    "Return a ValueHolder on anObject." 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2167
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2168
    ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2169
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2170
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2171
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2172
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2173
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2174
    "Return a ValueHolder on anObject.  aSelectorOrArrayOrNil is the change information 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2175
     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.  
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2176
     If it is a Symbol, then it is the change message and the interested object is understood
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2177
     to be the reciever.  If it is an Array, then the first element is the change message and 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2178
     the second element is the interested object. " 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2179
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2180
    |holder|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2181
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2182
    (builder bindings includesKey:aSelector) ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2183
        holder := ValueHolder with:anObject.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2184
        builder aspectAt:aSelector put:holder.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2185
        aSelectorOrArrayOrNil notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2186
            ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2187
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2188
        ^ holder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2189
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2190
    ^ builder aspectAt:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2191
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2192
    "Modified: / 21.5.1998 / 03:31:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2193
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2194
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2195
!ApplicationModel methodsFor:'forced actions'!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2196
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2197
doAcceptByReturnKey
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2198
    |acceptAction|
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2199
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2200
    builder notNil ifTrue:[
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2201
        acceptAction := builder bindingAt:#doAccept.
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2202
    ].
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2203
    acceptAction notNil ifTrue:[
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2204
        acceptAction value
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2205
    ] ifFalse:[
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2206
        self doAccept
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2207
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2208
!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2209
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2210
doCancelByEscapeKey
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2211
    |cancelAction|
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2212
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2213
    builder notNil ifTrue:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2214
        cancelAction := builder bindingAt:#doCancel.
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2215
    ].
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2216
    cancelAction notNil ifTrue:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2217
        cancelAction value
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2218
    ] ifFalse:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2219
        self doCancel
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2220
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2221
! !
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2222
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2223
!ApplicationModel methodsFor:'help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2224
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2225
aboutImage
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2226
    "bitmap image or nil for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2227
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2228
    ^ self class aboutImage
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2229
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2230
    "Modified: / 13.11.2001 / 12:32:44 / cg"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2231
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2232
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2233
aboutThisApplicationLabel
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2234
    "label for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2235
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2236
    ^ self class aboutThisApplicationLabel
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2237
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2238
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2239
aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2240
    "text for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2241
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2242
    ^ self class aboutThisApplicationText
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2243
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2244
2520
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2245
flyByHelpDependsOnPositionIn:aView
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2246
    "subclasses where the help-text depends upon the pointer position might
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2247
     want to redefine this"
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2248
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2249
    ^ false
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2250
!
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2251
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2252
openAboutThisApplication
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2253
    "opens an about box for this application.
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2254
     Can be specialized by redefining #aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2255
     and #aboutThisApplicationLabel"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2256
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2257
    Dialog
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  2258
        about:(self translateString:self aboutThisApplicationText)
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  2259
        label:(self translateString:self aboutThisApplicationLabel)
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2260
        icon:self aboutImage
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2261
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2262
    "Modified: / 17.11.2001 / 23:05:52 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2263
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2264
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2265
openHelpViewOnFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2266
    "open a help viewer (as opened by the help buttons).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2267
     The argument is a relative path within the help directory
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2268
     (but a file under the current directory is tried first)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2269
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2270
    self withWaitCursorDo:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2271
        HTMLDocumentView openFullOnHelpFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2272
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2273
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2274
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2275
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2276
showActiveHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2277
    "This is invoked from the activeHelp event listener, to display some popup-help
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2278
     for a component. If false is returned, the help manager will pop up
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2279
     some active help bubble; if true is returned, it will assume that the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2280
     help text has been already displayed and will not do any further actions.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2281
     Here, we accept the help text, and push an event into out own input
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2282
     queue, so that the help text will be displayed asyncronously by myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2283
     vis the #showHelp:for: method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2284
     This can be redefined in concrete classes to handle active help differently."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2285
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2286
    |wg mySensor|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2287
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2288
    self showingHelp ifFalse: [
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2289
        ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2290
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2291
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2292
"/    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2293
"/        (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2294
"/            ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2295
"/        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2296
"/    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2297
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2298
    "/ NEW: push it into the event queue, to have it displayed
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2299
    "/ syncronously with other events.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2300
    "/ (also any errors are reported as occurring in my context;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2301
    "/  instead of occurring in the activeHelp context).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2302
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2303
    (wg := self windowGroup) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2304
        mySensor := wg sensor.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2305
        mySensor notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2306
            mySensor flushEventsFor:self withType:#showHelp:for:.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2307
            mySensor 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2308
                pushUserEvent:#showHelp:for: for:self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2309
                withArguments:(Array with:aHelpText with:view).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2310
            ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2311
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2312
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2313
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2314
    "/ mhmh - can this happen ?
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2315
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2316
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2317
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2318
    "Modified: / 21.8.1998 / 16:00:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2319
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2320
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2321
showHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2322
    "actual method which is supposed to display the help text.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2323
     Should be redefined in concrete classes, to put the help text
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2324
     into some info label, or the windows title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2325
     Here, the help text is ignored."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2326
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2327
    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2328
        masterApplication showHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2329
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2330
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2331
    "Modified: / 31.7.1998 / 19:13:59 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2332
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2333
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2334
showingHelp
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2335
    "return true, if the activeHelp manager should invoke my #showHelp:for:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2336
     method, when the mouse pointer is moved over my widgets.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2337
     The default here is true, however, the #showHelp:for: methods are empty.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2338
     These should be redefined to put the help text into some info label,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2339
     or into the views title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2340
     You may also redefine the showingHelp/showingHelp: methods, to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2341
     remember the flag setting."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2342
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2343
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2344
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2345
    "Modified: / 31.7.1998 / 17:55:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2346
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2347
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2348
!ApplicationModel methodsFor:'hooks'!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2349
2185
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2350
aboutToOpen:whichTopView
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2351
    "the topView is about to be opened.
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2352
     This is sent by whichTopView, right before its really open
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2353
     (i.e. finally visible)"
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2354
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2355
    self preOpenWith:builder
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2356
!
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2357
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2358
commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2359
    "a common hook for postBuildWith: and postBuildAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2360
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2361
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2362
commonPostOpen
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2363
    "a common hook for postOpenWith:, postOpenAsSubcanvasWith: and postOpenAsDialogWith:."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2364
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2365
    "Modified (comment): / 07-07-2011 / 17:13:39 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2366
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2367
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2368
commonPreBuild
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2369
    "a common hook for preBuildWith:, preBuildAsSubcanvasWith: and preBuildAsDialogWith:."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2370
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2371
    "Modified (comment): / 07-07-2011 / 17:13:51 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2372
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2373
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2374
postApplicationProcessCreate:newProcess windowGroup:newGroup
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2375
    "this is sent whenever a new application is launched from this app, 
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2376
     which forks its own windowGroup process. Allows for process group management,
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2377
     or process-global exception handlers to be installed.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2378
     Nothing done here - to be redefined in concrete applications"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2379
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2380
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2381
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2382
postBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2383
    "this is sent after an interface is built from a spec as subcanvas.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2384
     Can be redefined in subclasses for additional setup after
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2385
     the subcanvas' view has been built, but not yet opened."
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2386
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2387
    |sameApp|
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2388
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2389
    sameApp := aBuilder application == aBuilder window topView application.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2390
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2391
    "/ If I am opened as subcanvas in another application
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2392
    "/ then treat this like a regular open.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2393
    "/ otherwise ignore it.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2394
    sameApp ifFalse:[
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2395
        self postBuildWith:aBuilder.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2396
    ] ifTrue:[
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2397
        "/ I no not think, that this is a good default
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2398
        "/ self commonPostBuild.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2399
    ].
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2400
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2401
    "Modified (comment): / 07-07-2011 / 17:16:30 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2402
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2403
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2404
postBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2405
    "this is sent after an interface is built from a spec as dialog with me
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2406
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2407
     Can be redefined in subclasses for additional setup after
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2408
     the dialog's view has been built, but not yet opened."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2409
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2410
    |sameApp|
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2411
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2412
    sameApp := (aBuilder application == aBuilder window topView application).
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2413
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2414
    "/ If I am opened as subcanvas in another application
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2415
    "/ then treat this like a regular open.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2416
    "/ otherwise ignore it.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2417
    sameApp ifFalse:[
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2418
        self postBuildWith:aBuilder.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2419
    ] ifTrue:[
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2420
        self commonPostBuild.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2421
    ].
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2422
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2423
    "Modified: / 08-07-1998 / 18:28:55 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2424
    "Created: / 07-07-2011 / 17:20:29 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2425
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2426
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2427
postBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2428
    "this is sent after an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2429
     Can be redefined in subclasses for additional setup after
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2430
     the view has been built, but not yet opened."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2431
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2432
    self commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2433
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2434
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2435
postOpenAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2436
    "this is sent after the applications window is opened inside another application.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2437
     Can be redefined in subclasses for actions after showing the canvas view."
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2438
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2439
    self commonPostOpen
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2440
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2441
    "Modified (comment): / 07-07-2011 / 17:16:46 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2442
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2443
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2444
postOpenDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2445
    "this is sent after the applications window is opened as a dialog with me
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2446
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2447
     Can be redefined in subclasses for actions after opening a dialog view."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2448
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2449
    "Created: / 07-07-2011 / 17:20:37 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2450
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2451
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2452
postOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2453
    "this is sent after the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2454
     Can be redefined in subclasses for actions after opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2455
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2456
    self commonPostOpen
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2457
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2458
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2459
preBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2460
    "this is sent before an interface is built from a spec as a subcanvas.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2461
     Can be redefined for apps which need to be informed about that."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2462
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2463
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2464
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2465
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2466
preBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2467
    "this is sent before an interface is built from a spec as a dialog with me
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2468
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2469
     Can be redefined for apps which need to be informed about that."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2470
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2471
    "Created: / 07-07-2011 / 17:20:48 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2472
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2473
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2474
preBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2475
    "this is sent before an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2476
     Can be redefined in subclasses.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2477
     mhmh - what should this do here ?"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2478
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2479
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2480
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2481
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2482
preOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2483
    "this is sent before the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2484
     Can be redefined in subclasses for actions right before opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2485
! !
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2486
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2487
!ApplicationModel methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2488
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2489
addTopViewsToCurrentProject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2490
    "add all of my topViews to the current projects list of views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2491
     This allows hiding views on a per-project basis.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2492
     Applications which do not want to be switched with projects
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2493
     (such as the Launcher), may redefine this to a noop."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2494
1972
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2495
    |wg|
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2496
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2497
    (wg := self windowGroup) notNil ifTrue:[
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2498
        (wg topViews ? #()) do:[:aView |
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2499
            aView addToCurrentProject
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2500
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2501
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2502
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2503
    "Modified: 17.1.1997 / 19:43:39 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2504
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2505
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2506
basicInitialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2507
    "initialize the application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2508
     Since ST-80 applications seem commonly to redefine #initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2509
     without doing a super initialize, the real initialization is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2510
     done here ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2511
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2512
    self initializeDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2513
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2514
    "claus: I wanted to delay the creation & assignment of the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2515
     builder till later, to allow setting to another builder.
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2516
     however, some (old) ST-80 code seems to access the builder right after instance
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2517
     creation, which might lead to trouble.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2518
     On the other hand, some (newer) apps (RefactoringBrowser) depend on this being set
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2519
     late.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2520
     So, we leave it undefined here. Do not uncomment the following lines.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2521
    "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2522
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2523
"/    builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2524
"/    builder notNil ifTrue:[builder application:self].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2525
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2526
    self initializeResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2527
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2528
    "Modified: / 13-09-2006 / 12:39:30 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2529
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2530
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2531
initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2532
    "nothing done here;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2533
     but can be redefined in concrete applications"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2534
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2535
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2536
initializeDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2537
    self isWebService ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2538
        self initializeWebServiceDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2539
    ] ifFalse:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2540
        self initializeScreenDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2541
    ].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2542
!
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2543
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2544
initializeResources
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2545
    "initialize the applications resources (NLS support)."
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2546
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2547
    resources := self class classResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2548
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2549
    "Created: / 13-09-2006 / 12:39:22 / cg"
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2550
!
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2551
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2552
initializeScreenDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2553
    Screen notNil ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2554
        device := Screen current.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2555
    ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2556
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2557
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2558
setDevice:aDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2559
    "set the device (i.e. some Screen), where the application shall open its view(s).
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2560
     The default device (if not set here) will be the current screen."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2561
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2562
    device := aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2563
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2564
    "Created: 5.7.1996 / 12:01:40 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2565
    "Modified: 17.1.1997 / 19:44:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2566
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2567
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2568
!ApplicationModel methodsFor:'opening'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2569
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2570
open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2571
    "open a standard interface"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2572
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2573
    ^ self openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2574
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2575
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2576
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2577
1592
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2578
openAndWaitUntilVisible
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2579
    "open a standard interface, and wait until my window is visible"
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2580
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2581
    self open.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2582
    self window waitUntilVisible.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2583
!
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2584
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2585
openAs:windowType
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  2586
    "open a standard interface as slave, partner, dialog, popUp, undecorated etc."
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2587
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2588
    ^ self openInterfaceAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2589
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  2590
    "Modified: / 04-03-2011 / 15:03:19 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2591
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2592
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2593
openAsSlave
1726
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2594
    "open a standard interface as slave.
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2595
     Notice: there is still a need to make the current window a master
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2596
        (see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2597
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2598
    ^ self openAs:#slave
1724
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2599
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2600
    "
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2601
     WorkspaceApplication new openAsSlave.
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2602
    "
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2603
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2604
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2605
openAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2606
    "open a standard interface at some point"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2607
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2608
    ^ self openInterfaceAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2609
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2610
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2611
    "Created: 14.2.1997 / 20:17:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2612
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2613
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2614
openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2615
    "open a standard interface.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2616
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2617
     Subclasses which do not have an interfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2618
     should redefine this method and create & open their view(s) there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2619
     (see Launcher as an example)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2620
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2621
    ^ self openInterface:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2622
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2623
    "Modified: / 9.9.1996 / 22:39:23 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2624
    "Modified: / 23.1.1998 / 18:16:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2625
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2626
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2627
openInterface:aSymbol
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2628
    "open a specific interface.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2629
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2630
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2631
     application subclass must provide a method with that name,
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2632
     which must return an interfaceSpec. 
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2633
     This is forwarded to the builder to create the views.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2634
     Typically, applications only use one interface, returned by the #windowSpec method."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2635
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2636
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2637
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2638
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2639
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2640
    "Modified: / 03-03-2011 / 18:57:04 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2641
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2642
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2643
openInterface:aSymbol as:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2644
    "open a specific interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2645
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2646
     The argument, aSymbol specifies which interface. 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2647
     The concrete application subclass must provide a method with that name,
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2648
     which must return an interfaceSpec. This is forwarded to the builder to create the views.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2649
     Typically, applications only use one interface, returned by the #windowSpec method.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2650
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2651
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2652
    self allButOpenInterface:aSymbol.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2653
    self openWindowAs:windowType.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2654
    ^ builder
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2655
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2656
    "Modified: / 03-03-2011 / 18:56:23 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2657
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2658
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2659
openInterface:aSymbol at:aLocation
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2660
    "open a specific interface at a location in default mode. 
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2661
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2662
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2663
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2664
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2665
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2666
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2667
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2668
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2669
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2670
    self openWindowAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2671
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2672
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2673
    "Created: / 14-02-1997 / 20:19:44 / cg"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2674
    "Modified: / 03-03-2011 / 18:55:26 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2675
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2676
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2677
openInterfaceAs:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2678
    "open a standard interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2679
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  2680
     The windowType can be any of #slave, #partner, #dialog, #popUp, #undecorated etc."
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2681
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2682
    ^ self openInterface:(self defaultWindowSpecName) as:windowType
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2683
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2684
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  2685
    "Modified: / 04-03-2011 / 15:03:28 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2686
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2687
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2688
openInterfaceAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2689
    "open a standard interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2690
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2691
    ^ self openInterface:(self defaultWindowSpecName) at:aLocation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2692
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2693
    "Created: / 14.2.1997 / 20:18:20 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2694
    "Modified: / 23.1.1998 / 18:17:13 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2695
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2696
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2697
openInterfaceModal
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2698
    "open a standard interface as a modal dialog"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2699
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2700
    ^ self openInterfaceModal:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2701
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2702
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  2703
    "Modified: / 03-03-2011 / 18:54:48 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2704
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2705
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2706
openInterfaceModal:aSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2707
    "open a specific interface as a modal dialog. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2708
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2709
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2710
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2711
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2712
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2713
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2714
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2715
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2716
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2717
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2718
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2719
    "Modified: 14.2.1997 / 20:25:33 / cg"
969
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2720
!
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2721
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2722
openInterfaceModal:aSymbol at:location
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2723
    "open a specific interface modal at some screen location. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2724
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2725
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2726
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2727
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2728
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2729
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2730
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2731
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2732
    self openWindowModalAt:location.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2733
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2734
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2735
    "Modified: 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2736
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2737
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2738
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2739
    "open a standard interface as a modal dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2740
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2741
    ^ self openInterfaceModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2742
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2743
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2744
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2745
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2746
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2747
    "open a standard interface on some other device"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2748
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2749
    self setDevice:aDevice.
1444
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2750
    Screen currentScreenQuerySignal answer:aDevice
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2751
    do:[
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2752
        ^ self open
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2753
    ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2754
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2755
    "Created: 13.1.1997 / 21:24:11 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2756
    "Modified: 13.1.1997 / 21:24:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2757
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2758
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2759
openSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2760
    "open a view as specified in anInterfaceSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2761
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2762
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2763
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2764
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2765
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2766
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2767
    "Created: / 20.5.1998 / 20:08:51 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2768
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2769
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2770
openSpec:anInterfaceSpec withBindings:bindings
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2771
    "open a view as specified in anInterfaceSpec."
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2772
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2773
    self openSpec:anInterfaceSpec withBindings:bindings modal:false
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2774
!
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2775
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2776
openSpec:anInterfaceSpec withBindings:bindings modal:modal
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2777
    "open a view as specified in anInterfaceSpec."
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2778
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2779
    self createBuilder.
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2780
    builder bindings:bindings.            
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2781
    self allButOpenFrom:anInterfaceSpec.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2782
    modal ifTrue:[
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2783
        self openWindowModal.
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2784
    ] ifFalse:[
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2785
        self openWindow.
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  2786
    ]
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2787
!
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  2788
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2789
openSpecModal:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2790
    "open an interface spec modal"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2791
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2792
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2793
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2794
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2795
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2796
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2797
    "Created: / 20.5.1998 / 20:20:21 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2798
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2799
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2800
openWindow
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2801
    "open the window 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2802
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2803
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2804
    builder "openWindow."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2805
        openAt:nil
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2806
        withExtent:(self defaultWindowExtent)
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2807
        andType:(self defaultWindowType)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2808
2270
a7c797806d46 correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  2809
    "Created: / 14-02-1997 / 20:20:39 / cg"
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2810
    "Modified: / 11-07-2011 / 22:30:27 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2811
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2812
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2813
openWindowAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2814
    "open the window - assumes that the builder has already setup the interface. 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2815
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2816
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2817
    builder 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2818
        openAt:nil 
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2819
        withExtent:(self defaultWindowExtent) 
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2820
        andType:windowType
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2821
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2822
    "Modified: / 11-07-2011 / 22:30:35 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2823
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2824
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2825
openWindowAs:windowType at:originOrNil
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2826
    "open the window - assumes that the builder has already setup the interface. 
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2827
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2828
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2829
    builder 
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2830
        openAt:originOrNil 
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2831
        withExtent:(self defaultWindowExtent) 
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2832
        andType:windowType
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2833
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2834
    "Modified: / 11-07-2011 / 22:30:35 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2835
    "Created: / 25-07-2011 / 16:00:24 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2836
!
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  2837
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2838
openWindowAt:aPoint
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2839
    "open the window 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2840
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2841
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2842
    builder "openWindowAt:aLocation."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2843
        openAt:aPoint
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2844
        withExtent:(self defaultWindowExtent)
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2845
        andType:(self defaultWindowType)
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2846
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2847
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2848
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2849
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2850
openWindowAtCenter
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2851
    "open the window centered on the screen
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2852
     - assumes that the builder has already setup the interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2853
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2854
    builder openWindowAt:#center
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2855
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2856
    "Created: 14.2.1997 / 20:20:55 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2857
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2858
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2859
openWindowModal
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2860
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2861
     - assumes that the builder has already setup the interface."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2862
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2863
"/    builder openDialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2864
    builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2865
        openAt:nil 
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  2866
        withExtent:(self defaultWindowExtent) 
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2867
        andType:#dialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2868
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2869
    "Created: / 14-02-1997 / 20:20:39 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2870
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2871
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2872
openWindowModalAt:aLocation
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2873
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2874
     - assumes that the builder has already setup the interface."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2875
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2876
    builder openDialogAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2877
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2878
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2879
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2880
1478
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2881
openWithExtent:extPoint
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2882
    "open a standard interface with given extent"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2883
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2884
    |bldr|
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2885
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2886
    bldr := self allButOpen.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2887
    bldr openWithExtent:extPoint.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2888
    ^ bldr
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2889
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2890
    "Modified: 3.5.1996 / 13:39:15 / cg"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2891
!
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2892
1968
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2893
opened:whichTopView
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2894
    "the topView has been opened.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2895
     This is sent by whichTopView, when its really open
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2896
     (i.e. finally visible)"
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2897
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2898
    self addTopViewsToCurrentProject.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2899
    self postOpenWith:builder
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2900
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2901
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2902
!ApplicationModel methodsFor:'opening-dialogs'!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2903
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2904
openDialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2905
    "open my window as a modal dialog 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2906
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2907
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2908
    self window beToolDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2909
    ^ builder openDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2910
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2911
    "Modified: / 14-02-1997 / 20:32:52 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2912
    "Modified (comment): / 07-07-2011 / 17:25:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2913
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2914
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2915
openDialogInterface:aSelector
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2916
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2917
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2918
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2919
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2920
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2922
    ^ self openDialogInterface:aSelector withBindings:nil
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2923
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2924
    "Modified: / 28-02-1997 / 14:08:01 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2925
    "Modified (comment): / 07-07-2011 / 17:25:26 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2926
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2927
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2928
openDialogInterface:aSelector withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2929
    "open a dialog, given a spec-selector"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2930
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2931
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2932
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2933
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2934
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2935
    ^ SimpleDialog new 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2936
        openFor:self 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2937
        interface:aSelector 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2938
        withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2939
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2940
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2941
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2942
    "Modified (comment): / 07-07-2011 / 17:25:23 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2943
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2944
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2945
openDialogInterfaceSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2946
    "open a dialog, given a spec"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2947
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2948
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2949
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2950
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2951
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2952
    ^ SimpleDialog new 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2953
        openFor:self 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2954
        interfaceSpec:aSpec 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2955
        withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2956
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2957
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2958
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2959
    "Modified (comment): / 07-07-2011 / 17:25:20 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2960
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2961
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2962
openDialogSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2963
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2964
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2965
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2966
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2967
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2968
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2969
    ^ SimpleDialog new 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2970
        openFor:self 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2971
        spec:aSpec 
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2972
        withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2973
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2974
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2975
    "Created: / 20-05-1998 / 20:27:56 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2976
! !
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2977
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2978
!ApplicationModel methodsFor:'opening-webInterface'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2979
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2980
addToService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2981
    self service 
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2982
        addPage:(builder page) 
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2983
        link:(self webLink)
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2984
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2985
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2986
createWebBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2987
    "create a Web-UIBuilder if not already present"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2988
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2989
    builder isNil ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2990
        builder := self webBuilderClass new.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2991
        builder application:self.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2992
    ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2993
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2994
    "Created: / 19.6.1998 / 03:32:37 / cg"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2995
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2996
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2997
defaultPageSpecName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2998
    ^ #pageSpec
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2999
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3000
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3001
defineInterface
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3002
    "define a standard interface.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3003
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3004
     Subclasses which do not have an interfaceSpec 
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3005
     should redefine this method and create their page there."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3006
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3007
    ^ self defineInterface:(self defaultPageSpecName)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3008
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3009
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3010
defineInterface:aSpecSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3011
    "define an interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3012
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3013
    ^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3014
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3015
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3016
defineInterfaceFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3017
    "define an interface (setup a page), given a spec."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3018
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3019
    |page|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3020
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3021
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3022
        self createWebBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3023
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3024
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3025
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3026
    builder buildPageFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3027
    page := builder page.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3028
    page application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3029
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3030
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3031
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3032
    "Modified: / 19.6.1998 / 03:35:31 / cg"
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3033
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3034
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3035
httpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3036
    "on which port will a HTTP server be started"
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3037
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3038
    ^ self class defaultHttpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3039
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3040
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3041
initializeAsWebServiceOnWebDevice:webDevice
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3042
    self setDevice:(WebApplicationDevice new).
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3043
    self initialize.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3044
    self initializeWebServiceDevice.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3045
    self initializeResources.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3046
!
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3047
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3048
initializeWebServiceDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3049
    "no real device here; instead, we need a web service in which I register.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3050
     The device is a dummy one, to make the protocol transparent & compatible"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3051
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3052
    |server|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3053
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3054
    self service isNil ifTrue:[
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3055
        server := HTTPServer serverOnPort:(self httpServerPort).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3056
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3057
        self service:(server 
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3058
                    serviceForLink:(self serviceLinkName)
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3059
                    ifAbsent:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3060
                        |service|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3061
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3062
                        service := HTTPPortalService new.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3063
                        service linkName:(self serviceLinkName).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3064
                        service class unRegisterServiceOn:server.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3065
                        service registerServiceOn:server.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3066
                        service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3067
                    ]).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3068
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3069
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3070
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3071
pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3072
    ^ self class pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3073
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3074
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3075
service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3076
    device isNil ifTrue:[^ nil].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3077
    self assert:(device isWebServiceDevice).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3078
    ^ device service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3079
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3080
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3081
service:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3082
    self device service:something.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3083
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3084
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3085
serviceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3086
    ^ self class defaultServiceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3087
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3088
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3089
startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3090
    device isNil ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3091
        self initializeDevice.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3092
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3093
    self startInPortalService:self service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3094
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3095
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3096
     self new startInWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3097
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3098
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3099
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  3100
startInPortalService:aPortalServiceOrSession 
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  3101
    aPortalServiceOrSession application:self.
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  3102
    self service:aPortalServiceOrSession.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3103
    self defineInterface.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3104
    self addToService.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3105
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3106
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3107
webBuilderClass
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3108
    "return the UIBuilder class for me.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3109
     This method can be redefined if (eventually) there are
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3110
     spec readers for other UI languages (motif UIL ?)"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3111
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3112
    ^ WebPageBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3113
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3114
    "Created: / 19.6.1998 / 01:39:26 / cg"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3115
    "Modified: / 19.6.1998 / 01:45:24 / cg"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3116
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3117
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3118
webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3119
    "if nil is returned, I will install my page(s) right under the serviceLink (i.e. /portal/nn).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3120
     Otherwise, they will be under (i.e. /portal/link/nn)"
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3121
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3122
    ^ self device webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3123
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3124
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3125
webLink:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3126
    self device webLink:something
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3127
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3128
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3129
!ApplicationModel methodsFor:'private'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3130
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3131
builderClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3132
    "return the UIBuilder class for me.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3133
     This method can be redefined if (eventually) there are
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3134
     spec readers for other UI languages (motif UIL ?)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3135
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3136
    self isWebService ifTrue:[
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3137
        ^ self webBuilderClass
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3138
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3139
    ^ UIBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3140
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3141
    "Created: / 19.6.1998 / 01:39:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3142
    "Modified: / 19.6.1998 / 01:45:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3143
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3144
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3145
createBuilder
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3146
    "create a WindowBuilder if not already present"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3147
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3148
    builder isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3149
        builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3150
        builder application:self.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3151
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3152
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3153
    "Created: / 19.6.1998 / 03:32:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3154
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3155
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3156
!ApplicationModel methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3157
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3158
defaultWindowExtent
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3159
    ^ nil
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3160
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3161
    "Created: / 11-07-2011 / 22:30:12 / cg"
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3162
!
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3163
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3164
defaultWindowSpecName
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3165
    ^ #windowSpec
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3166
!
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3167
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3168
defaultWindowType
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3169
    "Applications come up non-modal, by default"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3170
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3171
    ^ #normal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3172
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3173
    "Created: 17.1.1997 / 19:57:34 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3174
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3175
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3176
graphicsDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3177
    "return the device I want to open my views on.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3178
     The default (if not created with #onDevice:) is the currently
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3179
     active screen."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3180
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3181
    ^ device
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3182
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3183
    "Created: 5.7.1996 / 17:51:31 / cg"
1132
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3184
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3185
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3186
interfaceSpecFor:aSelectorOrSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3187
    "return an interface spec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3188
     Here, the query is forwarded to my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3189
     Can be refefined in subclasses which want to provide per-instance specs."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3190
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3191
    aSelectorOrSpec isSymbol ifFalse:[     
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3192
        (aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3193
    ].
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3194
    ^ self class interfaceSpecFor:aSelectorOrSpec
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3195
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3196
    "Created: / 25-01-1998 / 19:45:12 / cg"
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3197
    "Modified: / 14-01-2008 / 17:54:29 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3198
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3199
1481
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3200
isOpen
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3201
   "answer true if the application's window is open"
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3202
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3203
   |win|
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3204
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3205
   ^ (win := self window) notNil and:[win isOpen]
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3206
!
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3207
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3208
isWebService
2545
d32d7c7cc96a changed #isWebService
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  3209
    ^ device notNil and:[ device askFor:#isWebServiceDevice ]
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3210
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3211
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3212
processName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3213
    "return a name to be shown for me in the process monitor"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3214
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3215
    self class == ApplicationModel ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3216
        ^ 'Application'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3217
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3218
    ^ self class nameWithoutPrefix
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3219
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3220
    "Modified: / 4.12.1997 / 12:39:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3221
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3222
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3223
resolveClassNamed:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3224
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3225
     first we are looking in the namespace of the application, then in the
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3226
     current namespace and finally in Smalltalk
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3227
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3228
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3229
    ^ Smalltalk resolveName:something inClass:aClass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3230
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3231
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3232
resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3233
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3234
     first we are looking in the namespace of the application, then in the
2099
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3235
     current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3236
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3237
    ^ self resolveName:something inClass:self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3238
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3239
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3240
resolveName:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3241
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3242
     first we are looking in the namespace of the application, 
2099
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3243
     then in the current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3244
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3245
    |cls|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3246
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3247
    aClass notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3248
        (cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3249
            ^ cls
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3250
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3251
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3252
        masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3253
            ^ masterApplication resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3254
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3255
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3256
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3257
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3258
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3259
selfResponsibleFor:aKey
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3260
    "internal: return true, if I am to provide a value for some aspect."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3261
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3262
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3263
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3264
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3265
    ^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]])
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3266
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3267
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3268
topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3269
    "return the top-master application"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3270
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3271
    masterApplication isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3272
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3273
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3274
    ^ masterApplication topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3275
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3276
    "Created: / 6.6.1998 / 19:40:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3277
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3278
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1750
diff changeset
  3279
!ApplicationModel methodsFor:'startup & release'!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3280
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3281
applicationWindowClass
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3282
    "return the class used for my (top-) windows"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3283
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3284
    ^ ApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3285
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3286
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3287
close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3288
    "this is sent by my topView when about to be closed
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3289
     by the program (not by the windowManager).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3290
     Notice, that we get a closeRequest message if closed by the windowManager,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3291
     which can be rejected by the app (or confirmed via a dialog)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3292
     Could be redefined in subclasses."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3293
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3294
    self closeDownViews
1132
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3295
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3296
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3297
closeDownViews
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3298
    "close down the applications view(s)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3299
2893
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3300
    |wg wgProcess window|
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3301
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3302
    self release.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3303
    ActiveHelp stopFor:self.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3304
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3305
    (wg := self windowGroup) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3306
        wgProcess := wg process.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3307
        (Processor activeProcess ~~ wgProcess
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3308
        and:[wgProcess notNil]) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3309
            wgProcess terminate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3310
        ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3311
            wg closeDownViews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3312
        ]
2890
e7ac796279d7 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  3313
    ] ifFalse:[
2893
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3314
        (window := self window) notNil ifTrue:[
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3315
            window destroy.
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3316
        ]
2890
e7ac796279d7 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  3317
    ].
e7ac796279d7 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  3318
2893
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3319
    "Modified: / 28-02-2011 / 17:57:12 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3320
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3321
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3322
closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3323
    "this is sent by my topView when about to be closed by the windowManager.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3324
     Could be redefined in subclasses to suppress close or confirm."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3325
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3326
    |sav window|
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3327
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3328
    window := self window.
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3329
    window isNil ifTrue:[
1461
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3330
        'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3331
        ^ self
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3332
    ].
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3333
1831
766f0b3cd453 not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3334
    window isTopView ifFalse:[
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3335
        window topView isModal ifTrue:[
1461
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3336
            WindowGroup leaveSignal raise.
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3337
        ].
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3338
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3339
        'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3340
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3341
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3342
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3343
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3344
    "/ (but not if I am a modal reincarnation)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3345
    (masterApplication notNil 
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3346
    and:[window isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3347
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3348
        "/ temporary clear my masterApplication to prevent
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3349
        "/ endless recursion, in case the master sends me
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3350
        "/ a closeRequest (although, it is supposed to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3351
        "/ send me a closeDownViews ...)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3352
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3353
        sav := masterApplication.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3354
        masterApplication := nil.
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3355
        sav closeRequestFor:window.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3356
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3357
        "/ restore - in case master did not want me to close ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3358
        masterApplication := sav.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3359
    ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3360
        "/ ST/X does close-check by redefining this message without
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3361
        "/ a supersend;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3362
        "/ VW does it by returning false from requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3363
        "/ sigh.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3364
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3365
        self requestForWindowClose ifTrue:[
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3366
            window isSlave ifTrue:[
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3367
                window destroy
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3368
            ] ifFalse:[
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3369
                self closeDownViews
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3370
            ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3371
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3372
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3373
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3374
    "Modified: / 19.6.1998 / 01:37:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3375
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3376
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3377
closeRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3378
    "this is sent by any of my topViews when about to be closed by the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3379
     windowmanager. For backward compatibility with single-view applications,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3380
     this is forwarded here to a simple (non topView-specific) closeRequest,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3381
     effectively closing all of my views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3382
     MultiView applications should redefine this method if closing of individual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3383
     views closing is to be caught and/or should not close all of them."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3384
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3385
    |savedMaster myWindow|
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3386
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3387
    myWindow := self window.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3388
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3389
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3390
    "/ (but not if I am a modal reincarnation)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3391
    (masterApplication notNil 
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3392
    and:[myWindow topView isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3393
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3394
        "/ temporary clear my masterApplication to prevent
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3395
        "/ endless recursion, in case the master sends me
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3396
        "/ a closeRequest (although, it is supposed to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3397
        "/ send me a closeDownViews ...)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3398
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3399
        savedMaster := masterApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3400
        masterApplication := nil.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3401
        aTopView isSlave ifTrue:[
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3402
            savedMaster closeRequestFor:aTopView.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3403
        ] ifFalse:[
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3404
            savedMaster closeRequestFor:myWindow.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3405
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3406
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3407
        "/ restore - in case master did not want me to close ...
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3408
        masterApplication := savedMaster.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3409
        ^ self
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3410
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3411
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3412
    (aTopView == myWindow) ifTrue:[
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3413
        self closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3414
        ^ self
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3415
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3416
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3417
    (aTopView isPartner or:[aTopView isMaster]) ifTrue:[
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3418
        aTopView application closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3419
        self closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3420
        ^ self.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3421
    ].
1924
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3422
    aTopView isSlave ifTrue:[
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3423
        aTopView closeRequest 
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3424
    ] ifFalse:[
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3425
        aTopView application closeRequest.
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3426
    ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3427
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3428
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3429
doAccept
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3430
    "this is invoked by the Return-Key (if returnIsOK) or
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3431
     the ok-button (if any), IFF the application has been
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3432
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3433
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3434
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3435
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3436
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3437
    "/ However, it may be useful, to open some app (which is normally
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3438
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3439
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3440
    "/ to remember the accept vs. cancel case.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3441
    "/
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3442
    self window isModal ifTrue:[
2128
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3443
        masterApplication notNil ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3444
            masterApplication window topView == self window topView ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3445
                masterApplication window isModal ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3446
                    masterApplication doAccept.
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3447
                    ^ self.
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3448
                ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3449
            ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3450
        ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  3451
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3452
        "/ mhmh - is this a good idea ?
1792
156a3d4e3b25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1781
diff changeset
  3453
        self perform:#accept ifNotUnderstood:[self closeRequest].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3454
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3455
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3456
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3457
    ^ self      "/ nothing done here ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3458
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3459
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3460
doCancel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3461
    "this is invoked by the Escape-Key (if escapeIsCancel) or
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3462
     the cancel-button (if any), IFF the application has been
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3463
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3464
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3465
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3466
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3467
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3468
    "/ However, it may be useful, to open some app (which is normally
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3469
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3470
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3471
    "/ to remember the accept vs. cancel case.
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
  3472
    "/
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3473
    self window isModal ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3474
        "/ mhmh - is this a good idea ?
1792
156a3d4e3b25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1781
diff changeset
  3475
        self perform:#cancel ifNotUnderstood:[self closeRequest].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3476
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3477
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3478
    ^ self      "/ nothing done here ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3479
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3480
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3481
releaseAsSubCanvas
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3482
    "a subcanvas is closed or switching to a new application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3483
     Can be redefined to perform a self release in this case."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3484
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3485
    "/ used to self release here,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3486
    "/ but that is incompatible to VW (RefactoryBrowser).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3487
    "/ Therefore, if you need it, you MUST now redefine
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3488
    "/ this method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3489
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3490
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3491
restarted
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3492
    "sent by my topWindow, when restarted from an image.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3493
     Nothing done here, but can be redefined to perform any actions
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3494
     required to reset the application after an image-restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3495
     (for example: check if application files are still around, restart
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3496
      subprocesses etc.)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3497
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3498
    "Modified: 1.6.1996 / 16:55:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3499
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3500
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3501
saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3502
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3503
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3504
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3505
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3506
    self closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3507
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3508
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3509
saveAndTerminateRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3510
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3511
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3512
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3513
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3514
    self saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3515
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3516
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3517
!ApplicationModel methodsFor:'translating'!
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3518
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3519
translateString:aString
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3520
    "translate aString to the current language.
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3521
     We use the resorces as default.
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3522
     Subclasses may redefine this to use another mechanism"
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3523
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  3524
    ^ self resources string:aString
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3525
! !
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  3526
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3527
!ApplicationModel methodsFor:'user interaction & notifications'!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3528
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3529
beep
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3530
  "output an audible beep or bell on my screen device"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3531
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3532
   device notNil ifTrue:[
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3533
        device beep.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3534
   ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3535
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3536
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3537
information:aString
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3538
    "like Objects information, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3539
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3540
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3541
    super information:(self translateString:aString) withCRs
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3542
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3543
    "Created: / 20.5.1998 / 03:48:43 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3544
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3545
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3546
notify:aString
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3547
    "like Objects notify, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3548
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3549
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3550
    super notify:(self translateString:aString) withCRs
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3551
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3552
    "Created: / 20.5.1998 / 01:14:52 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3553
    "Modified: / 13.11.2001 / 20:10:12 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3554
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3555
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3556
openDocumentationFile:aFilename
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3557
    HTMLDocumentView notNil ifTrue:[
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3558
        HTMLDocumentView openFullOnDocumentationFile:aFilename.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3559
    ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3560
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3561
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3562
restoreCursors
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3563
    "restore the original cursors in all of my views"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3564
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3565
    ^ self window windowGroup restoreCursors
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3566
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3567
    "Created: 1.6.1996 / 17:01:24 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3568
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3569
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3570
showCursor:aCursor
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3571
    "set all of my views cursor to aCursor.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3572
     It can be restored with #restoreCursor."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3573
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3574
    ^ self window windowGroup showCursor:aCursor
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3575
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3576
    "Created: 1.6.1996 / 17:01:09 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3577
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3578
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3579
warn:aString
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3580
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3581
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3582
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3583
    self warn:aString translate:true
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3584
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3585
    "Created: / 20.5.1998 / 01:14:52 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3586
    "Modified: / 13.11.2001 / 20:10:12 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3587
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3588
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3589
warn:aString translate:aBoolean
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3590
    "like Objects warn, but optionally translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3591
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3592
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3593
    super warn:(aBoolean 
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3594
                    ifTrue:[ (self translateString:aString) withCRs ]
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3595
                    ifFalse:[ aString ]).
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3596
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3597
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3598
warn:aString with:arg
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3599
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3600
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3601
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3602
    self warn:aString withArguments:(Array with:arg)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3603
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3604
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3605
warn:aString with:arg1 with:arg2
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3606
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3607
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3608
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3609
    self warn:aString withArguments:(Array with:arg1 with:arg2)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3610
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3611
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3612
warn:aString with:arg1 with:arg2 with:arg3
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3613
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3614
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3615
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3616
    self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3617
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3618
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3619
warn:aString with:arg1 with:arg2 with:arg3 with:arg4
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3620
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3621
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3622
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3623
    self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3 with:arg4)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3624
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3625
    "Created: / 23.2.2000 / 09:43:04 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3626
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3627
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3628
warn:aString withArguments:argArray
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3629
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3630
     resourcePack, thus giving a translated string automatically.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3631
     Also translates \'s to newLine."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3632
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3633
    |translatedString stream|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3634
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3635
    translatedString := self translateString:aString.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3636
    stream := TextStream on:(translatedString species new:translatedString size + (argArray size * 10)).
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3637
    translatedString withCRs expandPlaceholdersWith:argArray on:stream.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3638
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3639
    self warn:(stream contents) translate:false.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3640
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3641
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3642
withCursor:aCursor do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3643
    "evaluate aBlock, showing aCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3644
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3645
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3646
    |w ret|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3647
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3648
    w := self window.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3649
    w notNil ifTrue:[
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3650
        ^ w topView withCursor:aCursor do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3651
    ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3652
    aCursor showWhile:[ret := aBlock value].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3653
    ^ ret.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3654
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3655
    "Modified: / 23.9.1998 / 17:00:25 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3656
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3657
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3658
withExecuteCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3659
    "evaluate aBlock, showing an executeCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3660
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3661
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3662
    ^ self withCursor:(Cursor execute) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3663
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3664
    "Created: 14.12.1995 / 20:57:03 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3665
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3666
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3667
withReadCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3668
    "evaluate aBlock, showing a readCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3669
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3670
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3671
    ^ self withCursor:(Cursor read) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3672
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3673
    "Created: 14.12.1995 / 20:56:47 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3674
    "Modified: 14.12.1995 / 20:57:36 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3675
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3676
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3677
withVisibleCursor:aCursor do:aBlock 
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3678
    "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3679
     Return the value of aBlock.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3680
     Guarantee, that the cursor is visible by the user for a minimal amount of time."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3681
    
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3682
    |ret|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3683
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3684
    self 
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3685
        withCursor:aCursor do:[
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3686
            |time|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3687
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3688
            time := Time millisecondsToRun:[ ret := aBlock value].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3689
            time := UserPreferences current waitCursorVisibleTime - time.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3690
            time > 0 ifTrue:[
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3691
                Delay waitForMilliseconds:time.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3692
            ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3693
        ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3694
    ^ ret.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3695
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3696
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3697
withWaitCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3698
    "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3699
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3700
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3701
    ^ self withCursor:(Cursor wait) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3702
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3703
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3704
withWaitCursorVisibleDo:aBlock 
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3705
    "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3706
     Return the value of aBlock.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3707
     Guarantee, that the cursor is visible by the user for a minimal amount of time."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3708
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3709
    ^ self withVisibleCursor:(Cursor wait) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3710
! !
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3711
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3712
!ApplicationModel methodsFor:'window events'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3713
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3714
clientMessage:msgType format:msgFormat eventData:msgData
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3715
    "a client message - very X-Window specific and only useful for special applications.
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3716
     Subclasses prepared to receive them should redefine this method"
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3717
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3718
2526
d2be37e49195 changed #copyDataEvent:eventData:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  3719
copyDataEvent:parameter eventData:msgData
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3720
    "a client message - very Win32 specific and only useful for special applications.
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3721
     Subclasses prepared to receive them should redefine this method"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3722
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3723
    |messageStream command argument|
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3724
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3725
    messageStream := msgData asString readStream.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3726
    command := messageStream upTo: $:.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3727
    argument := messageStream upTo: Character null.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3728
    self processApplicationCommand:command with:argument
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3729
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  3730
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3731
dispatchEvent:event
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3732
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3733
     This allows for events for an appModel to be pushed into the event queue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3734
     the same way as events for a view are pushable."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3735
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3736
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3737
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3738
        withFocusOn:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3739
        delegate:true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3740
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3741
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3742
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3743
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3744
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3745
     This allows for events for an appModel to be pushed into the event queue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3746
     the same way as events for a view are pushable."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3747
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3748
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3749
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3750
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3751
    "Modified: / 20.6.1998 / 16:44:05 / cg"
1290
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  3752
!
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  3753
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3754
dispatchEvent:ev type:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3755
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3756
     This allows for events for an appModel to be pushed into the event queue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3757
     the same way as events for a view are pushable."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3758
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3759
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3760
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3761
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3762
    "Modified: / 20.6.1998 / 16:44:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3763
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3764
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3765
dispatchEvent:event withFocusOn:focusViewOrNil 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3766
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3767
     This allows for events for an appModel to be pushed into the event queue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3768
     the same way as events for a view are pushable."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3769
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3770
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3771
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3772
        withFocusOn:focusViewOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3773
        delegate:true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3774
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3775
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3776
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3777
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3778
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3779
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3780
     This allows for events for an appModel to be pushed into the event queue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3781
     the same way as events for a view are pushable."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3782
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3783
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3784
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3785
        type:event type
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3786
        arguments:(event arguments)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3787
        withFocusOn:focusViewOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3788
        delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3789
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3790
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3791
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3792
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3793
noticeOfWindowClose:aWindow
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3794
    "sent when a topView or applicationSubView has been closed.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3795
     Can be redefined in subclasses for cleanup."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3796
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3797
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3798
    self windowEvent:(#close -> aWindow) from:aWindow.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3799
    ^ self
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3800
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3801
    "Created: / 18.6.1998 / 18:56:31 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3802
    "Modified: / 18.6.1998 / 19:14:16 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3803
!
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3804
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3805
noticeOfWindowOpen:aWindow
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3806
    "sent when a topView or applicationSubView has been opened.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3807
     Can be redefined in subclasses."
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3808
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3809
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3810
    self windowEvent:(#open -> aWindow) from:aWindow.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3811
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3812
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3813
    "Created: / 18.6.1998 / 18:56:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3814
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3815
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3816
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3817
processApplicationCommand:command with:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3818
    "a message from a secondary application instance (the exe has been started again).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3819
     Typically, the command is one like 'openPath:', as generated in StandaloneStartup."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3820
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3821
    command = 'openPath' ifTrue:[
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3822
        self processOpenPathCommand:argument.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3823
        ^ self.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3824
    ].
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3825
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3826
    Transcript showCR: 'Invalid command received: ', command.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3827
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3828
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3829
processOpenPathCommand:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3830
    "a message from a secondary application instance (the exe has been started again)
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3831
     to open another window on document as found in the pathName argument.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3832
     Left blank (i.e. ignored) here, but can be redefined to open up another application
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3833
     editor window if supported."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3834
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  3835
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3836
requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3837
    "the applicationWindow wants to know, if a close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3838
     is ok. Return false if not."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3839
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3840
    |w k|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3841
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3842
    builder notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3843
        (w := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3844
            (k := w keyboardProcessor) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3845
                ^ k requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3846
            ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3847
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3848
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3849
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3850
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3851
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3852
    "Created: / 19.6.1998 / 01:34:58 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3853
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3854
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3855
showActivity:someMessage
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3856
    "some activityNotification shalt be communicated to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3857
     the user. Forwarded from the topView and ignored here.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3858
     Can be redefined in concrete applications to show the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3859
     message either in some infoView (infoLabel as in Windows)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3860
     or in the title area (as done in the browsers)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3861
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3862
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3863
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3864
    "Created: 16.12.1995 / 18:41:04 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3865
    "Modified: 24.4.1996 / 09:34:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3866
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3867
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3868
windowEvent:anEvent from:anApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3869
    "dummy: windowEvent forwarding is not yet implemented"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3870
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3871
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3872
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3873
    "Modified: 24.4.1996 / 09:32:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3874
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3875
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3876
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3877
2753
f8c6eadde7bb changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
  3878
version_CVS
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3879
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.320 2011-07-25 14:00:36 cg Exp $'
85
claus
parents: 83
diff changeset
  3880
! !
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3881
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3882
ApplicationModel initialize!