ApplicationModel.st
author Stefan Vogel <sv@exept.de>
Wed, 29 Apr 2020 22:34:37 +0200
changeset 4460 e067415ddf46
parent 4452 bc70545786e0
permissions -rw-r--r--
#FEATURE by stefan class: ApplicationModel added: #isDialog changed: #doAccept
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4369
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
     1
"{ Encoding: utf8 }"
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
     2
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     3
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
     5
              All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     6
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     7
 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
     8
 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
     9
 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
    10
 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
    11
 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
    12
 hereby transferred.
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
"{ Package: 'stx:libview2' }"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    15
3442
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    16
"{ NameSpace: Smalltalk }"
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    17
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    18
Model subclass:#ApplicationModel
4174
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
    19
	instanceVariableNames:'builder resources device masterApplication'
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
    20
	classVariableNames:'DefaultExtents DefaultLabels DefaultVisuals
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
    21
		RecentlyOpenedApplications'
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
    22
	poolDictionaries:''
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
    23
	category:'Interface-Framework'
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    24
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    25
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    26
ApplicationModel class instanceVariableNames:'ClassResources'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    27
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    28
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    29
 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
    30
"
1350
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    31
!
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    32
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    33
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    34
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
    35
copyright
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    36
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    37
 COPYRIGHT (c) 1995 by Claus Gittinger
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    38
              All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    39
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    40
 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
    41
 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
    42
 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
    43
 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
    44
 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
    45
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    46
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    47
!
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
documentation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    50
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    51
    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
    52
    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
    53
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    54
    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
    55
    compatible to the corresponding ST80 class; therefore, manual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    56
    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
    57
    (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
    58
     for them)
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
    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
    61
    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
    62
    first concrete example.
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    65
    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
    66
    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
    67
    a spec, you should at least redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    68
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    69
        #openInterface   - to create a topview and open it
1419
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
    you may want to redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    72
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    73
        #closeRequest    - to catch window closing
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    74
        #focusSequence   - to define a sequence for focus-stepping
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    75
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    76
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    77
    Once the interfaceBuilder is finished & released, subclasses can
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    78
    alternatively provide the spec via a #windowSpec method.
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
    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
    81
    applications (which used to be subclasses of StandardSystemView)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    82
    to migrate smoothly into ApplicationModels (which is better design ...).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    83
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    84
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    85
    [Instance variables:]
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    86
        resources    ResourcePack       language string translation
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    87
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    88
        builder      WindowBuilder      a builder who knows how to create
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    89
                                        a window hierarchy from a specification
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    90
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
    Notice: this class was implemented using protocol information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    93
    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
    94
    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
    95
    please forward a note to the ST/X team.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    96
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    97
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    98
    [author:]
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
    99
        Claus Gittinger
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   100
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   101
    [see also:]
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   102
        StandardSystemView
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   103
        WindowGroup DeviceWorkstation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   104
"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   105
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   106
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   107
howToDealWithMultipleApplicationInstances
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   108
"
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   109
    The following relates to StandAlone applications (i.e. compiled exe's) only.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   110
    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
   111
    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
   112
    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
   113
    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
   114
    by the second application.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   115
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   116
    This is implemented via the following mechanism (see StandaloneStartup):
3704
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   117
        the first application instance leaves the information about its existence somewhere
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   118
            (under win32: in the registry, the window-ID of its main window is remembered;
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   119
             under unix, its stored into a locked file).
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   120
        a mutex is created to prevent a race on this informationduring startup
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   121
            (under win32: a mutex proper; under unix, the above locked file will do)
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   122
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   123
    when the app is started the second time, it will not be able to acquire the mutex (and therefore
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   124
    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
   125
    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
   126
    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
   127
    The second instance simply exits and stops execution.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   128
    This guarantees that only one instance of an application is executing (if desired).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   129
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   130
    The implementation is found in:
3704
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   131
        StandaloneStartup:
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   132
            checkForAndExitIfAnotherApplicationInstanceIsRunning
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   133
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   134
        here:
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   135
            processOpenPathCommand:aFilename
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   136
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   137
    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
   138
    redefine processOpenPathCommand: in ApplicationModel and also make sure that
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   139
    checkForAndExitIfAnotherApplicationInstanceIsRunning is called for in StandaloneStartup.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   140
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   141
"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   142
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   143
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   144
!ApplicationModel class methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   145
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   146
initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   147
    self == ApplicationModel ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   148
        Smalltalk addDependent:self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   149
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   150
    DefaultLabels isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   151
        DefaultLabels := IdentityDictionary new
1419
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
    DefaultVisuals isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   154
        DefaultVisuals := IdentityDictionary new
1419
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
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
     ApplicationModel initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   159
    "
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
    "Modified: 28.1.1997 / 12:31:38 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   162
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   163
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   164
!ApplicationModel class methodsFor:'instance creation'!
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
new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   167
    "return a new initialized instance"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   168
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
   169
    ^ self basicNew basicInitialize; initialize; yourself.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   170
!
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
onDevice:aDevice
1828
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   173
    "return a new initialized instance, which shall open its interface on aDevice."
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   174
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   175
    ^ (super basicNew basicInitialize setDevice:aDevice) initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   176
! !
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
!ApplicationModel class methodsFor:'accessing'!
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
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   181
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   182
3498
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   183
!
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   184
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   185
applicationName
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   186
    "the name as shown in an about box or in the deployed package.
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   187
     If there is an application definition in my package, ask that one.
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   188
     Otherwise, return my name."
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   189
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   190
    |prjDef|
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   191
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   192
    (prjDef := self projectDefinitionClass) notNil ifTrue:[
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   193
        prjDef isApplicationDefinition ifTrue:[
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   194
            ^ prjDef applicationName
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   195
       ]. 
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   196
    ].
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   197
    ^ self name
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   198
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   199
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   200
!ApplicationModel class methodsFor:'active help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   201
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   202
flyByHelpSpec
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
   203
    "obsolete: only provided for backward compatibility.
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
   204
     default is: take the oldStyle help-spec (should be redefined by concrete class)."
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   205
2569
4ea35689e2df flyByHelpSpec -> helpSpec
fm
parents: 2568
diff changeset
   206
    ^ self helpSpec
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   207
!
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   208
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   209
helpSpec
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   210
    "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
   211
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   212
    ^ IdentityDictionary new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   213
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   214
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   215
!ApplicationModel class methodsFor:'bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   216
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   217
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   218
    "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
   219
     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
   220
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   221
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   222
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   223
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   224
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   225
     Typically, a block is returned there."
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
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   228
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   229
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   230
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   231
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   232
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   233
    "sent by the builder to ask for an actionBlock for
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   234
     a Button which passes a value to the actionMethod.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   235
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   236
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   237
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   238
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   239
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   240
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   241
     Typically, a block is returned there."
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
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   244
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   245
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   246
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   247
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   248
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   249
    "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
   250
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   251
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   252
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   253
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   254
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   255
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   256
     Typically, a valueHolder is returned there."
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
    ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   259
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   260
    "/ ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   261
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   262
    "Modified: / 27.10.1997 / 13:43:12 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   263
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   264
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   265
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   266
    "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
   267
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   268
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   269
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   270
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   271
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   272
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   273
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   274
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   275
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   276
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   277
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   278
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   279
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   280
colorFor:aSymbol
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   281
    "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
   282
     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
   283
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   284
     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
   285
     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
   286
     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
   287
     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
   288
     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
   289
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   290
    (self respondsTo:aSymbol) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   291
        ^ (self perform:aSymbol) value.
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   292
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   293
2481
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   294
    "fall back to a possibly well defined color name"
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   295
    ^ 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
   296
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   297
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   298
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   299
    "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
   300
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   301
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   302
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   303
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   304
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   305
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   306
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   307
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   308
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   309
    (self respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   310
        ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   311
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   312
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   313
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   314
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   315
fontFor:aSymbol
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   316
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   317
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   318
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   319
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   320
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   321
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   322
     holders from a Dictionary or whatever.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   323
     Typically, a font is returned there."
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   324
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   325
    (self respondsTo:aSymbol) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   326
        ^ self perform:aSymbol.
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   327
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   328
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   329
"/    "fall back to a well defined font name"
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   330
"/    (Font respondsTo:aSymbol) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   331
"/        ^ Font perform:aSymbol.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   332
"/    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   333
    ^ nil
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   334
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   335
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   336
labelFor: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
     label for a component.
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 components #label 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
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   345
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   346
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   347
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   348
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 isNil ifTrue:[^ nil].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   351
    (app respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   352
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   353
    ].
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   354
    ^ app labelAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   355
!
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
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   358
    "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
   359
     holder for a list.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   360
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   361
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   362
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   363
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   364
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   365
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   366
     Typically, a list-holding model (SelectionInList) is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   367
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   368
    |app|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   369
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   370
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   371
    app notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   372
        (app respondsTo:aKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   373
            ^ app perform:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   374
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   375
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   376
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   377
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   378
    "Modified: 4.3.1997 / 00:53:03 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   379
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   380
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   381
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   382
    "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
   383
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   384
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   385
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   386
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   387
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   388
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   389
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   390
     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
   391
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   392
    ^ self application perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   393
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   394
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   395
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   396
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   397
    "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
   398
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   399
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   400
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   401
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   402
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   403
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   404
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   405
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   406
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   407
    ^ self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   408
        specificationFor:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   409
        application:self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   410
        onDevice:nil
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   411
!
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   412
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   413
specificationFor:aKey application:app onDevice:deviceOrNil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   414
    "sent by the builder to ask for an application provided
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   415
     specification for a subcanvas or subspecification.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   416
     The argument, aKey comes from an UI-spec
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   417
     for a subcanvases #specification property (minorKey).
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   418
     Here, a corresponding message is sent to myself,
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   419
     which ought to be defined in the application subclass.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   420
     Alternatively, a subclass may redefine this method, to provide
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   421
     interfaceSpecifications from a Dictionary or whatever.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   422
     Typically, an interfaceSpecification is returned there."
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   423
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   424
    |displayDevice displayDeviceType modifiedKey appClass|
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   425
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   426
    "/ this code is so ugly...
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   427
    "/ translate the specs name, if the display device type is different
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   428
    "/ 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
   429
    displayDevice := deviceOrNil.
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   430
    displayDevice isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   431
        displayDevice := Screen current.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   432
        displayDevice isNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   433
            displayDevice := Screen default.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   434
        ]
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   435
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   436
    displayDevice notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   437
        displayDeviceType := displayDevice deviceType.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   438
        displayDeviceType notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   439
            modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   440
            modifiedKey notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   441
                (app respondsTo:modifiedKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   442
                    ^ app perform:modifiedKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   443
                ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   444
                app isBehavior ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   445
                    appClass := app application.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   446
                    (appClass respondsTo:modifiedKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   447
                        ^ appClass perform:modifiedKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   448
                    ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   449
                ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   450
            ]
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   451
        ]
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   452
    ].
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   453
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   454
    app isBehavior ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   455
        (app respondsTo:aKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   456
            ^ app perform:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   457
        ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   458
        appClass := app application.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   459
        (appClass respondsTo:aKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   460
            ^ appClass perform:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   461
        ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   462
        ^ app masterApplication specificationFor:aKey
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   463
    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   464
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   465
    ^ app perform:aKey
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   466
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   467
    "Modified: / 18-07-2011 / 09:28:15 / cg"
1115
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   468
!
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   469
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   470
subApplicationFor:aKey
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   471
    "sent by subCanvas to ask for an application inside itself.
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   472
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   473
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   474
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   475
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   476
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   477
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   478
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   479
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   480
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   481
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   482
    (app respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   483
        ^ app perform:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   484
    ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   485
    ^ nil
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   486
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   487
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   488
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   489
    "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
   490
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   491
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   492
     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
   493
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   494
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   495
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   496
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   497
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   498
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   499
    |app|
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   500
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   501
    app := self application.
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   502
    (app respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   503
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   504
    ].
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   505
    ^ app visualAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   506
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   507
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   508
!ApplicationModel class methodsFor:'change & update'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   509
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   510
update:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   511
    "flush resources on language changes"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   512
4189
d1e0e0a09c1c #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4186
diff changeset
   513
    (something == #Language or:[something == #LanguageTerritory]) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   514
        self flushAllClassResources
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   515
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   516
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   517
    "Created: 15.6.1996 / 15:13:29 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   518
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   519
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   520
!ApplicationModel class methodsFor:'defaults'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   521
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   522
defaultHttpServerPort
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   523
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   524
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   525
    ^ HTTPServer defaultPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   526
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   527
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   528
defaultIcon
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   529
    "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
   530
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   531
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   532
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   533
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   534
defaultIconForAboutBox
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   535
    "the icon to be shown in my about-this-app dialog"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   536
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   537
    ^ self defaultIcon
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   538
!
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   539
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   540
defaultServiceLinkName
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   541
    "old web server interface - remove me"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   542
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   543
    <resource: #obsolete>
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   544
    ^ '/portal'
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   545
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   546
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   547
labelAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   548
    "default is: no label (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
labelAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   554
    "default is: no label (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
labelAt: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
labels
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   568
visualAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   569
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   570
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   571
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   572
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   573
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   574
visualAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   575
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   576
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   577
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   578
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   579
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   580
visualAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   581
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   582
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   583
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   584
visuals
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   585
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   586
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   587
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   588
3307
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   589
!ApplicationModel class methodsFor:'font helpers'!
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   590
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   591
resolveFont:aSelector
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   592
    "resolve the font descriobed by aSelector.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   593
     Delegate to a WindowBuilder, whuch may forward to self fontOn:"
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   594
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   595
    |builder|
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   596
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   597
    builder := UIBuilder new isEditing:true; applicationClass:self.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   598
    ^ builder resolveFont:aSelector.
3307
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   599
! !
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   600
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   601
!ApplicationModel class methodsFor:'font specs'!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   602
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   603
buttonFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   604
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   605
    
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   606
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   607
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   608
    ^ Button defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   609
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   610
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   611
buttonFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   612
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   613
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   614
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   615
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   616
    ^ self bigFontFor:(self buttonFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   617
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   618
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   619
buttonFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   620
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   621
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   622
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   623
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   624
    ^ self smallFontFor:(self buttonFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   625
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   626
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   627
inputFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   628
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   629
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   630
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   631
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   632
    ^ EditField defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   633
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   634
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   635
inputFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   636
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   637
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   638
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   639
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   640
    ^ self smallFontFor:(self inputFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   641
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   642
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   643
labelFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   644
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   645
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   646
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   647
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   648
    ^ Label defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   649
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   650
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   651
labelFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   652
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   653
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   654
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   655
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   656
    ^ self bigFontFor:(self labelFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   657
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   658
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   659
labelFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   660
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   661
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   662
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   663
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   664
    ^ self smallFontFor:(self labelFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   665
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   666
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   667
listFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   668
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   669
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   670
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   671
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   672
    ^ SelectionInListView defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   673
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   674
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   675
listFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   676
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   677
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   678
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   679
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   680
    ^ self smallFontFor:(self listFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   681
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   682
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   683
menuFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   684
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   685
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   686
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   687
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   688
    ^ MenuView defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   689
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   690
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   691
textFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   692
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   693
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   694
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   695
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   696
    ^ TextView defaultFont  
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   697
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   698
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   699
textFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   700
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   701
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   702
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   703
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   704
    ^ self bigFontFor:(self textFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   705
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   706
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   707
textFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   708
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   709
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   710
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   711
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   712
    ^ self smallFontFor:(self textFont)
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   713
! !
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   714
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   715
!ApplicationModel class methodsFor:'help'!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   716
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   717
aboutImage
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   718
    "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
   719
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   720
    ^ self defaultIcon
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   721
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   722
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   723
aboutThisApplicationLabel
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   724
    "label for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   725
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   726
    ^ 'About This Application'
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   727
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   728
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   729
aboutThisApplicationText
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   730
    "text for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   731
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   732
    |rev clsRev msg|
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   733
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   734
    rev := ''.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   735
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   736
    (clsRev := self revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
3546
4d43beec43de #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   737
    msg := "'\' withCRs ," self applicationName allBold, rev.
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   738
    ^ msg
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   739
2981
da09f3d57773 changed: #aboutThisApplicationText
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
   740
    "Created: / 13-11-2001 / 12:28:36 / cg"
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   741
!
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   742
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   743
documentationPath
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   744
    |packageDir|
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   745
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   746
    packageDir := Smalltalk getPackageDirectoryForPackage:(self package).
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   747
    packageDir isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   748
        packageDir := Filename defaultDirectory
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   749
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   750
    #(
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   751
        'documentation'
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   752
        'doc'
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   753
    ) do:[:subDir |
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   754
        (packageDir construct:subDir) exists ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   755
            ^ packageDir construct:subDir
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   756
        ].
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   757
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   758
    ^ packageDir construct:'doc'
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   759
! !
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   760
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   761
!ApplicationModel class methodsFor:'history'!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   762
4239
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   763
defaultExtentFor:anApplicationClass
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   764
    "return a default extent for an app-class or nil.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   765
     If the user has the corresponding userPreference set,
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   766
     previous extents are remembered (at close time)
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   767
     and used as default for the next opening."
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   768
     
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   769
    DefaultExtents notNil ifTrue:[
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   770
        UserPreferences current shouldRememberLastExtent ifTrue:[
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   771
            ^ DefaultExtents at:anApplicationClass name ifAbsent:nil
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   772
        ].
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   773
        "/ flush remebered values
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   774
        DefaultExtents := nil.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   775
    ].
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   776
    ^ nil.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   777
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   778
    "Modified: / 31-07-2013 / 18:20:28 / cg"
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   779
!
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   780
3366
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   781
forgetDefaultExtentFor:anApplicationClass
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   782
    "forget the remembered last extent for some application class.
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   783
     This is sent by the UIPainter, when a windowspec is saved,
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   784
     to bring up the application with its possibly changed default extent"
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   785
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   786
    DefaultExtents notNil ifTrue:[
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   787
        DefaultExtents removeKey:anApplicationClass name ifAbsent:[]
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   788
    ]
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   789
!
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   790
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   791
forgetRecentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   792
    RecentlyOpenedApplications := nil
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   793
!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   794
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   795
recentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   796
    ^ RecentlyOpenedApplications ? #()
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   797
!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   798
4240
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   799
rememberLastExtentOf:aWindow
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   800
    "remember the last extent of aWindow.
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   801
     This will be used as default extent when the same app is opened the next time"
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   802
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   803
    self rememberLastExtentOf:aWindow for:self
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   804
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   805
    "Created: / 02-03-2019 / 13:08:53 / Claus Gittinger"
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   806
!
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   807
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   808
rememberLastExtentOf:aWindow for:anApplicationClass
4239
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   809
    "remember the last extent for some application class.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   810
     This will be used as default extent when the same app is opened the next time"
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   811
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   812
    DefaultExtents isNil ifTrue:[
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   813
        DefaultExtents := Dictionary new.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   814
    ].
4240
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
   815
    DefaultExtents at:anApplicationClass name put:(aWindow extent).
4239
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   816
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   817
    "Created: / 02-03-2019 / 13:02:55 / Claus Gittinger"
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   818
!
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
   819
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   820
rememberRecentlyOpenedApplication
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   821
    "support for the launcher's ''open recent...'' menu function.
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   822
     It is questionable, if dialogs should also be remembered
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   823
     (although it might be convenient dor developers)"
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   824
    
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   825
    |myName|
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   826
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   827
    myName := self name.
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   828
    RecentlyOpenedApplications isNil ifTrue:[
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   829
        RecentlyOpenedApplications := OrderedCollection new.
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   830
    ].
3882
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   831
    
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   832
    #FIXME.
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   833
    "/ wait for 2.12 with this - otherwise, we need a whole lot of retagging
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   834
    "/ due to the new SeqCollection...
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   835
    
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   836
    "/ RecentlyOpenedApplications removeAndAddFirst:myName.
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   837
    RecentlyOpenedApplications remove:(self name) ifAbsent:[].
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   838
    RecentlyOpenedApplications addFirst:(self name).
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   839
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   840
    "Modified: / 11-02-2017 / 15:05:20 / cg"
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   841
! !
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   842
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   843
!ApplicationModel class methodsFor:'private'!
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   844
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   845
bigFontFor:aFont
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   846
    |newSize|
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   847
    
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   848
    newSize := aFont size * 1.1.
3760
3ce893a0629d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3759
diff changeset
   849
    newSize := newSize ceiling asInteger.
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   850
    ^ aFont asSize:newSize.
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   851
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   852
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   853
selfResponsibleFor:aKey
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   854
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   855
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   856
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   857
    ^ self respondsTo:aKey
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   858
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   859
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   860
smallFontFor:aFont
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   861
    |newSize|
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   862
    
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   863
    newSize := aFont size * 0.9.
3760
3ce893a0629d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3759
diff changeset
   864
    newSize := newSize floor asInteger.
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   865
    ^ aFont asSize:newSize.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   866
! !
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   867
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   868
!ApplicationModel class methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   869
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   870
interfaceSpecFor:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   871
    "return an interface spec"
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   872
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   873
    |specOrSpecArray|
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   874
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   875
    specOrSpecArray := self application specificationFor:aSelector.
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   876
    specOrSpecArray isNil ifTrue:[^ nil].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   877
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   878
    "/ app could already return a decoded spec
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   879
    specOrSpecArray isCollection ifFalse:[^ specOrSpecArray].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   880
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   881
    "/ app returns a literal array
3678
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   882
    MissingClassInLiteralArrayErrorSignal
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   883
        handle:[:ex |
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   884
            |clsInMyNamespace className|
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   885
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   886
            className := ex missingClassName.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   887
            className isSymbol ifTrue:[
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   888
                "retry with my nameSpace"
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   889
                clsInMyNamespace := self nameSpace at:className.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   890
                clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   891
            ].
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   892
            self warn:ex description.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   893
            ex proceedWith:nil
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   894
        ]
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   895
        do:[
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   896
            ^ UISpecification from:specOrSpecArray
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   897
        ]
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   898
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   899
    "Modified: / 25-07-2010 / 10:36:53 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   900
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   901
2999
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   902
isAbstract
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   903
    ^ self == ApplicationModel
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   904
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   905
    "
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   906
     self isAbstract
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   907
    "
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   908
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   909
    "Created: / 02-03-2012 / 15:56:48 / cg"
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   910
!
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   911
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   912
isVisualStartable
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   913
    "return true, if this application can be started via #open.
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   914
     (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
   915
3811
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
   916
    self isAbstract ifTrue:[^ false].
1556
388922a9c6eb implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   917
    ((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
   918
"/    (self respondsTo:#windowSpec) ifFalse:[^ false].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   919
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   920
2999
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   921
    "Created: / 27-10-1997 / 16:38:02 / cg"
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   922
    "Modified: / 02-03-2012 / 15:57:02 / cg"
3192
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   923
!
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   924
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   925
shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   926
    "to be redefined by concrete applications:
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   927
     if true is answered, the application's extent is remembered on close
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   928
     and used as a default when opened the next time"
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   929
3207
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   930
    ^ UserPreferences current shouldRememberLastExtent
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   931
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   932
    "Modified: / 31-07-2013 / 18:12:07 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   933
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   934
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   935
!ApplicationModel class methodsFor:'resources'!
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
classResources
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   938
    "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
   939
4198
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   940
    |superPack parent|
4196
106ead5d5fef #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
   941
    
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   942
    ClassResources isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   943
        ClassResources := super classResources.
4196
106ead5d5fef #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
   944
        self ~~ ApplicationModel ifTrue:[
4198
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   945
            parent := self superclass.
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   946
            [parent package = self package] whileTrue:[
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   947
                parent := parent superclass.
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   948
            ].
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   949
            superPack := parent classResources.
4196
106ead5d5fef #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
   950
            ClassResources isNil ifTrue:[
106ead5d5fef #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
   951
                ClassResources := superPack.
106ead5d5fef #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4195
diff changeset
   952
            ] ifFalse:[
4197
68f77ed90b87 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4196
diff changeset
   953
                ClassResources addSuperPack:superPack.
4194
ea990b0d9a89 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4193
diff changeset
   954
            ]
4192
1d04ac054f3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4191
diff changeset
   955
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   956
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   957
    ^ ClassResources
4191
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   958
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   959
    "
4193
a28b62614895 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4192
diff changeset
   960
     ApplicationModel flushAllClassResources
4198
7962a1e2c4b0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
   961
     ApplicationModel classResources
4195
ed843e99ee41 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4194
diff changeset
   962
     MyApp classResources
4191
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   963
     WorkspaceApplication classResources
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   964
     Tools::NewSystemBrowser classResources
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   965
    "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   966
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   967
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   968
classResources:aResourcePack
4199
d74cea0df1a7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4198
diff changeset
   969
    "allow setting of the cached classResources"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   970
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   971
    ClassResources := aResourcePack
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   974
flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   975
    "flush all classes resource translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   976
     Needed after a resource file / language setting has changed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   977
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   978
    ResourcePack flushCachedResourcePacks.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   979
    self flushClassResources.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   980
    self allSubclassesDo:[:aClass |
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   981
        aClass flushClassResources.
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   982
    ].
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   983
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   984
    WindowGroup scheduledWindowGroups
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   985
        do:[:wg |
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   986
            |app|
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   987
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   988
            (app := wg application) notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   989
                app initializeResources
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   990
            ]
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
   991
        ]
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   992
4191
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   993
    "
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   994
     ApplicationModel flushAllClassResources
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   995
    "
9ebf6e85f1f6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4189
diff changeset
   996
    
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   997
    "Modified: / 13-09-2006 / 12:41:31 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   998
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   999
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1000
flushClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1001
    "flush classes resource string translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1002
     Needed whenever a resource file / language setting has changed"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1003
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1004
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1005
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1006
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1007
resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1008
    "return the application's resources -
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1009
     that's a ResourcePack containing national language strings"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1010
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1011
    ^ self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1012
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1013
    "Created: / 19-05-1998 / 20:14:00 / cg"
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1014
    "Modified (comment): / 25-11-2016 / 15:26:14 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1015
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1016
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1017
updateClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1018
    "update my classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1019
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1020
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1021
    self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1022
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1023
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1024
!ApplicationModel class methodsFor:'startup'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1025
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1026
open
3851
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  1027
    "create an instance of the application and open its view.
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  1028
     Sorry, but for visualworks compatibility, the builder is returned,
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  1029
     not the application instance"
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  1030
     
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
  1031
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1032
    ^ self new open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1033
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1034
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1035
     Launcher open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1036
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1037
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1038
    "Modified: 13.1.1997 / 20:54:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1039
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1040
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1041
openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1042
    "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
  1043
     at some position."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1044
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
  1045
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1046
    ^ self new openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1047
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1048
    "Modified: 14.2.1997 / 20:28:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1049
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1050
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1051
openDialogInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1052
    "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
  1053
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1054
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1055
    ^ self openDialogInterface:anInterfaceSymbol withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1056
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1057
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1058
    "Created: 14.2.1997 / 20:33:10 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1059
    "Modified: 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1060
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1061
4452
bc70545786e0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  1062
openDialogInterface:anInterfaceSymbolOrSpecOrSpecArray withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1063
    "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
  1064
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1065
4452
bc70545786e0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  1066
    ^ self new openDialogInterface:anInterfaceSymbolOrSpecOrSpecArray withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1067
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1068
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1069
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1070
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1071
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1072
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1073
openDialogInterfaceSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1074
    "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
  1075
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1076
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1077
    ^ self new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1078
        openDialogInterfaceSpec:anInterfaceSpec
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1079
        withBindings:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1080
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1081
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1082
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1083
    "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
  1084
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1085
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1086
    ^ self new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1087
        openDialogInterfaceSpec:anInterfaceSpec
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1088
        withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1089
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1090
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1091
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1092
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1093
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1094
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1095
openDialogSpec:aSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1096
    "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
  1097
     specified by aSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1098
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1099
    ^ self openDialogSpec:aSpec withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1100
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1101
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1102
    "Modified: / 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1103
    "Created: / 20.5.1998 / 20:27:08 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1104
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1105
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1106
openDialogSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1107
    "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
  1108
     specified by the spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1109
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1110
    ^ self new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1111
        openDialogSpec:aSpec
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1112
        withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1113
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1114
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1115
    "Modified: / 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1116
    "Created: / 20.5.1998 / 20:26:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1117
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1118
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1119
openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1120
    "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
  1121
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1122
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1123
    ^ self new openInterface:anInterfaceSymbol
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
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1126
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1127
!
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
openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1130
    "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
  1131
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1132
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1133
    ^ self new openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1134
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1135
    "Modified: 14.2.1997 / 20:28:47 / cg"
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
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1138
openLauncherOnInitializedDisplayNamed:displayName
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1139
    |display app wsClass|
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1140
4186
728710f3356f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  1141
    wsClass := #XWorkstation asClass.
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1142
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1143
    [
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1144
        display := wsClass newDispatchingFor:displayName.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1145
        display deviceIOErrorSignal handlerBlock:[:ex |
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1146
            'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1147
            display errorPrintCR.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1148
            display brokenConnection.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1149
        ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1150
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1151
        Screen currentScreenQuerySignal answer:display do:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1152
            Screen default isNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1153
                Smalltalk secureFileIn:'keyboard.rc'.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1154
                "/ Smalltalk secureFileIn:'display.rc'.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1155
                display buttonTranslation:#(1 2 2 4 5 6 7).
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1156
                Screen default:display.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1157
            ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1158
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1159
            app := NewLauncher new openAndWaitUntilVisible.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1160
            app windowGroup isNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1161
                "terminate event processor on error"
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1162
                display stopDispatch.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1163
                self error:'Cannot open'.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1164
            ] ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1165
                app windowGroup process addExitAction:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1166
                    "reset the default display"
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1167
                    Screen default == display ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1168
                        Screen default:nil.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1169
                    ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1170
                ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1171
            ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1172
        ]
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1173
    ] on:Screen deviceOpenErrorSignal do:[:ex|
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1174
        self error:('Cannot connect to display: <1s><br><2s>'
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1175
                        expandMacrosWith:displayName with:ex description).
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1176
    ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1177
    ^ app
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1178
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1179
    "Created: / 01-06-2010 / 11:23:52 / sr"
4186
728710f3356f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  1180
    "Modified: / 10-10-2018 / 00:39:49 / Claus Gittinger"
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1181
!
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1182
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1183
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1184
    "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
  1185
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1186
    ^ self new openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1187
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1188
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1189
openOn:anApplicationModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1190
    "send an open message to the argument, anApplicationModel.
3110
721f2bb58301 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3108
diff changeset
  1191
     I don't really understand what this method is useful for ..."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1192
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1193
    ^ anApplicationModel open
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
    "Modified: 13.1.1997 / 20:55:05 / cg"
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
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1199
    "create an instance of the application and open its view
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1200
     on ANOTHER device.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1201
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1202
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1203
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1204
    Screen currentScreenQuerySignal
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1205
        answer:aDevice
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1206
        do:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1207
            ^ (self onDevice:aDevice) open
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1208
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1209
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1210
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1211
     Launcher openOnDevice:Display
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1214
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1215
!
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
openOnXScreenNamed:aScreenName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1218
    "create an instance of the application and open its view
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1219
     on some X display screen. The argument aScreenName must be
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1220
     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
  1221
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1222
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1223
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1224
    |newDevice|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1225
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1226
    (XWorkstation notNil and:[ XWorkstation isLoaded ]) ifFalse:[
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1227
        self warn:(self resources string:'Could not open display: %1 (no XWorkstation class)' with:aScreenName).
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1228
        ^ self
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1229
    ].    
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1230
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1231
    [
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1232
        newDevice := XWorkstation newDispatchingFor:aScreenName.
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1233
    ] on:Screen deviceOpenErrorSignal do:[:ex|
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1234
        self warn:(self resources string:'Could not open display: %1' with:aScreenName).
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1235
        ^ self
995
63d1b9ce554b Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents: 983
diff changeset
  1236
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1237
    ^ self openOnDevice:newDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1238
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1239
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1240
     Launcher openOnXScreenNamed:'sgi:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1241
     Launcher openOnXScreenNamed:'foo:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1242
     NewLauncher openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1243
     NewLauncher openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1244
     SystemBrowser openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1245
     SystemBrowser openOnXScreenNamed:'bitsy:0'
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1246
     SystemBrowser openOnXScreenNamed:'localhost:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1247
    "
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
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1250
!
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
openWithSpec:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1253
    "ST80 compatibility:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1254
     mhmh - what is the difference to #openInterface ?"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1255
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1256
    ^ self openInterface:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1257
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1258
    "Modified: 29.8.1997 / 01:16:52 / cg"
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1259
! !
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1260
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1261
!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
  1262
3780
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1263
addRequiredForeignServicesTo:anHTTPServer
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1264
    "a hook to allow web apps to register additional services;
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1265
     typically: file services to deliver bitmaps"
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1266
     
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1267
    "/ intentionally left blank here;
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1268
    "/ to be redefined in subclasses
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1269
!
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1270
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1271
initialPageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1272
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1273
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1274
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1275
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1276
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1277
pageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1278
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1279
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1280
    ^ self windowSpec
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1281
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1282
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1283
pageSpecs
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1284
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1285
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1286
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1287
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1288
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1289
startAsWebService
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1290
    "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
  1291
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1292
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1293
     Answer the webService."
2604
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1294
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1295
    ^ self startAsWebService:(self webServiceLinkName)
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1296
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1297
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1298
     self startAsWebService
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1299
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1300
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1301
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1302
startAsWebService:linkName
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1303
    "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
  1304
     Start a web service for myself on link, an URL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1305
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1306
     Answer the webService.
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1307
     Start a HTTP server, if not already running"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1308
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1309
    ^ HTTPPortalService
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1310
        startWithApplication:self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1311
        link:linkName
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1312
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1313
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1314
     self startAsWebService:'hello'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1315
     UBS::UBSUsecase startAsWebService:'uuu'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1316
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1317
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1318
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1319
startAsWebService:linkName inServer:httpServer
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1320
    "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
  1321
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1322
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1323
     Answer the webService.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1324
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1325
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1326
    ^ HTTPPortalService
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1327
        startWithApplication:self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1328
        inServer:httpServer
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1329
        link:linkName
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1330
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1331
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1332
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1333
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1334
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1335
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1336
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1337
startAsWebService:linkName onPort:httpPort
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1338
    "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
  1339
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1340
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1341
     Answer the webService.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1342
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1343
3780
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1344
    |service httpServer|
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1345
    
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1346
    service := HTTPPortalService
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1347
            startWithApplication:self
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1348
            inServer:(httpServer := HTTPServer serverOnPort:httpPort)
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1349
            link:linkName.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1350
    self addRequiredForeignServicesTo:httpServer.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1351
    ^ service.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1352
    
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1353
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1354
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1355
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1356
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1357
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1358
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1359
startAsWebService_old
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1360
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1361
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1362
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1363
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1364
    app := self basicNew.
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  1365
    app initializeAsWebServiceOnWebDevice:(WebApplicationDevice new).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1366
    app startAsWebService.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1367
    ^ app
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1368
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1369
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1370
     PortalTests::TestApplication1 startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1371
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1372
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1373
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1374
startInPortalService:aPortalServiceOrSession
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1375
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1376
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1377
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1378
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1379
    app := self basicNew.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1380
    app setDevice:(WebApplicationDevice new).
2544
2df3456aa8f7 initialization if I am a webService
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  1381
    app initialize.
2543
df4bb767ea8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2542
diff changeset
  1382
    app initializeResources.
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1383
    app startInPortalService:aPortalServiceOrSession.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1384
    ^ app.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1385
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1386
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1387
     PortalTests::TestApplication1
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1388
        startInPortalService:
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1389
            (HTTPPortalService allInstances select:[:s | s httpServer port = 8080]) first
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1390
    "
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1391
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1392
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1393
webServiceLinkName
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1394
    "the link name, under which instances of myself are found in the httpServer"
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1395
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1396
    "/ typically, redefined as:
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1397
    ^ self name asLowercaseFirst
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1398
    "/ or
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1399
    "/  ^ 'ubs'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1400
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1401
"/    ^ self subclassResponsibility
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1402
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1403
3455
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1404
!ApplicationModel methodsFor:'Compatibility-VW'!
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1405
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1406
mainWindow
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1407
    ^ self window topView.
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1408
! !
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1409
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1410
!ApplicationModel methodsFor:'accessing'!
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
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1413
    "application knows about interfaceSpecs, menuSpecs etc.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1414
     Usually this is my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1415
     This may be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1416
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1417
    ^ self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1418
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1419
    "Modified: / 5.2.1998 / 00:45:21 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1420
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1421
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1422
builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1423
    "return the applications builder; this one has more information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1424
     about views, components etc."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1425
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1426
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1427
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1428
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1429
builder:aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1430
    "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
  1431
     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
  1432
     was created."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1433
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1434
    builder := aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1435
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1436
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1437
componentAt:name
2747
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1438
    "return a component identified by its name"
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1439
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1440
    ^ self builder componentAt:name
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1441
!
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1442
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1443
device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1444
    device isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1445
        self isWebService ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1446
            device := WebApplicationDevice new
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1447
        ]
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1448
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1449
    ^ device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1450
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1451
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1452
masterApplication
3279
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1453
    "return the master application, in which I am embedded, or nil, if I am the topmost application.
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1454
     Useful for embedded sub applications to access outer windows and/or bindings from the master"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1455
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1456
    ^ masterApplication
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1457
!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1458
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1459
masterApplication:anApplication
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1460
    "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
  1461
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1462
    anApplication == self ifTrue:[
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1463
        self proceedableError:'an application cannot be its own masterApplication'.
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1464
        ^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1465
    ].
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1466
    masterApplication := anApplication.
2566
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1467
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1468
    "/ ensure that the device is compatible.
2567
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1469
    masterApplication notNil ifTrue:[
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1470
        device := masterApplication device.
2567
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1471
    ].
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1472
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1473
    "Modified: / 24-05-2018 / 13:47:33 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1474
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1475
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1476
resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1477
    "return the application's resources -
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1478
     that's a ResourcePack containing national language strings.
4334
48983c9f9f3a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4333
diff changeset
  1479
     If I have a masterApplication, those resources are returned.
48983c9f9f3a #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4333
diff changeset
  1480
     The instvar 'resources' can be accessed safely (and faster), once the UI is open"
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1481
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1482
    resources isNil ifTrue:[
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1483
        masterApplication notNil ifTrue:[
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1484
            ^ masterApplication resources
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1485
        ].
4192
1d04ac054f3a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4191
diff changeset
  1486
        ^ self class classResources.
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1487
        "/ ^ ResourcePack new
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1488
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1489
    ^ resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1490
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1491
    "Modified (comment): / 25-11-2016 / 15:25:28 / cg"
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1492
    "Modified (comment): / 24-05-2018 / 13:43:11 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1493
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1494
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1495
resources:aResourcePack
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1496
    "set the application's resources - usually this is done automatically,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1497
     except for manually built dialogs"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1498
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1499
    resources := aResourcePack
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1500
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1501
    "Modified (comment): / 25-11-2016 / 15:25:36 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1502
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1503
3279
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1504
topMasterApplication
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1505
    "return the topmost master application. Useful when nested subapplications are used"
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1506
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1507
    masterApplication isNil ifTrue:[^ self].
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1508
    ^ masterApplication topMasterApplication
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1509
!
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1510
3256
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1511
topView
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1512
    "SimpleView compatibility - answer my topWindow"
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1513
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1514
    ^ self window
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1515
!
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1516
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1517
window
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1518
    "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
  1519
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1520
    |win|
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
    builder isNil ifTrue:[^ nil].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1523
    (win := builder window) notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1524
        ^ win
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1525
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1526
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1527
        masterApplication ~~ self ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1528
            "/ is that true ?
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1529
            ^ masterApplication window
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1530
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1531
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1532
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1533
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1534
    "Modified: / 18.9.1998 / 15:18:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1535
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1536
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1537
window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1538
    "set my topWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1539
     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
  1540
     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
  1541
     when the builder is accessed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1542
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1543
    builder isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1544
        self createBuilder
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1545
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1546
    builder window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1547
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1548
    "Created: 18.4.1996 / 14:55:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1549
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1550
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1551
windowGroup
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1552
    "return the applications windowGroup"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1553
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1554
    |myWindow wg|
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1555
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1556
    builder notNil ifTrue:[
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1557
        (myWindow := builder window) notNil ifTrue:[
3907
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1558
            ^ myWindow windowGroup.
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1559
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1560
"/ Disabled. Leads to Bug https://expeccoalm.exept.de/D179727
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1561
"/ (Reopen of on ExpeccoSettingsDialog for the second time opens an empty window)
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1562
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1563
"/            (wg := myWindow windowGroup) notNil ifTrue:[
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1564
"/                ^ wg
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1565
"/            ].
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1566
            #FIXME. "or at least: think about it"
3906
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1567
"/ Disabled. Leads to Bug https://expeccoalm.exept.de/D179727
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1568
"/ (Close on ExpeccoSettingsDialog closes also Expecco)
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1569
"/            "/ mhmh - it seems that a window was previously closed
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1570
"/            "/ but kept around, and is now reopened.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1571
"/            "/ So it lost its windowGroup.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1572
"/            "/ happens for example, when the expecco-guiBrowser is closed and reopened.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1573
"/            "/ Question is: is this to be fixed here, or should we look
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1574
"/            "/ at the place, where it is reopened...
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1575
"/            "/ for now, fix it on the fly if there is a master...
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1576
"/            "/ Don't do this unconditionally:
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1577
"/            "/ applications may (and do) run in a separate windowGroup
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1578
"/            "/ from the master - for example to allow interaction while the other
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1579
"/            "/ is busy.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1580
"/            "/ So please do not reassign the wg, to my builder, iff it is already
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1581
"/            "/ non-nil there (i.e. do not move the code below to the top of this method).
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1582
"/            masterApplication notNil ifTrue:[
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1583
"/                (wg := masterApplication windowGroup) notNil ifTrue:[
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1584
"/                    myWindow windowGroup:wg.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1585
"/                    ^ wg
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1586
"/                ].    
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1587
"/            ].    
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1588
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1589
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1590
    masterApplication notNil ifTrue:[
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1591
        ^ masterApplication windowGroup
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1592
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1593
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1594
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1595
    "Modified (comment): / 11-02-2017 / 11:46:37 / cg"
3195
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1596
!
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1597
4265
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1598
windowSensor
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1599
    "return the applications windowSensor"
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1600
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1601
    |windowGroup|
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1602
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1603
    windowGroup := self windowGroup.
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1604
    windowGroup isNil ifTrue:[
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1605
        ^ nil.
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1606
    ].
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1607
    ^ windowGroup sensor.
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1608
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1609
    "Created: / 14-05-2019 / 16:13:35 / Stefan Vogel"
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1610
!
664b7b5c72b2 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4256
diff changeset
  1611
3195
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1612
windowTitle:aString
3472
2baae8443032 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3455
diff changeset
  1613
    builder windowTitle:aString
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1614
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1615
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1616
!ApplicationModel methodsFor:'binding access'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1617
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1618
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1619
    "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
  1620
     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
  1621
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1622
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1623
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1624
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1625
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1626
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1627
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1628
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil action key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1629
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1630
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1631
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1632
            ^ masterApplication actionFor:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1633
        ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1634
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1635
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1636
    ^ MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1637
    "/ ^ [self perform:aKey]   "/ could use:  MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1638
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1639
    "Modified: / 28-07-2010 / 11:56:49 / cg"
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1640
    "Modified: / 06-06-2019 / 23:26:56 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1641
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1642
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1643
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1644
    "sent by the builder to ask for an actionBlock for
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1645
     a Button which passes a value.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1646
     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
  1647
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1648
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1649
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1650
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1651
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1652
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1653
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil action key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1654
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1655
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1656
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1657
            ^ masterApplication actionFor:aKey withValue:aValue
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1658
        ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1659
    ].
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1660
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1661
"/ sigh - too many senders of #isBlock around...
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1662
"/    ^ MessageSend receiver:self selector:aKey argument:aValue
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1663
     ^ [self perform:aKey with:aValue]
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1664
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1665
    "Modified: / 28-07-2010 / 11:56:42 / cg"
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1666
    "Modified: / 30-07-2010 / 10:40:35 / sr"
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1667
    "Modified: / 06-06-2019 / 23:27:03 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1668
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1669
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1670
actionFor:aKey withValue:value1 withValue:value2
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1671
    "sent by the builder to ask for an actionBlock for a Button which passes two values.
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1672
     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
  1673
     Here, a corresponding message is sent to myself,
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1674
     which ought to be defined in the application subclass.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1675
     Alternatively, a subclass may redefine this method, to provide
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1676
     actionBlocks from a Dictionary or whatever.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1677
     Typically, a block is returned there."
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1678
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1679
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil action key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1680
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1681
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1682
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1683
            ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1684
        ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1685
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1686
    ^ [self perform:aKey with:value1 with:value2]
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1687
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1688
    "Modified: / 06-06-2019 / 23:27:07 / Claus Gittinger"
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1689
!
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1690
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1691
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1692
    "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
  1693
     The argument, aKey comes from an UI-spec
4107
8145573ddce7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4098
diff changeset
  1694
     for a component's #aspect property.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1695
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1696
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1697
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1698
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1699
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1700
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1701
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil aspect key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1702
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1703
    masterApplication notNil ifTrue:[
4107
8145573ddce7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4098
diff changeset
  1704
        (self respondsTo:aKey) ifFalse:[
8145573ddce7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4098
diff changeset
  1705
            ^ masterApplication aspectFor:aKey
8145573ddce7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4098
diff changeset
  1706
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1707
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1708
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1709
4107
8145573ddce7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4098
diff changeset
  1710
    "Modified: / 18-06-1998 / 20:33:23 / cg"
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1711
    "Modified: / 06-06-2019 / 23:27:12 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1712
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1713
1742
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1714
aspectOrNil:aKey forSubApplication:aSubApp
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1715
    ^ nil
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1716
!
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1717
3515
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1718
aspectValueFor:aspectKeySymbol
3514
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1719
    "fetch an aspect's value
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1720
     same as (self aspectFor:aKey) value"
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1721
3515
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1722
    ^ (self aspectFor:aspectKeySymbol) value
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1723
!
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1724
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1725
aspectValueOr:default for:aspectKeySymbol
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1726
    "common helper - fetches the aspect value; 
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1727
     if it is nil, return a default."
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1728
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1729
    ^ (self aspectValueFor:aspectKeySymbol) ? default
3514
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1730
!
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1731
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1732
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1733
    "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
  1734
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1735
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1736
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1737
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1738
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1739
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1740
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1741
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1742
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1743
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil client key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1744
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1745
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1746
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1747
            ^ masterApplication clientFor:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1748
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1749
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1750
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1751
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1752
    "Modified: / 18-06-1998 / 20:33:30 / cg"
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1753
    "Modified: / 06-06-2019 / 23:27:17 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1754
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1755
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1756
colorFor:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1757
    "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
  1758
     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
  1759
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1760
     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
  1761
     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
  1762
     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
  1763
     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
  1764
     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
  1765
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1766
    (self respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1767
        ^ (self perform:aKey) value
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1768
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1769
    (self class respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1770
        ^ (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
  1771
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1772
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1773
        ^ masterApplication colorFor:aKey
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1774
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1775
    ^ self class colorFor:aKey.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1776
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1777
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1778
componentFor:aKey
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1779
    "sent by the builder to ask for a component 
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1780
     provided by the application.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1781
     The argument, aKey comes from an UI-spec
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1782
     for a viewHolder's #view property.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1783
     Here, a corresponding message is sent to myself,
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1784
     which ought to be defined in the concrete application class.
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1785
     Alternatively, a subclass may redefine this method, 
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1786
     to provide holders from a Dictionary or whatever.
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1787
     Typically, a view/widget is returned there."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1788
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1789
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil component key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1790
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1791
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1792
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1793
            ^ masterApplication componentFor:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1794
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1795
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1796
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1797
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1798
    "Modified: / 18-06-1998 / 20:33:36 / cg"
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1799
    "Modified: / 06-06-2019 / 23:27:22 / Claus Gittinger"
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  1800
    "Modified (comment): / 19-07-2019 / 11:23:47 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1801
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1802
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1803
fontFor:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1804
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1805
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1806
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1807
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1808
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1809
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1810
     holders from a Dictionary or whatever.
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1811
     Typically, a font is returned there.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1812
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1813
     Use #resolveFont:, if you are not a builder!!"
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1814
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1815
    (self respondsTo:aKey) ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1816
        ^ self perform:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1817
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1818
    (self class respondsTo:aKey) ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1819
        ^ self class perform:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1820
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1821
    masterApplication notNil ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1822
        ^ masterApplication fontFor:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1823
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1824
    ^ self class fontFor:aKey.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1825
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1826
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1827
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1828
    "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
  1829
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1830
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1831
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1832
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1833
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1834
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1835
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1836
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1837
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1838
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil label key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1839
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1840
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1841
        (self respondsTo:aKey) ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1842
            ^ masterApplication labelFor:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1843
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1844
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1845
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1846
    (self respondsTo:aKey) ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1847
        (self class respondsTo:aKey) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1848
            ^ self class perform:aKey
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1849
        ].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1850
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1851
    ^ self perform:aKey
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1852
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1853
    "Modified: / 06-06-2019 / 23:27:26 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1854
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1855
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1856
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1857
    "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
  1858
     holder for a list (for example, a popUpLists list).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1859
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1860
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1861
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1862
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1863
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1864
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1865
     Typically, a list-holding model (SelectionInList) is returned there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1866
     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
  1867
     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
  1868
     chance."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1869
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1870
    |a|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1871
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1872
    aKey isNil ifTrue:[ ArgumentError raiseErrorString:'nil list key' ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1873
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1874
    a := self aspectFor:aKey.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1875
    a notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1876
        ^ a
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1877
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1878
    ^ self application listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1879
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1880
    "Modified: / 18-06-1998 / 20:33:50 / cg"
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1881
    "Modified: / 06-06-2019 / 23:27:30 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1882
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1883
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1884
menuFor:key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1885
    "Sent by the builder to ask for an application provided
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1886
     holder for a menu. The argument, `key`, comes from an UI-spec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1887
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1888
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1889
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1890
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1891
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1892
     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
  1893
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1894
    | menu |
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1895
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1896
    key isNil ifTrue:[ ArgumentError raiseErrorString:'nil menu key' ].
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1897
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1898
    "/ Ask myself first...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1899
    (thisContext isRecursive not and:[ self respondsTo: key ]) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1900
        menu := self perform: key
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1901
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1902
        "/ Ask my class...
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1903
        (self class respondsTo: key) ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1904
            menu := self class perform: key
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1905
        ] ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1906
            "/ Ask masterApplication if any...
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1907
            masterApplication notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1908
                menu := masterApplication menuFor: key
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1909
            ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1910
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1911
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1912
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1913
    "/ If the provided menu is a menu spec, create Menu from it...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1914
    menu isArray ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1915
        menu :=  Menu decodeFromLiteralArray: menu.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1916
    ].
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1917
    ^ menu.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1918
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1919
    "Modified: / 18-06-1998 / 20:33:56 / cg"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1920
    "Modified: / 24-01-2014 / 09:46:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4277
4d081794c98c #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4275
diff changeset
  1921
    "Modified: / 06-06-2019 / 23:27:35 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1922
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1923
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1924
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1925
    "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
  1926
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1927
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1928
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1929
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1930
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1931
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1932
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1933
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1934
3811
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1935
    ^ self class
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1936
        specificationFor:aKey
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1937
        application:self
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1938
        onDevice:(self graphicsDevice)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1939
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1940
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1941
subApplicationFor:aKey
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1942
    "sent by subCanvas to ask for an application inside itself.
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1943
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1944
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1945
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1946
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1947
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1948
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1949
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1950
     (self respondsTo:aKey) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1951
         ^ self perform:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1952
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1953
     masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  1954
         ^ masterApplication subApplicationFor:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1955
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1956
     ^ nil.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1957
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1958
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1959
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1960
    "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
  1961
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1962
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1963
     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
  1964
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1965
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1966
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1967
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1968
     Typically, an image is returned there."
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
    ^ self application visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1971
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1972
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1973
!ApplicationModel methodsFor:'building'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1974
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1975
allButOpen
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1976
    "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
  1977
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1978
    ^ self allButOpenInterface:(self defaultWindowSpecName).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1979
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1980
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1981
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1982
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1983
allButOpenFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1984
    "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
  1985
     The argument is a spec which defines the interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1986
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1987
    |window|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1988
2691
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1989
    window notNil ifTrue:[
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  1990
        self proceedableError:'building twice (window is already built) ?'.
2691
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1991
    ].
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1992
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1993
"/ DISABLED; see comment in basicInitialize
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1994
"/
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1995
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1996
"/     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
  1997
"/     instance of the no-op WindowBuilder. Now, it becomes
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1998
"/     a UIBuilder ....
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1999
"/     This allows for ApplicationModels without a UIBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2000
"/     if not needed.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2001
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2002
"/    realBuilder := UIBuilder new.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2003
"/    builder := realBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2004
"/    builder application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2005
"/    builder bindings:builder bindings.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2006
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2007
    builder isNil ifTrue:[
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  2008
        self createBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2009
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2010
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2011
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2012
    builder buildWindowFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2013
    window := builder window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2014
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2015
    window model:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2016
    (window respondsTo:#application:) ifTrue:[
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  2017
        window application:self.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2018
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2019
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2020
    self showingHelp ifTrue: [ActiveHelp startFor: self].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2021
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2022
4094
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  2023
    "Modified: / 19-06-1998 / 03:35:31 / cg"
d648fee7bdb4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4093
diff changeset
  2024
    "Modified: / 24-05-2018 / 13:47:23 / Claus Gittinger"
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2025
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2026
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2027
allButOpenInterface:aSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2028
    "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
  2029
     The argument specifies a selector of a method,
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2030
     which when sent to myself should return a spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2031
     Notice, this returns the windowBuilder."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2032
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2033
    self allButOpenFrom:(self interfaceSpecFor:aSymbol).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2034
    ^ builder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2035
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2036
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2037
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2038
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2039
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2040
    "build a subcanvases spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2041
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2042
    |sameAppAsTopApp prevSpec prevSource|
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2043
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2044
    aBuilder notNil ifTrue:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2045
        prevSpec := aBuilder spec.
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2046
        prevSource := aBuilder source.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2047
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2048
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2049
    builder isNil ifTrue:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2050
        builder := aBuilder.
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2051
        aBuilder isNil ifTrue:[
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2052
            self createBuilder
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2053
        ]
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2054
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2055
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2056
    aBuilder source:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2057
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2058
    "/ if the subcanvases appModel is NOT the same as
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2059
    "/ the topApp, it must be pre/post-built.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2060
    "/ Otherwise, we invoke pre/post-builtAsSubcanvas.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2061
    "/ which provides a hook for redefinition in concrete appModels.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2062
    "/ This avoids invoking pre/postBuild twice for subCanvases which
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2063
    "/ have the topApp as appModel.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2064
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2065
    sameAppAsTopApp := aBuilder application == aBuilder window topView application.
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2066
    sameAppAsTopApp ifTrue:[
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2067
        self preBuildAsSubcanvasWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2068
    ] ifFalse:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2069
        self preBuildWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2070
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2071
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2072
    aBuilder buildFromSpec:specToBuild.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2073
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2074
    sameAppAsTopApp ifTrue:[
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2075
        self postBuildAsSubcanvasWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2076
    ] ifFalse:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2077
        self postBuildWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2078
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2079
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2080
    prevSpec notNil ifTrue:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2081
        "/ restore state in builder if original builder was used
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2082
        aBuilder spec:prevSpec.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2083
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2084
    prevSource notNil ifTrue:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2085
        "/ restore state in builder if original builder was used
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2086
        aBuilder source:prevSource.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2087
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2088
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2089
    ^ aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2090
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2091
    "Created: / 18-06-1998 / 20:08:45 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2092
    "Modified: / 27-10-2006 / 11:45:25 / cg"
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  2093
    "Modified (format): / 22-05-2018 / 18:12:20 / Claus Gittinger"
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2094
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2095
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2096
buildSubCanvas:spec withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2097
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2098
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2099
    self buildSubCanvas:spec withMenu:false withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2100
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2101
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2102
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2103
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2104
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2105
    |specToBuild|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2106
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2107
    specToBuild := spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2108
    withMenuBoolean ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2109
        "/ subapps should not build the menu and other fullSpec stuff.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2110
        spec class == FullSpec ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2111
            specToBuild := spec component.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2112
        ]
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2113
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2114
    self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2115
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2116
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2117
!ApplicationModel methodsFor:'component manipulations'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2118
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2119
components:aSymbolOrArray do:aBlock
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  2120
    "evaluate aBlock for all components listed as aSymbolOrArray."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2121
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2122
    |coll|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2123
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2124
    aSymbolOrArray isSymbol ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2125
        "/ a single components name
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2126
        coll := Array with:aSymbolOrArray
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2127
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2128
        coll := aSymbolOrArray
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2129
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2130
    coll do:[:aSymbol |
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2131
        |component|
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2132
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2133
        (component := self componentFor:aSymbol) isNil ifFalse:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2134
            aBlock value:component
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2135
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2136
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2137
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  2138
    "Modified: / 26-03-1997 / 16:23:14 / cg"
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  2139
    "Modified (comment): / 19-07-2019 / 11:24:07 / Claus Gittinger"
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
disable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2143
    "disable the components whose id's are aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2144
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2145
    self components:aSymbolOrArray do:[:comp | comp disable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2146
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2147
    "Modified: 14.2.1997 / 17:32:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2148
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2149
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2150
enable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2151
    "enables the component(s) identified by aSymbolOrArray."
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
    self components:aSymbolOrArray do:[:comp | comp enable]
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
    "Modified: 14.2.1997 / 17:32:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2156
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2157
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2158
invalidate:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2159
    "invalidates the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2160
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2161
    self components:aSymbolOrArray do:[:comp | comp invalidate]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2162
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2163
    "Modified: 14.2.1997 / 17:32:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2164
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2165
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2166
makeInvisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2167
    "makes the components whose id's are aSymbolOrArray invisible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2168
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2169
    self components:aSymbolOrArray do:[:comp | comp beInvisible]
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
    "Modified: 14.2.1997 / 17:32:42 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2174
makeReadOnly:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2175
    "make all components identified by aSymbolOrArray read only
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2176
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2177
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2178
    self components:aSymbolOrArray do:[:comp | comp readOnly:true]
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
    "Modified: 14.2.1997 / 17:36:22 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2183
makeVisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2184
    "makes the components whose id's are aSymbolOrArray visible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2185
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2186
    self components:aSymbolOrArray do:[:comp | comp beVisible]
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
    "Modified: 14.2.1997 / 17:32:52 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2191
makeWritable:aSymbolOrArray
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2192
    "make all components identified by aSymbolOrArray writable
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2193
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2194
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2195
    self components:aSymbolOrArray do:[:comp | comp readOnly:false]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2196
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2197
    "Created: 14.2.1997 / 17:36:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2198
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2199
4268
8a9c9976bce1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4265
diff changeset
  2200
!ApplicationModel methodsFor:'copying-private'!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2201
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2202
postCopy
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2203
    builder := device := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2204
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2205
    "Created: / 19.4.1998 / 11:44:44 / cg"
2053
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2206
!
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2207
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2208
postDeepCopy
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2209
    builder := device := nil.
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2210
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2211
    "Created: / 19.4.1998 / 11:44:44 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2212
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2213
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2214
!ApplicationModel methodsFor:'delayed actions (enqueue)'!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2215
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2216
delayedUpdate:something with:aParameter from:changedObject
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2217
    "support for delayed updates -
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2218
     subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:)
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2219
     must also redefine this method, and perform the actual update there."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2220
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2221
    ^ self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2222
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2223
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2224
enqueueDelayedAction:aBlock
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2225
    "This will enqueue a delayed action - the application-process will
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2226
     eventually execute aBlock.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2227
     Useful for synchronization"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2228
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2229
    ^ self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2230
        enqueueMessage:#value
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2231
        for:aBlock
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2232
        arguments:#().
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2233
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2234
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2235
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2236
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2237
enqueueDelayedUpdate:something with:aParameter from:changedObject
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2238
    "support for delayed updates - to be invoked from a concrete classes
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2239
     #update:with:from: method.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2240
     This will enqueue a delayed update, and resend #delayedUpdate:with:from:
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2241
     whenever the receiver is handling events.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2242
     Especially useful, if many updates arrive at high frequency, to avoid
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2243
     multiple redraws."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2244
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2245
    ^ self
3448
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2246
        enqueueMessage:#delayedUpdate:with:from:
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2247
        for:self
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2248
        arguments:{ something . aParameter . changedObject }.
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2249
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2250
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2251
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2252
3542
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2253
enqueueMessage:selector 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2254
    "enqueue a message without arguments to be sent to myself later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2255
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2256
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2257
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2258
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2259
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2260
    self enqueueMessage:selector for:self arguments:#()
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2261
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2262
3971
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2263
enqueueMessage:selector argument:arg
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2264
    "enqueue a message without arguments to be sent to myself later, 
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2265
     when my process is back in its eventLoop. Also, filter duplicates.
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2266
     This is useful, to buffer redraws and avoid flicker due to multiple
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2267
     redraws (especially in browsers, when reacting on changeMessages resulting
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2268
     from changes made in other browsers)"
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2269
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2270
    self enqueueMessage:selector for:self arguments:{arg}
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2271
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2272
    "Created: / 21-08-2017 / 16:37:09 / cg"
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2273
!
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2274
3542
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2275
enqueueMessage:selector arguments:argumentArray 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2276
    "enqueue a message to be sent to myself later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2277
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2278
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2279
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2280
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2281
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2282
    self enqueueMessage:selector for:self arguments:argumentArray
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2283
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2284
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2285
enqueueMessage:selector for:someone 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2286
    "enqueue a message without arguments to be sent to someone later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2287
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2288
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2289
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2290
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2291
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2292
    self enqueueMessage:selector for:someone arguments:#()
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2293
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2294
3971
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2295
enqueueMessage:selector for:someone argument:arg
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2296
    "enqueue a message without arguments to be sent to someone later, 
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2297
     when my process is back in its eventLoop. Also, filter duplicates.
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2298
     This is useful, to buffer redraws and avoid flicker due to multiple
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2299
     redraws (especially in browsers, when reacting on changeMessages resulting
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2300
     from changes made in other browsers)"
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2301
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2302
    self enqueueMessage:selector for:someone arguments:{ arg }
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2303
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2304
    "Created: / 21-08-2017 / 16:36:49 / cg"
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2305
!
192921e468df #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3955
diff changeset
  2306
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2307
enqueueMessage:selector for:someone arguments:argList
3542
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2308
    "enqueue a message to be sent to someone later, when my process
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2309
     is back in its eventLoop. Also, filter duplicates.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2310
     This is useful, to buffer redraws and avoid flicker due to multiple
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2311
     redraws (especially in browsers, when reacting on changeMessages resulting
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2312
     from changes made in other browsers)"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2313
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2314
    |window sensor|
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2315
2561
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2316
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2317
    self isWebService ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2318
        self breakPoint:#sr.
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2319
        ^ self
2561
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2320
    ].
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2321
3527
sr
parents: 3524
diff changeset
  2322
    ((window := self window) notNil and:[window isOpen]) ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2323
        sensor := window sensor.
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2324
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2325
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2326
    sensor isNil ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2327
        "no window (yet or any longer)"
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2328
        someone perform:selector withArguments:argList.
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2329
        ^ self.
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2330
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2331
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2332
    "/
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2333
    "/ if such a message is already in the queue, ignore it.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2334
    "/ 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
  2335
    "/ back in the event loop.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2336
    "/
3448
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2337
    sensor enqueueMessage:selector for:someone arguments:argList
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2338
2902
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2339
    "Created: / 26-02-2000 / 18:01:31 / cg"
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2340
    "Modified: / 23-03-2011 / 19:46:41 / cg"
4154
3aff5b534471 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4152
diff changeset
  2341
    "Modified: / 02-08-2018 / 17:15:59 / Claus Gittinger"
3543
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2342
!
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2343
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2344
enqueueMessage:selector with:argument 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2345
    "enqueue a message with one argument to be sent to myself later, 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2346
     when my process is back in its eventLoop. Also, filter duplicates.
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2347
     This is useful, to buffer redraws and avoid flicker due to multiple
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2348
     redraws (especially in browsers, when reacting on changeMessages resulting
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2349
     from changes made in other browsers)"
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2350
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2351
    self enqueueMessage:selector for:self arguments:{ argument }
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2352
!
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2353
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2354
enqueueMessage:selector with:argument1 with:argument2
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2355
    "enqueue a message with one argument to be sent to myself later, 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2356
     when my process is back in its eventLoop. Also, filter duplicates.
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2357
     This is useful, to buffer redraws and avoid flicker due to multiple
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2358
     redraws (especially in browsers, when reacting on changeMessages resulting
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2359
     from changes made in other browsers)"
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2360
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2361
    self enqueueMessage:selector for:self arguments:{ argument1. argument2 }
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2362
! !
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2363
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2364
!ApplicationModel methodsFor:'drag & drop'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2365
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2366
canDropObjects:aCollectionOfDropObjects
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2367
    "drop manager asked if a drop is possible
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2368
     - 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
  2369
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2370
    ^ false
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2371
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2372
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2373
canDropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2374
    "drop manager asked if a drop is possible
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2375
     - should be redefined by apps which can do it, to return true"
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2376
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2377
    ^ self canDropObjects:aCollectionOfDropObjects
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2378
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2379
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2380
canDropObjects:aCollectionOfDropObjects in:aComponent at:position
2405
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2381
    "drop manager asked if a drop is possible.
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2382
     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
  2383
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2384
    ^ self canDropObjects:aCollectionOfDropObjects in:aComponent
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2385
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2386
    "Created: / 13-10-2006 / 15:52:20 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2387
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2388
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2389
dropObjects:aCollectionOfDropObjects
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2390
    "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
  2391
     This is ony sent, if #canDrop: returned true.
2865
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2392
     Must be redefined in order for drop to work."
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2393
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2394
    ^ self subclassResponsibility
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2395
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2396
    "Created: / 13-10-2006 / 18:25:06 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2397
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2398
4183
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2399
dropObjects:aCollectionOfDropObjects at:aPointOrNil
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2400
    "drop manager wants to drop.
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2401
     This is ony sent, if #canDropObjects: returned true.
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2402
     Must be redefined in order for drop to work."
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2403
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2404
    ^ self dropObjects:aCollectionOfDropObjects.
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2405
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2406
    "Created: / 28-09-2018 / 12:07:00 / Stefan Vogel"
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2407
!
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2408
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2409
dropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2410
    "drop manager wants to drop.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2411
     This is ony sent, if #canDrop: returned true.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2412
     Must be redefine in order for drop to work."
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2413
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2414
    ^ self dropObjects:aCollectionOfDropObjects
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2415
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2416
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2417
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2418
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2419
    "drop manager wants to drop.
4183
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2420
     This is ony sent, if #canDropObjects:in: returned true.
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2421
     Can be redefined in apps which return true to #canDropObjects:."
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2422
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2423
    ^ self dropObjects:aCollectionOfDropObjects in:aComponent
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2424
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2425
    "Created: / 13-10-2006 / 18:25:13 / cg"
4183
a40f88ee0673 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4182
diff changeset
  2426
    "Modified (comment): / 28-09-2018 / 14:26:18 / Stefan Vogel"
2824
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2427
!
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2428
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2429
droppedFile:aFilename in:aComponent
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2430
    "ignored here - only sent by textView components, sometimes"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2431
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2432
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2433
!ApplicationModel methodsFor:'easy bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2434
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2435
registerInterestIn:aValueModel using:aSelectorOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2436
    "Register interest in a change in aValueModel using information in aSelectorOrArray.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2437
     aSelectorOrArray can be one of three things:
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2438
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2439
            1) nil                  in which case no interest is registered
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2440
            2) a selector           in which case the receiver is understood to be self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2441
            3) an Array             in which case the size is two where the first element is the
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2442
                                    message to be sent and the second element is the receiver."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2443
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2444
    aSelectorOrArray isNil ifTrue:[^ aValueModel].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2445
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2446
    (aSelectorOrArray isArray) ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2447
        aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2448
    ] ifFalse: [
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2449
        aValueModel onChangeSend:aSelectorOrArray to:self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2450
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2451
    ^aValueModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2452
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2453
    "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
  2454
!
3764f680134d allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  2455
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2456
valueHolderFor:aSelector initialValue:anObject
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2457
    "Return a ValueHolder on anObject."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2458
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2459
    ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2460
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2461
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2462
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2463
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2464
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2465
    "Return a ValueHolder on anObject.  aSelectorOrArrayOrNil is the change information
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2466
     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2467
     If it is a Symbol, then it is the change message and the interested object is understood
3738
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2468
     to be the receiver.  If it is an Array, then the first element is the change message and
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2469
     the second element is the interested object. "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2470
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2471
    |holder|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2472
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2473
    (builder bindings includesKey:aSelector) ifFalse:[
3738
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2474
        holder := ValueHolder with:anObject.
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2475
        builder aspectAt:aSelector put:holder.
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2476
        aSelectorOrArrayOrNil notNil ifTrue:[
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2477
            ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2478
        ].
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2479
        ^ holder
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2480
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2481
    ^ builder aspectAt:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2482
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2483
    "Modified: / 21.5.1998 / 03:31:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2484
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2485
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2486
!ApplicationModel methodsFor:'forced actions'!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2487
4289
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2488
close
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2489
    "this is sent by my topView when about to be closed
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2490
     by the program (not by the windowManager).
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2491
     Notice, that we get a closeRequest message if closed by the windowManager,
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2492
     which can be rejected by the app (or confirmed via a dialog)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2493
     Could be redefined in subclasses."
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2494
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2495
    self closeDownViews
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2496
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2497
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2498
closeDownViews
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2499
    "close down the application's view(s)"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2500
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2501
    <modifier: #super> "must be called if redefined"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2502
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2503
    |wg wgProcess window|
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2504
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2505
    self release.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2506
    ActiveHelp stopFor:self.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2507
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2508
    self shouldRememberLastExtent ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2509
        self rememberLastExtent.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2510
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2511
    wg := self windowGroup.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2512
    (wg notNil and:[wg isModal not]) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2513
        wgProcess := wg process.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2514
        (wgProcess notNil and:[Processor activeProcess ~~ wgProcess]) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2515
            wgProcess terminate
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2516
        ] ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2517
            wg closeDownViews.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2518
        ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2519
        ^ self.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2520
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2521
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2522
    window := self window.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2523
    window notNil ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2524
        window destroy.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2525
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2526
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2527
    "Modified: / 08-02-2017 / 00:24:14 / cg"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2528
    "Modified: / 03-03-2017 / 12:00:22 / stefan"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2529
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2530
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2531
closeRequest
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2532
    "this is sent by my topView when about to be closed by the windowManager.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2533
     Could be redefined in subclasses to suppress close or confirm."
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2534
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2535
    <modifier: #super> "must be called if redefined"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2536
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2537
    |sav window|
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2538
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2539
    window := self window.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2540
    window isNil ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2541
        'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2542
        ^ self
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2543
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2544
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2545
    window isTopView ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2546
        window topView isModal ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2547
            WindowGroup leaveSignal raise.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2548
        ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2549
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2550
        'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2551
        ^ self
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2552
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2553
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2554
    "/ In multiView apps, tell my master.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2555
    "/ (but not if I am a modal reincarnation)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2556
    (masterApplication notNil
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2557
    and:[window isModal not]) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2558
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2559
        "/ temporary clear my masterApplication to prevent
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2560
        "/ endless recursion, in case the master sends me
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2561
        "/ a closeRequest (although, it is supposed to
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2562
        "/ send me a closeDownViews ...)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2563
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2564
        sav := masterApplication.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2565
        masterApplication := nil.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2566
        sav closeRequestFor:window.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2567
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2568
        "/ restore - in case master did not want me to close ...
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2569
        masterApplication := sav.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2570
    ] ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2571
        "/ ST/X does close-check by redefining this message without
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2572
        "/ a supersend;
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2573
        "/ VW does it by returning false from requestForWindowClose
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2574
        "/ sigh.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2575
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2576
        self requestForWindowClose ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2577
            window isSlave ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2578
                window destroy
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2579
            ] ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2580
                self closeDownViews
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2581
            ]
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2582
        ]
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2583
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2584
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2585
    "Modified: / 08-02-2017 / 00:25:11 / cg"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2586
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2587
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2588
closeRequestFor:aTopView
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2589
    "this is sent by any of my topViews when about to be closed by the
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2590
     windowmanager. For backward compatibility with single-view applications,
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2591
     this is forwarded here to a simple (non topView-specific) closeRequest,
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2592
     effectively closing all of my views.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2593
     MultiView applications should redefine this method if closing of individual
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2594
     views closing is to be caught and/or should not close all of them."
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2595
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2596
    |savedMaster myWindow|
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2597
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2598
    myWindow := self window.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2599
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2600
    "/ In multiView apps, tell my master.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2601
    "/ (but not if I am a modal reincarnation)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2602
    (masterApplication notNil
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2603
    and:[myWindow topView isModal not]) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2604
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2605
        "/ temporary clear my masterApplication to prevent
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2606
        "/ endless recursion, in case the master sends me
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2607
        "/ a closeRequest (although, it is supposed to
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2608
        "/ send me a closeDownViews ...)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2609
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2610
        savedMaster := masterApplication.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2611
        masterApplication := nil.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2612
        aTopView isSlave ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2613
            savedMaster closeRequestFor:aTopView.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2614
        ] ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2615
            savedMaster closeRequestFor:myWindow.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2616
        ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2617
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2618
        "/ restore - in case master did not want me to close ...
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2619
        masterApplication := savedMaster.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2620
        ^ self
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2621
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2622
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2623
    (aTopView == myWindow) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2624
        self closeRequest.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2625
        ^ self
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2626
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2627
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2628
    (aTopView isPartner or:[aTopView isMaster]) ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2629
        aTopView application closeRequest.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2630
        self closeRequest.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2631
        ^ self.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2632
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2633
    aTopView isSlave ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2634
        aTopView closeRequest
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2635
    ] ifFalse:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2636
        aTopView application closeRequest.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2637
    ]
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2638
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2639
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2640
doAccept
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2641
    "this is invoked by the Return-Key (if returnIsOK) or
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2642
     the ok-button (if any), IFF the application has been
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2643
     opened modal (i.e. as a dialog)."
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2644
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2645
    "/ the following is a bad kludge -
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2646
    "/ actually, modal apps should inherit from SimpleDialog
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2647
    "/ (then, things would be clean)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2648
    "/ However, it may be useful, to open some app (which is normally
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2649
    "/ modeless) as a modal one as well.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2650
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2651
    "/ to remember the accept vs. cancel case.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2652
    "/
4460
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2653
    self window isModal ifFalse:[
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2654
        ^ self.
4289
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2655
    ].
4460
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2656
    
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2657
    (masterApplication notNil 
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2658
     and:[masterApplication window isModal
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2659
     and:[masterApplication window topView == self window topView]]) ifTrue:[
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2660
        masterApplication doAccept.
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2661
        ^ self.
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2662
    ].
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2663
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2664
    "/ mhmh - is this a good idea ?
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2665
    self perform:#accept ifNotUnderstood:[self closeRequest].
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2666
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  2667
    "Modified: / 29-04-2020 / 13:19:30 / Stefan Vogel"
4289
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2668
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2669
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2670
doAcceptByReturnKey
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2671
    |acceptAction|
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2672
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2673
    builder notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2674
        acceptAction := builder bindingAt:#doAccept.
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2675
    ].
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2676
    acceptAction notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2677
        acceptAction value
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2678
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2679
        self doAccept
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2680
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2681
!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2682
4289
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2683
doCancel
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2684
    "this is invoked by the Escape-Key (if escapeIsCancel) or
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2685
     the cancel-button (if any), IFF the application has been
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2686
     opened modal (i.e. as a dialog)."
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2687
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2688
    "/ the following is a bad kludge -
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2689
    "/ actually, modal apps should inherit from SimpleDialog
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2690
    "/ (then, things would be clean)
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2691
    "/ However, it may be useful, to open some app (which is normally
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2692
    "/ modeless) as a modal one as well.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2693
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2694
    "/ to remember the accept vs. cancel case.
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2695
    "/
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2696
    self window isModal ifTrue:[
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2697
        "/ mhmh - is this a good idea ?
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2698
        self perform:#cancel ifNotUnderstood:[self closeRequest].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2699
        ^ self
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2700
    ].
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2701
    ^ self      "/ nothing done here ...
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2702
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  2703
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2704
doCancelByEscapeKey
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2705
    |cancelAction|
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2706
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2707
    builder notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2708
        cancelAction := builder bindingAt:#doCancel.
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2709
    ].
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2710
    cancelAction notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2711
        cancelAction value
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2712
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2713
        self doCancel
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2714
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2715
! !
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2716
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2717
!ApplicationModel methodsFor:'help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2718
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2719
aboutImage
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2720
    "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
  2721
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2722
    ^ self class aboutImage
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2723
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2724
    "Modified: / 13.11.2001 / 12:32:44 / cg"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2725
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2726
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2727
aboutThisApplicationLabel
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2728
    "label for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2729
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2730
    ^ self class aboutThisApplicationLabel
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2731
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2732
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2733
aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2734
    "text for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2735
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2736
    ^ self class aboutThisApplicationText
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2737
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2738
3240
d1f8004ad752 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  2739
activeHelpViewFor:text onDevice:aDevice
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2740
    "redefinable to allow for applications to provide their own active help
3239
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2741
     (aka tooltip) bubble window"
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2742
3240
d1f8004ad752 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  2743
    ^ ActiveHelpView for:text onDevice:aDevice
3239
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2744
!
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2745
2520
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2746
flyByHelpDependsOnPositionIn:aView
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2747
    "subclasses where the help-text depends upon the pointer position might
4369
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2748
     want to redefine this. If true is returned, the flyByHelp watcher will
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2749
     ask for the help text with every button motion.
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2750
     Otherwise, it will only ask on enter."
2520
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2751
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2752
    ^ false
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2753
!
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2754
4391
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2755
helpKeyPressed
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2756
    "called by <F1>"
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2757
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2758
    self openDocumentation
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2759
!
87ceb93d9ad1 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4384
diff changeset
  2760
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2761
openAboutThisApplication
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2762
    "opens an about box for this application.
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2763
     Can be specialized by redefining #aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2764
     and #aboutThisApplicationLabel"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2765
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2766
    Dialog
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2767
        about:(self translateString:self aboutThisApplicationText)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2768
        label:(self translateString:self aboutThisApplicationLabel)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2769
        icon:self aboutImage
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2770
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2771
    "Modified: / 17.11.2001 / 23:05:52 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2772
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2773
4369
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2774
openDocumentation
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2775
    "called by <F1> to open the default documentation.
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2776
     Empty here."
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2777
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2778
    self openAboutThisApplication
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2779
!
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2780
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2781
openHelpViewOnFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2782
    "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
  2783
     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
  2784
     (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
  2785
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2786
    self withWaitCursorDo:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2787
        HTMLDocumentView openFullOnHelpFile:pathToHelpText
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2788
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2789
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2790
!
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
showActiveHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2793
    "This is invoked from the activeHelp event listener, to display some popup-help
4113
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2794
     for a component. 
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2795
     If false is returned, the help manager will pop up
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2796
     some active help bubble; 
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2797
     if true is returned, it will assume that the
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2798
     help text has been already displayed and will not do any further actions.
4113
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2799
     
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2800
     Here, we accept the help text, and push an event into out own input
3764
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2801
     queue, so that the help text will be displayed asynchronously by myself,
4113
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2802
     via the #showHelp:for: method, and return true. Always.
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2803
     In theory, this can be redefined in concrete classes to handle active help differently."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2804
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2805
    |wg mySensor|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2806
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2807
    self showingHelp ifFalse: [
3764
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2808
        ^ true
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2809
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2810
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2811
    "/ NEW: push it into the event queue, to have it displayed
3955
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2812
    "/ synchronously with other events.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2813
    "/ (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
  2814
    "/  instead of occurring in the activeHelp context).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2815
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2816
    (wg := self windowGroup) notNil ifTrue:[
3764
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2817
        mySensor := wg sensor.
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2818
        mySensor notNil ifTrue:[
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2819
            mySensor flushEventsFor:self withType:#showHelp:for:.
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2820
            mySensor
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2821
                pushUserEvent:#showHelp:for: for:self
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2822
                withArguments:(Array with:aHelpText with:view).
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2823
            ^ true
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2824
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2825
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2826
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2827
    "/ mhmh - can this happen ?
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2828
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2829
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2830
3955
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2831
    "Modified: / 21-08-1998 / 16:00:37 / cg"
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2832
    "Modified (comment): / 22-05-2017 / 12:07:03 / mawalch"
4113
4db6a70e34a4 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4112
diff changeset
  2833
    "Modified (comment): / 07-06-2018 / 10:45:44 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2834
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2835
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2836
showHelp:aHelpText for:view
4369
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2837
    "actual method which is supposed to display the tooltip help text.
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  2838
     Should be redefined in concrete classes, to put the tooltip text
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2839
     into some info label, or the windows title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2840
     Here, the help text is ignored."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2841
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2842
    masterApplication notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  2843
        masterApplication showHelp:aHelpText for:view
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2844
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2845
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2846
    "Modified: / 31.7.1998 / 19:13:59 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2847
!
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
showingHelp
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2850
    "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
  2851
     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
  2852
     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
  2853
     These should be redefined to put the help text into some info label,
3791
b524b306f7c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
  2854
     or into the view's title bar.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2855
     You may also redefine the showingHelp/showingHelp: methods, to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2856
     remember the flag setting."
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
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2859
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2860
    "Modified: / 31.7.1998 / 17:55:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2861
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2862
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2863
!ApplicationModel methodsFor:'help - presentations'!
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2864
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2865
showMeHowItWorks
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2866
    "present the default show, from a file named <majorKey>_<lang>.show.
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2867
     The major key defaults to the classes name."
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2868
     
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2869
    self showMeHowItWorks:nil
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2870
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2871
"<<END
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2872
    ShowMeHowItWorks do: #(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2873
        show: 'this little show demonstrates how to open a class browser'
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2874
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2875
        intro
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2876
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2877
        (unless: ( isEmpty: ReceiverEditor ) do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2878
            (showing: 'you can clear the fields - by pressing the "Clear" button' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2879
                    fastMoveTo: ClearButton
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2880
                    click
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2881
            ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2882
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2883
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2884
        ( showing: 'start by choosing the number of arguments,' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2885
            moveTo: AllowedArguments
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2886
            select: '1 argument' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2887
        ))  
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2888
        (showing: 'Click into the "receiver" field' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2889
            moveTo: ReceiverEditor
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2890
            click 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2891
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2892
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2893
        (showing: 'Enter a value (or expression) into "receiver" field' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2894
            type: '10'
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2895
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2896
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2897
        (showing: 'Click into the "first argument" field' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2898
            moveTo: Arg1Editor
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2899
            click
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2900
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2901
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2902
        (showing: 'and enter a value for the argument' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2903
            type: '1'
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2904
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2905
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2906
        (showing: 'Click into the "answer" field' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2907
            fastMoveTo: AnswerEditor
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2908
            click
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2909
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2910
        (showing: 'Enter the expected result value into the "answer" field' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2911
            type: '11'
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2912
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2913
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2914
        (showing: 'and finally, Click on the "search" button' do:(
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2915
            fastMoveTo: SearchButton
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2916
            click
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2917
        ))
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2918
        show: 'now, the finder searches for combinations that produce the desired result' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2919
        fastMoveTo: ResultList
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2920
        show: 'and present code which would produce it in the answer list below' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2921
        show: 'if you select any item there,' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2922
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2923
        selectIndex: 2 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2924
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2925
        fastMoveTo: ImplementorsList
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2926
        show: 'the implementations will be shown in the top right implementor list' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2927
        show: 'if you select any item there,' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2928
        selectIndex: 1 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2929
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2930
        show: 'the implementation is shown in the bottom code editor' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2931
        fastMoveTo: CodeView
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2932
        wait: 0.5
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2933
        show: 'Thank you for watching, indeed' 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2934
    )
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2935
END"
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2936
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2937
    "Created: / 18-07-2019 / 21:59:06 / Claus Gittinger"
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2938
    "Modified: / 23-07-2019 / 09:04:36 / Claus Gittinger"
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2939
!
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2940
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2941
showMeHowItWorks:minorKey
4381
d761df03f034 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4369
diff changeset
  2942
    "present the show, from a file named <majorKey>_<minorKey>_<lang>.show.
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2943
     Usually, the major key defaults to the classes name,
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2944
     and the minor key is often emptyOrNil, if there is only one show."
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2945
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2946
     self showMeHowItWorks:minorKey inAny:(self showMeHowItWorksDefaultMajorKeys)
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2947
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2948
    "Modified: / 23-07-2019 / 09:08:00 / Claus Gittinger"
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2949
!
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2950
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2951
showMeHowItWorks:minorKey in:majorKey
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2952
    self showMeHowItWorks:minorKey inAny:{ majorKey }
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2953
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2954
    "Modified: / 23-07-2019 / 09:09:59 / Claus Gittinger"
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2955
!
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2956
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2957
showMeHowItWorks:minorKey inAny:setOfMajorKeys
4361
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2958
    "start a ShowMeHowItWorks presentation.
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2959
     This is controlled by a spec, which is read from the resources/shows folder,
4447
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2960
     and is named either:
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2961
        <appClassName>_<lang>       - a folder containing a start.show file
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2962
     or:
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2963
        <appClassName>_<lang>.show  - a show description file
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2964
    "
4361
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2965
4381
d761df03f034 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4369
diff changeset
  2966
    |fn rsrcDir|
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2967
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2968
    rsrcDir := self class packageDirectory asFilename / 'resources' / 'shows'.
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2969
    (rsrcDir exists) ifFalse:[
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2970
        Dialog warn:'No presentations available for %1' with:(self className).
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2971
        ^ self
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  2972
    ].
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2973
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2974
    setOfMajorKeys do:[:eachTriedMajorKey |
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2975
        fn := eachTriedMajorKey.
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2976
        minorKey notEmptyOrNil ifTrue:[
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2977
            fn := fn,'_',minorKey
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2978
        ].
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2979
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2980
        {
4447
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2981
            { ('_',Smalltalk language) . Smalltalk language }  .
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2982
            { ('_en') . 'en' }                                 .
a7c10827d592 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  2983
            { '' . 'en' }                                      .  
4361
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2984
            { ('_',Smalltalk language,'.show') . Smalltalk language }  .
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2985
            { ('_en','.show') . 'en' }                                 .
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2986
            { '.show' . 'en' }                                        
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2987
        } pairsDo:[:rest :lang |
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2988
            |triedFn|
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2989
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2990
            triedFn := fn,rest.
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2991
            (rsrcDir / triedFn) exists ifTrue:[
4361
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2992
                ShowMeHowItWorks new
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2993
                    application:self;
35ae4734af0b #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2994
                    language:lang;
4381
d761df03f034 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4369
diff changeset
  2995
                    doShowFile:(rsrcDir / triedFn).
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2996
                ^ self
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2997
            ]
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2998
        ].
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  2999
    ].    
4364
511f14f879b8 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  3000
    Dialog warn:'No presentations available for %1 (missing show: "%2")' with:(self className) with:(fn,'.show').
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3001
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3002
    "Created: / 23-07-2019 / 09:09:37 / Claus Gittinger"
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3003
!
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3004
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3005
showMeHowItWorksDefaultMajorKeys
4362
8d24b880de6c #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4361
diff changeset
  3006
    "Usually, the major key defaults to the classes name.
8d24b880de6c #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4361
diff changeset
  3007
     The returned keys are tried as filename prefixes in the resources/shows folder"
8d24b880de6c #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4361
diff changeset
  3008
8d24b880de6c #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4361
diff changeset
  3009
    ^ { 
8d24b880de6c #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4361
diff changeset
  3010
        self class name copyReplaceAll:$: with:$_.
4317
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3011
        self class nameWithoutPrefix copyReplaceAll:$: with:$_ 
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3012
      } asSet
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3013
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3014
    "
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3015
     Expecco::ProjectDifferenceBrowser basicNew showMeHowItWorksDefaultMajorKeys
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3016
     Expecco::ProjectDifferenceBrowser basicNew showMeHowItWorks
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3017
    "
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3018
f0048471e0cf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4316
diff changeset
  3019
    "Created: / 23-07-2019 / 09:07:37 / Claus Gittinger"
4316
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  3020
! !
a0550c30453e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4315
diff changeset
  3021
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3022
!ApplicationModel methodsFor:'help texts'!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3023
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3024
basicHelpTextForKey:aKey
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  3025
    "flyByHelp interface: return some short help text for a key.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3026
     key is the symbol associated with some widget or menu item.
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3027
     Return the original (english) text as written in the helpSpec; 
4112
07eecafdbe9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
  3028
     The returned string (if any) needs to be translated as per language,
07eecafdbe9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
  3029
     and also CR-expanded"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3030
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3031
    |helpSpecFromBindings helpText helpSpec "resourceArgs"|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3032
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3033
    helpSpecFromBindings := self aspectFor:#helpSpec.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3034
    helpSpecFromBindings notNil ifTrue:[
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3035
        helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3036
    ].
4109
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3037
"/    helpText isNil ifTrue:[
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3038
"/        "/ fall back for old apps
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3039
"/        helpSpecFromBindings := self aspectFor:#flyByHelpSpec.
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3040
"/        helpSpecFromBindings notNil ifTrue:[
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3041
"/            helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3042
"/        ].
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3043
"/    ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3044
    helpText isNil ifTrue:[
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3045
        helpSpec := self helpSpec.
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3046
        helpSpec isNil ifTrue:[
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3047
            "/ fall back for old apps
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3048
            helpSpec := self perform:#flyByHelpSpec ifNotUnderstood:nil.
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3049
        ].
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3050
        helpSpec notNil ifTrue:[
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3051
            helpText := helpSpec at:aKey ifAbsent:nil.
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3052
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3053
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3054
4109
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3055
    helpText notNil ifTrue:[
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3056
        "/ new: allow for a collection (resource-key arg1 arg2...)
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3057
        helpText isNonByteCollection ifTrue:[
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3058
            helpText := helpText first.
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3059
            "/ resourceArgs := helpText copyFrom:2.
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3060
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3061
    ].
4109
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3062
    
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3063
    ^ helpText
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3064
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  3065
    "Modified: / 27-01-2012 / 14:30:20 / cg"
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  3066
    "Modified (comment): / 17-11-2016 / 22:37:05 / cg"
4109
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3067
    "Modified: / 06-06-2018 / 17:30:09 / Claus Gittinger"
4112
07eecafdbe9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
  3068
    "Modified (comment): / 07-06-2018 / 10:38:37 / Claus Gittinger"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3069
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3070
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3071
helpSpec
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3072
    "activeHelp interface: return some short help text for a widget component"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3073
3029
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  3074
    |specFromBuilder|
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  3075
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  3076
    builder notNil ifTrue:[
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3077
        (specFromBuilder := builder bindingAt:#helpSpec) notNil ifTrue:[
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3078
            ^ specFromBuilder
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3079
        ].
3029
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  3080
    ].
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3081
    ^ self class helpSpec
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3082
!
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3083
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3084
helpTextFor:aComponent
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3085
    "activeHelp interface: return some help text for a widget component"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3086
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3087
    |key|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3088
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3089
    builder notNil ifTrue:[
4120
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3090
        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3091
            ^ self helpTextForKey:key
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3092
        ]
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3093
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3094
    masterApplication notNil ifTrue:[
4120
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3095
        ^ masterApplication helpTextFor:aComponent
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3096
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3097
    ^ nil
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3098
4120
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3099
    "Modified: / 31-07-1998 / 23:03:10 / cg"
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3100
    "Modified: / 08-06-2018 / 13:01:09 / Claus Gittinger"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3101
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3102
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3103
helpTextFor:aComponent at:aPoint
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3104
    "if not redefined by subclass, fall back to general method"
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3105
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3106
    ^ self helpTextFor:aComponent
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3107
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3108
    "Created: / 09-01-2018 / 16:32:40 / stefan"
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3109
!
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3110
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3111
helpTextForKey:aKey
4152
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3112
    "flyByHelp interface: 
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3113
     return some short help text for a key.
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3114
     Key is the symbol associated with some widget or menu item.
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3115
     (from my helpSpec); 
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3116
     Return a language variant (if available).
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3117
     Special: with CTRL, show how it is generated (the helpKey or action block)"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3118
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3119
    |helpText translatedHelpText translatedKey master|
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3120
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3121
    "/ ActiveHelp debugging:true.
4221
f6e84e92f212 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  3122
    "/ ActiveHelp debugging:false.
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3123
    ActiveHelp debugging ifTrue:[ 
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3124
        Transcript showCR:'app: %1; help key: %2' with:self with:aKey
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3125
    ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3126
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3127
    helpText := self basicHelpTextForKey:aKey.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3128
    helpText isNil ifTrue:[
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3129
        "/ try all masters...
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3130
        master := masterApplication.
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3131
        [helpText isNil and:[master notNil]] whileTrue:[
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3132
            "here we get an already translated helpText"
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3133
            helpText := master basicHelpTextForKey:aKey.
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3134
            master masterApplication ~~ master ifTrue:[
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3135
                master := master masterApplication.
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3136
            ].
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3137
        ].
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3138
        helpText isNil ifTrue:[
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3139
            "there is no help text - resolve key from resources"
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  3140
            helpText := (self translateString:aKey).
4059
612726a08954 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4050
diff changeset
  3141
            helpText = aKey ifTrue:[
4384
0c556a4def9c #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
  3142
                "/ nothing came...
0c556a4def9c #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
  3143
0c556a4def9c #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
  3144
                "/ special: if ctrl is pressed, show the helpkey 
4232
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3145
                (FlyByHelp helpKeyInsteadOfHelpTextQuery query ? false) ifTrue:[
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3146
                    ^ c'Helpkey (%1): %2\nHold CTRL and press SHIFT for menu' bindWith:self with:aKey.
4232
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3147
                ].    
4109
ea2ee01fc8d2 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  3148
                helpText := nil
4059
612726a08954 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4050
diff changeset
  3149
            ].
4112
07eecafdbe9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
  3150
            ^ helpText.
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3151
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3152
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3153
    "/ kludge to allow for dynamic translation by the application itself, avoiding the key translation below.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3154
    helpText isBlock ifTrue:[
4232
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3155
        (FlyByHelp helpKeyInsteadOfHelpTextQuery query ? false) ifTrue:[
4229
33626e746d4a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4223
diff changeset
  3156
            ^ 'HelpText-block: ',helpText printString,c'\nHold CTRL and press SHIFT for menu'.
4152
5b0e44e9022f #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4143
diff changeset
  3157
        ].    
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3158
        ^ helpText value.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3159
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3160
4200
15c69749a371 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4199
diff changeset
  3161
    "/ special: if ctrl is pressed, show the helpkey 
4232
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3162
    (helpText notNil) ifTrue:[
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3163
        (FlyByHelp helpKeyInsteadOfHelpTextQuery query ? false) ifTrue:[
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3164
            ^ c'Helpkey (%1): %2\nHold CTRL and press SHIFT for menu' bindWith:self with:aKey.
4232
a55135461bc3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4229
diff changeset
  3165
        ].
4120
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3166
    ].
b7565a32c10a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  3167
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3168
    "get the translation"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3169
    translatedHelpText := self translateString:helpText.
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  3170
    (helpText = aKey and:[ translatedHelpText = helpText ]) ifTrue:[
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3171
        "there is no translation in the resources - maybe there is one for the key?"
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3172
        translatedKey := self translateString:aKey.
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3173
        translatedKey ~~ aKey ifTrue:[
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3174
             translatedHelpText := translatedKey.
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3175
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3176
    ].
4174
be06d8dcabfb #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  3177
    ^ translatedHelpText.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3178
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  3179
    "Modified: / 27-01-2012 / 14:33:54 / cg"
4039
f21b5b4936f4 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3971
diff changeset
  3180
    "Modified (comment): / 09-01-2018 / 17:36:30 / stefan"
4243
d0c9b182cd7d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4240
diff changeset
  3181
    "Modified: / 07-03-2019 / 22:53:48 / Claus Gittinger"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3182
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3183
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3184
helpTextForKey:aKey row:aRowNr
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3185
    "Special interface for DataSet - get the active help text for a specific row"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3186
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3187
    "Default: no row specific help"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3188
4047
8076ba6a362d #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4039
diff changeset
  3189
    ^ self helpTextForKey:aKey.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3190
! !
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  3191
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3192
!ApplicationModel methodsFor:'hooks'!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3193
2185
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3194
aboutToOpen:whichTopView
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3195
    "the topView is about to be opened.
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3196
     This is sent by whichTopView, right before its really open
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3197
     (i.e. finally visible)"
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3198
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3199
    self preOpenWith:builder
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3200
!
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  3201
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3202
commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3203
    "a common hook for postBuildWith: and postBuildAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3204
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3205
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3206
commonPostOpen
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3207
    "a common hook for postOpenWith:, postOpenAsSubcanvasWith: and postOpenAsDialogWith:.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3208
     Notice: redefined methods should do a super send.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3209
     otherwise resources might be undefined."
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3210
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3211
    <modifier: #super>
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3212
    
3860
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  3213
    resources isNil ifTrue:[
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  3214
        resources := self resources
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  3215
    ].
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3216
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3217
    "Modified: / 07-02-2017 / 18:43:35 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3218
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3219
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3220
commonPreBuild
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3221
    "a common hook for preBuildWith:, preBuildAsSubcanvasWith: and preBuildAsDialogWith:."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3222
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3223
    "Modified (comment): / 07-07-2011 / 17:13:51 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3224
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3225
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3226
commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3227
    "A common hook for preOpenWith:, preOpenAsSubcanvasWith: and preOpenAsDialogWith:."
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3228
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3229
    "Created: / 05-03-2014 / 18:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3230
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3231
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3232
postApplicationProcessCreate:newProcess windowGroup:newGroup
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3233
    "this is sent whenever a new application is launched from this app,
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3234
     which forks its own windowGroup process. Allows for process group management,
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3235
     or process-global exception handlers to be installed.
4182
d9319203ae2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
  3236
     Nothing done here - can be redefined in concrete applications"
d9319203ae2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
  3237
d9319203ae2e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4180
diff changeset
  3238
    "Modified (comment): / 25-09-2018 / 12:20:16 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3239
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3240
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3241
postBuildAsSubcanvasWith:aBuilder
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3242
    "this is sent after an interface is built from a spec as subcanvas,
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3243
     and the appModel is the same as the topWindow's application.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3244
     Can be redefined in subclasses for additional setup after
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3245
     the subcanvas' view has been built, but not yet opened."
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3246
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3247
    |sameApp|
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3248
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3249
    sameApp := aBuilder application == aBuilder window topView application.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3250
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3251
    "/ If I am opened as subcanvas in another application
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3252
    "/ then treat this like a regular open.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3253
    "/ otherwise ignore it.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3254
    sameApp ifFalse:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3255
        self postBuildWith:aBuilder.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3256
    ] ifTrue:[
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3257
        "/ I no not think, that this is a good default
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3258
        "/ self commonPostBuild.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3259
    ].
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3260
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3261
    "Modified (comment): / 07-07-2011 / 17:16:30 / cg"
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3262
    "Modified (comment): / 22-05-2018 / 18:11:42 / Claus Gittinger"
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3263
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3264
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3265
postBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3266
    "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
  3267
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3268
     Can be redefined in subclasses for additional setup after
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3269
     the dialog's view has been built, but not yet opened."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3270
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3271
    |sameApp|
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3272
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3273
    sameApp := (aBuilder application == aBuilder window topView application).
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3274
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3275
    "/ If I am opened as subcanvas in another application
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3276
    "/ then treat this like a regular open.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3277
    "/ otherwise ignore it.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3278
    sameApp ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3279
        self postBuildWith:aBuilder.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3280
    ] ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3281
        self commonPostBuild.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3282
    ].
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3283
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3284
    "Modified: / 08-07-1998 / 18:28:55 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3285
    "Created: / 07-07-2011 / 17:20:29 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3286
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3287
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3288
postBuildWith:aBuilder
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3289
    "this is sent after an interface is built from a spec,
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3290
     but only iff the appModel is not the same as the topView's app
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3291
     (i.e. if it is not a build for the same appModel again).
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3292
     In that case, postBuildAsSubcanvasWith is invoked.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3293
     Can be redefined in subclasses for additional setup after
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3294
     the view has been built, but not yet opened."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3295
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3296
    <modifier: #super> "must be called if redefined"
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3297
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3298
    self commonPostBuild
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3299
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3300
    "Modified: / 08-02-2017 / 00:22:38 / cg"
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3301
    "Modified (comment): / 22-05-2018 / 18:11:31 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3302
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3303
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3304
postOpenAsSubcanvasWith:aBuilder
4093
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3305
    "this is sent after the application's window is opened inside another application.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3306
     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
  3307
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3308
    self commonPostOpen
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3309
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3310
    "Modified (comment): / 07-07-2011 / 17:16:46 / cg"
4093
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3311
    "Modified (comment): / 22-05-2018 / 18:42:11 / Claus Gittinger"
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3312
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3313
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3314
postOpenDialogWith:aBuilder
4369
3d41c17cc1a7 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
  3315
    "this is sent after the applicationÄs window is opened as a dialog with me
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3316
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3317
     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
  3318
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3319
    self commonPostOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3320
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3321
    "Created: / 07-07-2011 / 17:20:37 / cg"
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3322
    "Modified: / 05-03-2014 / 18:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4093
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3323
    "Modified (comment): / 22-05-2018 / 18:42:15 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3324
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3325
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3326
postOpenWith:aBuilder
4093
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3327
    "this is sent after the application's main window is opened.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3328
     Can be redefined in subclasses for actions after opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3329
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3330
    self commonPostOpen
4093
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3331
1d800f13853b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  3332
    "Modified (comment): / 22-05-2018 / 18:42:19 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3333
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3334
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3335
preBuildAsSubcanvasWith:aBuilder
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3336
    "this is sent before an interface is built from a spec as a subcanvas,
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3337
     and the appModel is the same as the topWindow's application.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3338
     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
  3339
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3340
    self commonPreBuild
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3341
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3342
    "Modified (comment): / 22-05-2018 / 18:11:04 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3343
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3344
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3345
preBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3346
    "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
  3347
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3348
     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
  3349
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3350
    "Created: / 07-07-2011 / 17:20:48 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3351
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3352
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3353
preBuildWith:aBuilder
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3354
    "this is sent before an interface is built from a spec,
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3355
     but only iff the appModel is not the same as the topView's app
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3356
     (i.e. if it is not a build for the same appModel again).
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3357
     In that case, preBuildAsSubcanvasWith is invoked.
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3358
     Can be redefined in subclasses."
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3359
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3360
    self commonPreBuild
4092
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3361
977fb5172ac6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4091
diff changeset
  3362
    "Modified (comment): / 22-05-2018 / 18:10:31 / Claus Gittinger"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3363
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3364
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3365
preOpenAsSubcanvasWith:aBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3366
    "this is sent before the applications window is opened inside another application.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3367
     Can be redefined in subclasses for actions after showing the canvas view."
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3368
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3369
    self commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3370
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3371
    "Created: / 05-03-2014 / 18:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3372
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3373
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3374
preOpenDialogWith:aBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3375
    "this is sent after the applications window is opened as a dialog with me
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3376
     as a source (for aspects) i.e. via openDialogInterface:.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3377
     Can be redefined in subclasses for actions after opening a dialog view."
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3378
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3379
    self commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3380
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3381
    "Created: / 05-03-2014 / 18:41:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3382
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3383
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3384
preOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3385
    "this is sent before the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3386
     Can be redefined in subclasses for actions right before opening the view."
4408
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3387
!
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3388
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3389
processOutsideButtonEventWhileModal:anEvent
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3390
    "a button event (press/release) arrived for another view,
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3391
     while I (a topView) am open as modal view.
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3392
     Can be redefined to react on clicks outside (eg. CriticsWindow);
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3393
     if handled, the redefining method should return true.
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3394
     If not handled, it should return false."
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3395
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3396
    ^ false
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3397
5a393a69f858 #BUGFIX by Stefan Reise
sr
parents: 4391
diff changeset
  3398
    "Created: / 13-12-2019 / 11:54:28 / Stefan Reise"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3399
! !
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  3400
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3401
!ApplicationModel methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3402
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3403
addTopViewsToCurrentProject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3404
    "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
  3405
     This allows hiding views on a per-project basis.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3406
     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
  3407
     (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
  3408
1972
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  3409
    |wg|
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  3410
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  3411
    (wg := self windowGroup) notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3412
        (wg topViews ? #()) do:[:aView |
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3413
            aView addToCurrentProject
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3414
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3415
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3416
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3417
    "Modified: 17.1.1997 / 19:43:39 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3418
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3420
basicInitialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3421
    "initialize the application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3422
     Since ST-80 applications seem commonly to redefine #initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3423
     without doing a super initialize, the real initialization is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3424
     done here ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3425
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3426
    self initializeDevice.
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
    "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
  3429
     builder till later, to allow setting to another builder.
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3430
     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
  3431
     creation, which might lead to trouble.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3432
     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
  3433
     late.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3434
     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
  3435
    "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3436
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3437
"/    builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3438
"/    builder notNil ifTrue:[builder application:self].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3439
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3440
    self initializeResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3441
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3442
    "Modified: / 13-09-2006 / 12:39:30 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3443
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3444
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3445
initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3446
    "nothing done here;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3447
     but can be redefined in concrete applications"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3448
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3449
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3450
initializeDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3451
    self isWebService ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3452
        self initializeWebServiceDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3453
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3454
        self initializeScreenDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3455
    ].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3456
!
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3457
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3458
initializeResources
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3459
    "initialize the applications resources (NLS support)."
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3460
4443
81b3abce89d0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4429
diff changeset
  3461
    resources isNil ifTrue:[
81b3abce89d0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4429
diff changeset
  3462
        resources := self class classResources.
81b3abce89d0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4429
diff changeset
  3463
    ].
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3464
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3465
    "Created: / 13-09-2006 / 12:39:22 / cg"
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3466
!
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  3467
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3468
initializeScreenDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3469
    Screen notNil ifTrue:[
3523
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  3470
        device := Screen current.
3524
375cfd9a940c #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  3471
        (device notNil and:[device isOpen not]) ifTrue:[
4284
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  3472
            (self className,' [warning]: screen device is not open') errorPrintCR
3523
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  3473
        ].    
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3474
    ]
4284
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  3475
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  3476
    "Modified: / 28-06-2019 / 08:40:51 / Claus Gittinger"
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3477
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3478
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3479
setDevice:aDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3480
    "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
  3481
     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
  3482
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3483
    device := aDevice
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
    "Created: 5.7.1996 / 12:01:40 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3486
    "Modified: 17.1.1997 / 19:44:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3487
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3488
4309
a226361bd54e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4289
diff changeset
  3489
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3490
!ApplicationModel methodsFor:'opening'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3491
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3492
hideWindows
3943
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3493
    |wg|
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3494
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3495
    wg := self windowGroup.
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3496
    wg notNil ifTrue:[
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3497
        wg hideTopViews.
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3498
    ].
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3499
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3500
    "Modified: / 17-03-2017 / 17:22:31 / stefan"
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3501
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3502
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3503
open
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3504
    "open a standard interface.
3851
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  3505
     Sorry, but for visualworks compatibility, the builder is returned,
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  3506
     not the receiver."
1419
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
    ^ self openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3509
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3510
    "Modified: / 03-05-1996 / 13:39:15 / cg"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3511
    "Modified (comment): / 27-12-2011 / 10:42:15 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3512
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3513
1592
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3514
openAndWaitUntilVisible
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3515
    "open a standard interface, and wait until my window is visible"
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3516
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3517
    self open.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3518
    self window waitUntilVisible.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3519
!
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3520
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3521
openAs:windowType
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3522
    "open a standard interface as slave, partner, dialog, popUp, undecorated etc.
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3523
     Sorry, but for visualworks compatibility, the builder is returned"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3524
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3525
    ^ self openInterfaceAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3526
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3527
    "Modified: / 04-03-2011 / 15:03:19 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3528
    "Modified (comment): / 27-12-2011 / 10:42:28 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3529
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3530
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3531
openAsSlave
1726
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  3532
    "open a standard interface as slave.
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  3533
     Notice: there is still a need to make the current window a master
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3534
        (see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3535
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3536
    ^ self openAs:#slave
1724
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3537
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3538
    "
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3539
     WorkspaceApplication new openAsSlave.
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3540
    "
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3541
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3542
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3543
openAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3544
    "open a standard interface at some point"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3545
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3546
    ^ self openInterfaceAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3547
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3548
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3549
    "Created: 14.2.1997 / 20:17:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3550
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3551
3181
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3552
openAtPointer
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3553
    "open a standard interface at the current pointer position.
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3554
     Sorry, but for visualworks compatibility, the builder is returned"
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3555
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3556
    ^ self openInterfaceAt:(device pointerPosition)
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3557
!
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3558
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3559
openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3560
    "open a standard interface.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3561
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3562
     Subclasses which do not have an interfaceSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3563
     should redefine this method and create & open their view(s) there.
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3564
     (see Launcher as an example).
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3565
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3566
     Sorry, but for visualworks compatibility, the builder is returned"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3567
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3568
    ^ self openInterface:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3569
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3570
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3571
    "Modified: / 23-01-1998 / 18:16:50 / cg"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3572
    "Modified (comment): / 27-12-2011 / 10:42:04 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3573
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3574
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3575
openInterface:aSymbol
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3576
    "open a specific interface.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3577
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3578
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3579
     application subclass must provide a method with that name,
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3580
     which must return an interfaceSpec.
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3581
     This is forwarded to the builder to create the views.
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3582
     Typically, applications only use one interface, returned by the #windowSpec method.
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3583
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3584
     Sorry, but for visualworks compatibility, the builder is returned"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3585
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3586
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3587
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3588
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3589
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3590
    "Modified: / 03-03-2011 / 18:57:04 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3591
    "Modified (comment): / 27-12-2011 / 10:41:54 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3592
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3593
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3594
openInterface:aSymbol as:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3595
    "open a specific interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3596
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3597
     The argument, aSymbol specifies which interface.
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3598
     The concrete application subclass must provide a method with that name,
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3599
     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
  3600
     Typically, applications only use one interface, returned by the #windowSpec method.
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3601
     The windowType can be any of #slave, #partner, #dialog, #popUp etc.
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3602
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3603
     Sorry, but for visualworks compatibility, the builder is returned"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3604
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3605
    self allButOpenInterface:aSymbol.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3606
    self openWindowAs:windowType.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3607
    ^ builder
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3608
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3609
    "Modified: / 03-03-2011 / 18:56:23 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3610
    "Modified (comment): / 27-12-2011 / 10:42:37 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3611
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3612
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3613
openInterface:aSymbol at:aLocation
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3614
    "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
  3615
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3616
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3617
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3618
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3619
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3620
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3621
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3622
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3623
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3624
    self openWindowAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3625
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3626
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3627
    "Created: / 14-02-1997 / 20:19:44 / cg"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3628
    "Modified: / 03-03-2011 / 18:55:26 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3629
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3630
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3631
openInterfaceAs:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3632
    "open a standard interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3633
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3634
     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
  3635
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3636
    ^ self openInterface:(self defaultWindowSpecName) as:windowType
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3637
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3638
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3639
    "Modified: / 04-03-2011 / 15:03:28 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3640
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3641
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3642
openInterfaceAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3643
    "open a standard interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3644
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3645
    ^ self openInterface:(self defaultWindowSpecName) at:aLocation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3646
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3647
    "Created: / 14.2.1997 / 20:18:20 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3648
    "Modified: / 23.1.1998 / 18:17:13 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3649
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3650
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3651
openInterfaceModal
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3652
    "open a standard interface as a modal dialog.
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3653
     Sorry, but for visualworks compatibility, the builder is returned"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3654
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3655
    ^ self openInterfaceModal:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3656
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3657
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3658
    "Modified: / 03-03-2011 / 18:54:48 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3659
    "Modified (comment): / 27-12-2011 / 10:42:53 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3660
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3661
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3662
openInterfaceModal:aSymbol
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3663
    "open a specific interface as a modal dialog.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3664
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3665
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3666
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3667
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3668
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3669
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3670
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3671
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3672
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3673
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3674
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3675
    "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
  3676
!
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  3677
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3678
openInterfaceModal:aSymbol at:location
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3679
    "open a specific interface modal at some screen location.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3680
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3681
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3682
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3683
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3684
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3685
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3686
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3687
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3688
    self openWindowModalAt:location.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3689
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3690
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3691
    "Modified: 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3692
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3693
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3694
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3695
    "open a standard interface as a modal dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3696
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3697
    ^ self openInterfaceModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3698
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3699
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3700
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3701
3618
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3702
openModalAtPointer
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3703
    "open a standard interface modal at the current pointer position.
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3704
     Sorry, but for visualworks compatibility, the builder is returned"
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3705
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3706
    ^ self openInterfaceModal:(self defaultWindowSpecName) at:(device pointerPosition)
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3707
!
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3708
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3709
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3710
    "open a standard interface on some other device"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3711
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3712
    self setDevice:aDevice.
3365
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3713
    Screen currentScreenQuerySignal 
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3714
        answer:aDevice
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3715
        do:[
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3716
            ^ self open
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3717
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3718
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3719
    "Created: 13.1.1997 / 21:24:11 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3720
    "Modified: 13.1.1997 / 21:24:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3721
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3722
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3723
openSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3724
    "open a view as specified in anInterfaceSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3725
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3726
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3727
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3728
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3729
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3730
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3731
    "Created: / 20.5.1998 / 20:08:51 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3732
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3733
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3734
openSpec:anInterfaceSpec withBindings:bindings
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3735
    "open a view as specified in anInterfaceSpec."
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3736
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3737
    self openSpec:anInterfaceSpec withBindings:bindings modal:false
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3738
!
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3739
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3740
openSpec:anInterfaceSpec withBindings:bindings modal:modal
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3741
    "open a view as specified in anInterfaceSpec."
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3742
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3743
    self createBuilder.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3744
    builder bindings:bindings.
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3745
    self allButOpenFrom:anInterfaceSpec.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3746
    modal ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3747
        self openWindowModal.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3748
    ] ifFalse:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3749
        self openWindow.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3750
    ]
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3751
!
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3752
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3753
openSpecModal:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3754
    "open an interface spec modal"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3755
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3756
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3757
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3758
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3759
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3760
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3761
    "Created: / 20.5.1998 / 20:20:21 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3762
!
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
openWindow
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3765
    "open the window
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3766
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3767
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3768
    builder "openWindow."
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3769
        openAt:nil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3770
        withExtent:(self defaultWindowExtent)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3771
        andType:(self defaultWindowType)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3772
2270
a7c797806d46 correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  3773
    "Created: / 14-02-1997 / 20:20:39 / cg"
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3774
    "Modified: / 11-07-2011 / 22:30:27 / cg"
1419
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
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3777
openWindowAs:windowType
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3778
    "open the window - assumes that the builder has already setup the interface.
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3779
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3780
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3781
    builder
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3782
        openAt:nil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3783
        withExtent:(self defaultWindowExtent)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3784
        andType:windowType
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3785
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3786
    "Modified: / 11-07-2011 / 22:30:35 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3787
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3788
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3789
openWindowAs:windowType at:originOrNil
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3790
    "open the window - assumes that the builder has already setup the interface.
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3791
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3792
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3793
    builder
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3794
        openAt:originOrNil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3795
        withExtent:(self defaultWindowExtent)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3796
        andType:windowType
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3797
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3798
    "Modified: / 11-07-2011 / 22:30:35 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3799
    "Created: / 25-07-2011 / 16:00:24 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3800
!
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3801
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3802
openWindowAt:aPoint
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3803
    "open the window
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3804
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3805
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3806
    builder "openWindowAt:aLocation."
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3807
        openAt:aPoint
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3808
        withExtent:(self defaultWindowExtent)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3809
        andType:(self defaultWindowType)
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3810
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3811
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3814
openWindowAtCenter
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3815
    "open the window centered on the screen
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3816
     - assumes that the builder has already setup the interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3817
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3818
    builder openWindowAt:#center
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3819
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3820
    "Created: 14.2.1997 / 20:20:55 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3821
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3822
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3823
openWindowModal
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3824
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3825
     - 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
  3826
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3827
"/    builder openDialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3828
    builder
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3829
        openAt:nil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3830
        withExtent:(self defaultWindowExtent)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3831
        andType:#dialog
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3832
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3833
    "Created: / 14-02-1997 / 20:20:39 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3834
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3835
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3836
openWindowModalAt:aLocation
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3837
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3838
     - 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
  3839
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3840
    builder openDialogAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3841
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3842
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3843
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3844
1478
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3845
openWithExtent:extPoint
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3846
    "open a standard interface with given extent"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3847
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3848
    |bldr|
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3849
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3850
    bldr := self allButOpen.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3851
    bldr openWithExtent:extPoint.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3852
    ^ bldr
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3853
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3854
    "Modified: 3.5.1996 / 13:39:15 / cg"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3855
!
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3856
1968
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3857
opened:whichTopView
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3858
    "the topView has been opened.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3859
     This is sent by whichTopView, when its really open
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3860
     (i.e. finally visible)"
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3861
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3862
    self addTopViewsToCurrentProject.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3863
    self postOpenWith:builder
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3864
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3865
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3866
showWindows
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3867
    self window map;activate.
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3868
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3869
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3870
unhideWindows
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3871
    self windowGroup unhideTopViews
4321
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3872
!
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3873
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3874
waitUntilVisible
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3875
    "wait until my window is visible"
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3876
871310bbbb2e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4317
diff changeset
  3877
    self window waitUntilVisible.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3878
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3879
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3880
!ApplicationModel methodsFor:'opening-dialogs'!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3881
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3882
openDialog
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3883
    "open my window as a modal dialog
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3884
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3885
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3886
    self window beToolDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3887
    ^ builder openDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3888
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3889
    "Modified: / 14-02-1997 / 20:32:52 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3890
    "Modified (comment): / 07-07-2011 / 17:25:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3891
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3892
3540
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3893
openDialogAt:aPoint
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3894
    "open my window as a modal dialog
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3895
     - assumes that the builder has already setup the interface."
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3896
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3897
    self window beToolDialog.
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3898
    ^ builder openDialogAt:aPoint.
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3899
!
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3900
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3901
openDialogAtPointer
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3902
    "open my window as a modal dialog
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3903
     - assumes that the builder has already setup the interface."
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3904
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3905
    ^ self openDialogAt:(device pointerPosition).
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3906
!
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3907
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3908
openDialogInterface:aSelector
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3909
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3910
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3911
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3912
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3913
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3914
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3915
    ^ self openDialogInterface:aSelector withBindings:nil
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3916
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3917
    "Modified: / 28-02-1997 / 14:08:01 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3918
    "Modified (comment): / 07-07-2011 / 17:25:26 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3919
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3920
4452
bc70545786e0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  3921
openDialogInterface:anInterfaceSymbolOrSpecOrSpecArray withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3922
    "open a dialog, given a spec-selector"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3923
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3924
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3925
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3926
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3927
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3928
    ^ SimpleDialog new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3929
        openFor:self
4452
bc70545786e0 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4447
diff changeset
  3930
        interface:anInterfaceSymbolOrSpecOrSpecArray
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3931
        withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3932
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3933
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3934
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3935
    "Modified (comment): / 07-07-2011 / 17:25:23 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3936
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3937
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3938
openDialogInterfaceSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3939
    "open a dialog, given a spec"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3940
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3941
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3942
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3943
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3944
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3945
    ^ SimpleDialog new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3946
        openFor:self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3947
        interfaceSpec:aSpec
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3948
        withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3949
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3950
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3951
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3952
    "Modified (comment): / 07-07-2011 / 17:25:20 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3953
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3954
3496
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3955
openDialogModeless
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3956
    "open my window as a modal dialog
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3957
     - assumes that the builder has already setup the interface."
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3958
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3959
    self window beToolDialog.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3960
    ^ builder open.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3961
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3962
    "Modified: / 14-02-1997 / 20:32:52 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3963
    "Modified (comment): / 07-07-2011 / 17:25:45 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3964
!
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3965
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3966
openDialogSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3967
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3968
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3969
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3970
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3971
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3972
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3973
    ^ SimpleDialog new
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3974
        openFor:self
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3975
        spec:aSpec
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  3976
        withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3977
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3978
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3979
    "Created: / 20-05-1998 / 20:27:56 / cg"
3496
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3980
!
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3981
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3982
openDialogSpecModeless:aSpec withBindings:bindings
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3983
    "open a dialog, but without blocking the caller"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3984
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3985
    "/ Notice: the opened dialog will be technically another instance
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3986
    "/ (of SimpleDialog) but use me as aspect provider.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3987
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3988
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3989
    ^ SimpleDialog new
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3990
        openModelessFor:self
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3991
        spec:aSpec
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3992
        withBindings:bindings
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3993
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3994
    "Modified: / 23-01-1998 / 18:18:14 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3995
    "Created: / 20-05-1998 / 20:27:56 / cg"
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3996
! !
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3997
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3998
!ApplicationModel methodsFor:'opening-webInterface'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3999
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4000
addToService
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4001
    self service
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4002
        addPage:(builder page)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4003
        link:(self webLink)
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4004
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4005
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4006
createWebBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4007
    "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
  4008
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4009
    builder isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4010
        builder := self webBuilderClass new.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4011
        builder application:self.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4012
    ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4013
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4014
    "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
  4015
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4016
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4017
defaultPageSpecName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4018
    ^ #pageSpec
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4019
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4020
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4021
defineInterface
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4022
    "define a standard interface.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4023
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4024
     Subclasses which do not have an interfaceSpec
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4025
     should redefine this method and create their page there."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4026
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4027
    ^ self defineInterface:(self defaultPageSpecName)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4028
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4029
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4030
defineInterface:aSpecSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4031
    "define an interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4032
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4033
    ^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4034
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4035
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4036
defineInterfaceFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4037
    "define an interface (setup a page), given a spec."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4038
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4039
    |page|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4040
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4041
    builder isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4042
        self createWebBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4043
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4044
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4045
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4046
    builder buildPageFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4047
    page := builder page.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4048
    page application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4049
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4050
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4051
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4052
    "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
  4053
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4054
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4055
httpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4056
    "on which port will a HTTP server be started"
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4057
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4058
    ^ self class defaultHttpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4059
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  4060
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4061
initializeAsWebServiceOnWebDevice:webDevice
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4062
    self setDevice:(WebApplicationDevice new).
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4063
    self initialize.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4064
    self initializeWebServiceDevice.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4065
    self initializeResources.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4066
!
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  4067
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4068
initializeWebServiceDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4069
    "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
  4070
     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
  4071
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4072
    |server|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4073
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4074
    self service isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4075
        server := HTTPServer serverOnPort:(self httpServerPort).
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4076
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4077
        self service:(server
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4078
                    serviceForLink:(self serviceLinkName)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4079
                    ifAbsent:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4080
                        |service|
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4081
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4082
                        service := HTTPPortalService new.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4083
                        service linkName:(self serviceLinkName).
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4084
                        service class unRegisterServiceOn:server.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4085
                        service registerServiceOn:server.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4086
                        service
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4087
                    ]).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4088
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4089
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4090
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4091
pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4092
    ^ self class pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4093
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4094
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4095
service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4096
    device isNil ifTrue:[^ nil].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4097
    self assert:(device isWebServiceDevice).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4098
    ^ device service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4099
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4100
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4101
service:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4102
    self device service:something.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4103
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4104
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4105
serviceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4106
    ^ self class defaultServiceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4107
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4108
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4109
startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4110
    device isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4111
        self initializeDevice.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4112
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4113
    self startInPortalService:self service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4114
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4115
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4116
     self new startInWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4117
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4118
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4119
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4120
startInPortalService:aPortalServiceOrSession
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  4121
    aPortalServiceOrSession application:self.
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  4122
    self service:aPortalServiceOrSession.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4123
    self defineInterface.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4124
    self addToService.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4125
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4126
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4127
webBuilderClass
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4128
    "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
  4129
     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
  4130
     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
  4131
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4132
    ^ WebPageBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4133
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4134
    "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
  4135
    "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
  4136
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4137
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4138
webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4139
    "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
  4140
     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
  4141
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4142
    ^ self device webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4143
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4144
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4145
webLink:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4146
    self device webLink:something
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4147
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4148
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4149
!ApplicationModel methodsFor:'private'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4150
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4151
builderClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4152
    "return the UIBuilder class for me.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4153
     This method can be redefined if (eventually) there are
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4154
     spec readers for other UI languages (motif UIL ?)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4155
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4156
    self isWebService ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4157
        ^ self webBuilderClass
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4158
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4159
    ^ UIBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4160
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4161
    "Created: / 19.6.1998 / 01:39:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4162
    "Modified: / 19.6.1998 / 01:45:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4163
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4164
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4165
createBuilder
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  4166
    "create a WindowBuilder if not already present"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  4167
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4168
    builder isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4169
        builder := self builderClass new.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4170
        builder application:self.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4171
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4172
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4173
    "Created: / 19.6.1998 / 03:32:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4174
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4175
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4176
!ApplicationModel methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4177
4289
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4178
applicationWindowClass
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4179
    "return the class used for my (top-) windows"
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4180
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4181
    ^ ApplicationWindow
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4182
!
802ab7b31479 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4287
diff changeset
  4183
4275
47c5eb544d7a #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4272
diff changeset
  4184
ctrlDown
4428
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4185
    "answer true if the control key is currently pressed"
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4186
4429
b9e79975c33a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  4187
    "/ cg: the following code breaks with menu-panels / popup menus,
b9e79975c33a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  4188
    "/ where the activeGroup seems to be different/nil temporarily,
b9e79975c33a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  4189
    "/ leading to isVisible to return true although it should not,
b9e79975c33a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  4190
    "/ leading to an item being not drawn (although the space for it was reserved initially)
4428
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4191
"/    |activeGroup|
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4192
"/
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4193
"/    (activeGroup := WindowGroup activeGroup) isNil ifTrue:[
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4194
"/        ^ false
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4195
"/    ].
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4196
"/    ^ activeGroup sensor ctrlDown.
5111a837d71c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4408
diff changeset
  4197
    ^ Screen current ctrlDown
4275
47c5eb544d7a #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4272
diff changeset
  4198
47c5eb544d7a #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4272
diff changeset
  4199
    "Created: / 06-06-2019 / 15:24:51 / Stefan Vogel"
4312
43dd2c6e924b #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
  4200
    "Modified: / 20-07-2019 / 08:41:30 / Claus Gittinger"
4275
47c5eb544d7a #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4272
diff changeset
  4201
!
47c5eb544d7a #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4272
diff changeset
  4202
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  4203
defaultWindowExtent
4077
0b959eb9554b #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
  4204
    "return my default window extent or nil.
0b959eb9554b #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
  4205
     Return nil if the defaul extent should be computed by other means.
0b959eb9554b #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
  4206
0b959eb9554b #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
  4207
     The code here asks for the last extent of an instance of this class."
3947
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  4208
     
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4209
    ^ self class defaultExtentFor:self class
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  4210
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  4211
    "Created: / 11-07-2011 / 22:30:12 / cg"
3947
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  4212
    "Modified (comment): / 09-04-2017 / 22:30:52 / cg"
4077
0b959eb9554b #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4076
diff changeset
  4213
    "Modified (comment): / 20-03-2018 / 11:42:16 / stefan"
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  4214
!
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  4215
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  4216
defaultWindowSpecName
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  4217
    ^ #windowSpec
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  4218
!
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  4219
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4220
defaultWindowType
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4221
    "Applications come up non-modal, by default"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4222
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4223
    ^ #normal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4224
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4225
    "Created: 17.1.1997 / 19:57:34 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4226
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4227
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4228
graphicsDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4229
    "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
  4230
     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
  4231
     active screen."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4232
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4233
    ^ device
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4234
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4235
    "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
  4236
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  4237
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  4238
interfaceSpecFor:aSelectorOrSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4239
    "return an interface spec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4240
     Here, the query is forwarded to my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4241
     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
  4242
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4243
    aSelectorOrSpec isSymbol ifFalse:[
3677
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4244
        (aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  4245
    ].
3677
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4246
    UnhandledAttributeInLiteralArrayErrorSignal handle:[:ex |
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4247
        "/ that is to support debugging - to easily find the bad spec
4333
5e795610eda0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4326
diff changeset
  4248
        Transcript showCR:'%1 [warning]: Error in spec (%2):' 
4284
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  4249
                                with:self className 
3677
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4250
                                with:aSelectorOrSpec.
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4251
        Transcript showCR:ex description. 
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4252
        ex proceed.
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4253
    ] do:[    
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4254
        ^ self class interfaceSpecFor:aSelectorOrSpec
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  4255
    ].
4284
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  4256
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  4257
    "Created: / 25-01-1998 / 19:45:12 / cg"
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  4258
    "Modified: / 14-01-2008 / 17:54:29 / cg"
4284
312ec8cbca1c #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4277
diff changeset
  4259
    "Modified: / 28-06-2019 / 08:41:03 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4260
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4261
1481
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4262
isOpen
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4263
   "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
  4264
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4265
   |win|
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4266
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4267
   ^ (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
  4268
!
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  4269
3484
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4270
isShown
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4271
   "answer true if the application's window is shown"
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4272
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4273
   |win|
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4274
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4275
   ^ (win := self window) notNil and:[win shown]
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4276
!
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4277
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4278
isWebService
4270
94a8a3dbe5a6 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  4279
    ^ device notNil and:[ device "askFor:#" isWebServiceDevice ]
94a8a3dbe5a6 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  4280
94a8a3dbe5a6 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  4281
    "Modified: / 27-05-2019 / 20:05:48 / Claus Gittinger"
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4282
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  4283
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4284
processName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4285
    "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
  4286
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4287
    self class == ApplicationModel ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4288
        ^ 'Application'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4289
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4290
    ^ self class nameWithoutPrefix
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4291
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4292
    "Modified: / 4.12.1997 / 12:39:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4293
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4294
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4295
resolveClassNamed:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4296
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  4297
     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
  4298
     current namespace and finally in Smalltalk
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4299
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4300
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4301
    ^ Smalltalk resolveName:something inClass:aClass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4302
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4303
3304
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  4304
resolveFont:something
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  4305
    "resolve the font. Delegate to windowBuilder"
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  4306
3304
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  4307
    ^ builder resolveFont:something
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  4308
!
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  4309
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4310
resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4311
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  4312
     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
  4313
     current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  4314
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4315
    ^ self resolveName:something inClass:self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4316
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4317
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4318
resolveName:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4319
    "return the class from something, a class, symbol, string or nil.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4320
     first we are looking in the namespace of the application,
2099
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  4321
     then in the current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  4322
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4323
    |cls|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4324
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4325
    aClass notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4326
        (cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4327
            ^ cls
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4328
        ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4329
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4330
        masterApplication notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4331
            ^ masterApplication resolveName:something
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4332
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4333
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4334
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4335
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4336
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4337
selfResponsibleFor:aKey
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4338
    "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
  4339
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  4340
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  4341
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  4342
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4343
    ^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]])
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4344
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  4345
3192
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4346
shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4347
    "to be redefined by concrete applications:
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4348
     if true is answered, the application's extent is remembered on close
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4349
     and used as a default when opened the next time"
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4350
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4351
    ^ self class shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4352
!
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  4353
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4354
topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4355
    "return the top-master application"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4356
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4357
    masterApplication isNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4358
        ^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4359
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4360
    ^ masterApplication topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4361
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4362
    "Created: / 6.6.1998 / 19:40:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4363
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4364
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1750
diff changeset
  4365
!ApplicationModel methodsFor:'startup & release'!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4366
4256
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4367
activate
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4368
    "Activate my top window (i.e. deiconify & raise and assign focus)"
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4369
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4370
    self topView 
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4371
        raiseDeiconified;
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4372
        activate
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4373
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4374
    "
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4375
     |app|
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4376
     app := WorkspaceApplication new.
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4377
     app openAndWaitUntilVisible.
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4378
     app window collapse.
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4379
     Delay waitForSeconds:3.
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4380
     app activate.
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4381
    "
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4382
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4383
    "Created: / 20-04-2019 / 09:01:46 / Claus Gittinger"
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4384
!
8ec6b049e7ac #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4243
diff changeset
  4385
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4386
releaseAsSubCanvas
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4387
    "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
  4388
     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
  4389
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4390
    "/ used to self release here,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4391
    "/ but that is incompatible to VW (RefactoryBrowser).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4392
    "/ Therefore, if you need it, you MUST now redefine
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4393
    "/ this method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4394
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4395
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4396
rememberLastExtent
4239
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
  4397
    "remember my window's current extent for the next open.
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
  4398
     This is sent when closing the window, 
1c08b05688d9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4232
diff changeset
  4399
     so that it will open with that extent as default the next time"
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4400
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4401
    |window|
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4402
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4403
    window := self window.
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4404
    (window notNil and:[window isTopView]) ifTrue:[
4240
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
  4405
        self class rememberLastExtentOf:window
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4406
    ].
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4407
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4408
    "Created: / 31-07-2013 / 14:41:33 / cg"
4240
a48d4a308b7a #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4239
diff changeset
  4409
    "Modified: / 02-03-2019 / 13:09:12 / Claus Gittinger"
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4410
!
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4411
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4412
restarted
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4413
    "sent by my topWindow, when restarted from an image.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4414
     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
  4415
     required to reset the application after an image-restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4416
     (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
  4417
      subprocesses etc.)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4418
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4419
    "Modified: 1.6.1996 / 16:55:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4420
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4421
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4422
saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4423
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4424
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4425
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4426
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4427
    self closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4428
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4429
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4430
saveAndTerminateRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4431
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4432
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4433
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4434
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4435
    self saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4436
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4437
4076
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4438
!ApplicationModel methodsFor:'testing'!
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4439
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4440
isApplicationModel
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4441
    ^ true
4460
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4442
!
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4443
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4444
isDialog
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4445
    "answer true, if I am an application rpresenting a dialog"
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4446
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4447
    ^ self subclassResponsibility
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4448
e067415ddf46 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 4452
diff changeset
  4449
    "Modified (comment): / 29-04-2020 / 12:39:38 / Stefan Vogel"
4076
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4450
! !
96e3effb62a6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4063
diff changeset
  4451
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4452
!ApplicationModel methodsFor:'translating'!
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4453
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4454
translateString:aString
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4455
    "translate aString to the current language.
3754
c6a86012772b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  4456
     We use the resources as default.
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4457
     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
  4458
4169
4fea9044e433 #BUGFIX by Micha
Michael Beyl <mb@exept.de>
parents: 4164
diff changeset
  4459
    aString size == 0 ifTrue:[^ '']. 
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4460
    ^ self resources stringWithCRs:aString asString
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4461
3936
1007d2747659 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3907
diff changeset
  4462
    "Modified: / 27-02-2017 / 13:50:46 / cg"
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4463
    "Modified: / 09-08-2018 / 18:08:56 / Claus Gittinger"
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4464
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4465
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4466
translateString:aString with:anArgument
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4467
    "translate aString to the current language.
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4468
     We use the resources as default.
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4469
     Subclasses may redefine this to use another mechanism"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4470
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4471
    ^ self resources stringWithCRs:aString asString with:anArgument
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4472
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4473
    "Created: / 25-11-2016 / 09:54:32 / cg"
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4474
    "Modified: / 09-08-2018 / 18:09:26 / Claus Gittinger"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4475
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4476
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4477
translateString:aString with:argument1 with:argument2
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4478
    "translate aString to the current language.
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4479
     We use the resources as default.
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4480
     Subclasses may redefine this to use another mechanism"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4481
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4482
    ^ self resources stringWithCRs:aString asString with:argument1 with:argument2
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4483
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4484
    "Created: / 09-08-2018 / 15:08:11 / Claus Gittinger"
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4485
    "Modified: / 09-08-2018 / 18:09:30 / Claus Gittinger"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4486
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4487
4171
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4488
translateString:aString with:argument1 with:argument2 with:argument3
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4489
    "translate aString to the current language.
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4490
     We use the resources as default.
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4491
     Subclasses may redefine this to use another mechanism"
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4492
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4493
    ^ self resources stringWithCRs:aString asString with:argument1 with:argument2 with:argument3
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4494
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4495
    "Created: / 16-08-2018 / 21:16:40 / Claus Gittinger"
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4496
!
82f53dd7304a #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4170
diff changeset
  4497
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4498
translateString:aString withArguments:anArgumentVector
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4499
    "translate aString to the current language.
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4500
     We use the resources as default.
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4501
     Subclasses may redefine this to use another mechanism"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4502
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4503
    ^ self resources stringWithCRs:aString asString withArguments:anArgumentVector
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4504
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4505
    "Created: / 09-08-2018 / 14:53:55 / Claus Gittinger"
4164
2eceb13fc6de #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4157
diff changeset
  4506
    "Modified: / 09-08-2018 / 18:09:34 / Claus Gittinger"
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4507
! !
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4508
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4509
!ApplicationModel methodsFor:'user interaction & notifications'!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4510
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4511
beep
3442
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4512
    "output an audible beep or bell on my screen device"
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4513
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4514
    device notNil ifTrue:[
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4515
        device beep.
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4516
    ].
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4517
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4518
4049
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4519
beepInEditor
4050
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4520
    "output an audible beep or bell on my screen device.
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4521
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4522
     beep to wakeup the user after some error/not found condition in an editor.
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4523
     Use this ONLY to beep in response to a bad user operation (not system failure beeps).
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4524
     Can be disabled via the settings if too annoying"
5a4fb030d8fd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4049
diff changeset
  4525
4049
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4526
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4527
    device notNil ifTrue:[
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4528
        device beepInEditor.
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4529
    ].
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4530
!
58ed8c411cc0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4047
diff changeset
  4531
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4532
information:aString
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4533
    "like Object's information, but translates the string via the
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4534
     resourcePack, thus giving a translated string automatically"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4535
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4536
    self informationTranslated:aString
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4537
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4538
    "Created: / 20-05-1998 / 03:48:43 / cg"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4539
    "Modified: / 25-11-2016 / 09:55:53 / cg"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4540
    "Modified: / 09-08-2018 / 14:51:32 / Claus Gittinger"
4098
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4541
!
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4542
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4543
information:aString translate:aBoolean
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4544
    "like Object's information, but translates the string via the
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4545
     resourcePack, thus giving a translated string automatically"
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4546
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4547
    self informationUntranslated:(aBoolean
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4548
                    ifTrue:[ self translateString:(aString?'') ]
4098
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4549
                    ifFalse:[ aString ])
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4550
7e4fa9050cad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4094
diff changeset
  4551
    "Created: / 01-06-2018 / 12:51:06 / Claus Gittinger"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4552
    "Modified: / 09-08-2018 / 14:47:38 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4553
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4554
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4555
information:aString with:anArgument
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4556
    "like Object's information, but translates the string via the
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4557
     resourcePack, thus giving a translated string automatically"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4558
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4559
    self informationTranslated:aString with:anArgument
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4560
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4561
    "Created: / 09-08-2018 / 14:50:55 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4562
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4563
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4564
information:aString with:anArgument translate:aBoolean
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4565
    "like Object's information, but translates the string via the
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4566
     resourcePack, thus giving a translated string automatically"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4567
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4568
    self informationUntranslated:
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4569
            (aBoolean
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4570
                ifTrue:[ self translateString:(aString?'') with:anArgument ]
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4571
                ifFalse:[ aString ])
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4572
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4573
    "Created: / 09-08-2018 / 14:51:06 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4574
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4575
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4576
information:aString with:argument1 with:argument2
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4577
    "like Object's information, but translates the string via the
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4578
     resourcePack, thus giving a translated string automatically"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4579
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4580
    self informationTranslated:aString with:argument1 with:argument2
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4581
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4582
    "Created: / 09-08-2018 / 15:07:28 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4583
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4584
4170
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4585
information:aString with:argument1 with:argument2 with:argument3
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4586
    "like Object's information, but translates the string via the
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4587
     resourcePack, thus giving a translated string automatically"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4588
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4589
    self informationTranslated:aString with:argument1 with:argument2 with:argument3
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4590
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4591
    "Created: / 16-08-2018 / 21:15:19 / Claus Gittinger"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4592
!
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4593
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4594
information:aString withArguments:arguments
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4595
    "like Object's information, but translates the string via the
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4596
     resourcePack, thus giving a translated string automatically"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4597
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4598
    self informationTranslated:aString withArguments:arguments
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4599
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4600
    "Created: / 16-08-2018 / 21:15:30 / Claus Gittinger"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4601
!
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4602
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4603
informationHolder
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4604
    "applications which want to show this in some info-area at the bottom
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4605
     should redefine this to return a value holder or action-block"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4606
     
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4607
    ^ [:infoUntranslated | super information:infoUntranslated]
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4608
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4609
    "Created: / 09-08-2018 / 14:48:45 / Claus Gittinger"
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4610
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4611
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4612
informationTranslated:aString
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4613
    "like Object's information, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4614
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4615
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4616
    self informationUntranslated:(self translateString:aString)
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4617
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4618
    "Created: / 25-11-2016 / 09:59:47 / cg"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4619
    "Modified: / 09-08-2018 / 14:47:41 / Claus Gittinger"
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4620
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4621
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4622
informationTranslated:aString with:anArgument
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4623
    "like Object's information, but translates the string via the
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4624
     resourcePack, thus giving a translated string automatically"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4625
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4626
    self informationUntranslated:(self translateString:aString with:anArgument)
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4627
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4628
    "Created: / 25-11-2016 / 10:01:32 / cg"
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4629
    "Modified: / 09-08-2018 / 14:47:45 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4630
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4631
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4632
informationTranslated:aString with:argument1 with:argument2
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4633
    "like Object's information, but translates the string via the
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4634
     resourcePack, thus giving a translated string automatically"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4635
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4636
    self informationUntranslated:(self translateString:aString with:argument1 with:argument2)
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4637
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4638
    "Created: / 09-08-2018 / 15:07:50 / Claus Gittinger"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4639
!
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4640
4170
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4641
informationTranslated:aString with:argument1 with:argument2 with:argument3
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4642
    "like Object's information, but translates the string via the
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4643
     resourcePack, thus giving a translated string automatically"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4644
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4645
    self informationUntranslated:
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4646
            (self translateString:aString with:argument1 with:argument2 with:argument3)
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4647
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4648
    "Created: / 16-08-2018 / 21:15:47 / Claus Gittinger"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4649
!
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4650
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4651
informationTranslated:aString withArguments:arguments
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4652
    "like Object's information, but translates the string via the
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4653
     resourcePack, thus giving a translated string automatically"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4654
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4655
    self informationUntranslated:
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4656
            (self translateString:aString withArguments:arguments)
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4657
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4658
    "Created: / 16-08-2018 / 21:16:05 / Claus Gittinger"
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4659
!
b150f3f83b13 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4169
diff changeset
  4660
4172
60e21342c412 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
  4661
informationUntranslated:aStringOrNil
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4662
    "applications which want to show this in some info-area at the bottom
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4663
     may redefine this or the informationHolder message."
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4664
     
4172
60e21342c412 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
  4665
    self informationHolder value:aStringOrNil
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4666
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4667
    "Created: / 09-08-2018 / 14:47:06 / Claus Gittinger"
4172
60e21342c412 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
  4668
    "Modified (format): / 18-08-2018 / 11:12:21 / Claus Gittinger"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4669
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4670
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4671
notify:aString
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4672
    "like Object's notify, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4673
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4674
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4675
    super notify:(self translateString:aString)
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4676
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4677
    "Created: / 20-05-1998 / 01:14:52 / cg"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4678
    "Modified: / 13-11-2001 / 20:10:12 / cg"
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4679
    "Modified: / 09-08-2018 / 14:52:27 / Claus Gittinger"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4680
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4681
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4682
openDocumentationFile:aFilename
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4683
    HTMLDocumentView notNil ifTrue:[
4063
31ea26b7f26e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  4684
        HTMLDocumentView 
31ea26b7f26e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  4685
            openFullOnDocumentationFile:aFilename 
31ea26b7f26e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  4686
            searchIn:{ (self class packageDirectory / 'doc/online') }.
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4687
    ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4688
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4689
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4690
restoreCursors
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4691
    "restore the original cursors in all of my views"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4692
4143
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4693
    ^ self windowGroup restoreCursors
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4694
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4695
    "Created: / 01-06-1996 / 17:01:24 / cg"
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4696
    "Modified: / 04-07-2018 / 11:11:17 / stefan"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4697
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4698
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4699
showCursor:aCursor
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4700
    "set all of my views cursor to aCursor.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4701
     It can be restored with #restoreCursor."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4702
4143
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4703
    ^ self windowGroup showCursor:aCursor
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4704
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4705
    "Created: / 01-06-1996 / 17:01:09 / cg"
9938d2ad511e #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4133
diff changeset
  4706
    "Modified: / 04-07-2018 / 11:11:26 / stefan"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4707
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4708
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4709
warn:aString
3179
9bcc92bcbcee class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
  4710
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4711
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4712
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4713
    self warnUntranslated:(self translateString:aString)
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4714
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4715
    "Created: / 20-05-1998 / 01:14:52 / cg"
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4716
    "Modified: / 13-11-2001 / 20:10:12 / cg"
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4717
    "Modified: / 09-08-2018 / 15:37:12 / Claus Gittinger"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4718
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4719
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4720
warn:aString translate:aBoolean
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4721
    "like Object's warn, but optionally translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4722
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4723
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4724
    self warnUntranslated:
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4725
        (aBoolean
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4726
                    ifTrue:[ (self translateString:aString) ]
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4727
                    ifFalse:[ aString ]).
4155
406dd6f034d6 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4154
diff changeset
  4728
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4729
    "Modified (format): / 09-08-2018 / 15:37:28 / Claus Gittinger"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4730
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4731
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4732
warn:aString with:arg
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4733
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4734
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4735
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4736
    self warn:aString withArguments:(Array with:arg)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4737
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4738
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4739
warn:aString with:arg1 with:arg2
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4740
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4741
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4742
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4743
    self warn:aString withArguments:(Array with:arg1 with:arg2)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4744
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4745
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4746
warn:aString with:arg1 with:arg2 with:arg3
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4747
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4748
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4749
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4750
    self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4751
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4752
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4753
warn:aString with:arg1 with:arg2 with:arg3 with:arg4
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4754
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4755
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4756
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4757
    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
  4758
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4759
    "Created: / 23.2.2000 / 09:43:04 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4760
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4761
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4762
warn:aString withArguments:argArray
4091
53d5afbb6e26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4077
diff changeset
  4763
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4764
     resourcePack, thus giving a translated string automatically.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4765
     Also translates \'s to newLine."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4766
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4767
    self warnUntranslated:(self translateString:aString withArguments:argArray).
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4768
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4769
    "Modified: / 09-08-2018 / 15:38:12 / Claus Gittinger"
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4770
!
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4771
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4772
warnUntranslated:aString
4180
176a2c4d8683 #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4174
diff changeset
  4773
    "do not translate the string via the resourcePack"
4157
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4774
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4775
    super warn:aString.
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4776
703a5fd557ca #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4156
diff changeset
  4777
    "Created: / 09-08-2018 / 15:33:29 / Claus Gittinger"
4180
176a2c4d8683 #DOCUMENTATION by stefan
Stefan Vogel <sv@exept.de>
parents: 4174
diff changeset
  4778
    "Modified (comment): / 20-09-2018 / 09:46:26 / Stefan Vogel"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4779
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4780
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4781
withCursor:aCursor do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4782
    "evaluate aBlock, showing aCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4783
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4784
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4785
    |w|
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4786
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4787
    w := self window.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4788
    w notNil ifTrue:[
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4789
        ^ w topView withCursor:aCursor do:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4790
    ].
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4791
    ^ aCursor showWhile:aBlock.
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4792
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4793
    "Modified: / 23.9.1998 / 17:00:25 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4794
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4795
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4796
withExecuteCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4797
    "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
  4798
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4799
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4800
    ^ self withCursor:(Cursor execute) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4801
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4802
    "Created: 14.12.1995 / 20:57:03 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4803
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4804
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4805
withReadCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4806
    "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
  4807
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4808
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4809
    ^ self withCursor:(Cursor read) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4810
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4811
    "Created: 14.12.1995 / 20:56:47 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4812
    "Modified: 14.12.1995 / 20:57:36 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4813
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4814
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4815
withVisibleCursor:aCursor do:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4816
    "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
  4817
     Return the value of aBlock.
2940
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4818
     Ensure, that the cursor is visible by the user for a minimal amount of time."
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4819
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4820
    |ret|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4821
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4822
    self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4823
        withCursor:aCursor do:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4824
            |time|
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4825
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4826
            time := Time millisecondsToRun:[ ret := aBlock value].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4827
            time := UserPreferences current waitCursorVisibleTime - time.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4828
            time > 0 ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4829
                Delay waitForMilliseconds:time.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4830
            ].
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4831
        ].
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4832
    ^ ret.
2940
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4833
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4834
    "Modified (comment): / 12-09-2011 / 12:14:31 / cg"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4835
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4836
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4837
withWaitCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4838
    "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
  4839
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4840
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4841
    ^ self withCursor:(Cursor wait) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4842
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4843
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4844
withWaitCursorVisibleDo:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4845
    "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
  4846
     Return the value of aBlock.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4847
     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
  4848
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4849
    ^ self withVisibleCursor:(Cursor wait) do:aBlock
3013
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4850
!
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4851
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4852
withWriteCursorDo:aBlock
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4853
    "evaluate aBlock, showing a writeCursor in my topView and all of its subviews.
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4854
     Return the value of aBlock."
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4855
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4856
    ^ self withCursor:(Cursor write) do:aBlock
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4857
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4858
    "Created: / 27-07-2012 / 09:42:53 / cg"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4859
! !
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4860
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4861
!ApplicationModel methodsFor:'window events'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4862
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4863
clientMessage:msgType format:msgFormat eventData:msgData
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4864
    "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
  4865
     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
  4866
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4867
2526
d2be37e49195 changed #copyDataEvent:eventData:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  4868
copyDataEvent:parameter eventData:msgData
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4869
    "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
  4870
     Subclasses prepared to receive them should redefine this method"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4871
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4872
    |messageStream command argument|
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4873
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4874
    messageStream := msgData asString readStream.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4875
    command := messageStream upTo: $:.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4876
    argument := messageStream upTo: Character null.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4877
    self processApplicationCommand:command with:argument
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4878
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4879
3416
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4880
delayedAutoRaiseEventFor:oneOfMyViews
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4881
    "called with a delay by the focusIn code, iff the userPref setting is active.
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4882
     Some (a small number only) may want to prevent autoraise in certain situations
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4883
     - for example, if one view is controlling another. 
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4884
     These get a chance to redefine this method"
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4885
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4886
    oneOfMyViews raise.
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4887
!
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4888
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4889
dispatchEvent:event
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4890
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4891
     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
  4892
     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
  4893
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4894
    ^ self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4895
        dispatchEvent:event
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4896
        withFocusOn:nil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4897
        delegate:true
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4898
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4899
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4900
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4901
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4902
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4903
     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
  4904
     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
  4905
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4906
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4907
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4908
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4909
    "Modified: / 20.6.1998 / 16:44:05 / cg"
1290
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  4910
!
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  4911
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4912
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
  4913
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4914
     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
  4915
     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
  4916
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4917
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4918
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4919
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4920
    "Modified: / 20.6.1998 / 16:44:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4921
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4922
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4923
dispatchEvent:event withFocusOn:focusViewOrNil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4924
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4925
     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
  4926
     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
  4927
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4928
    ^ self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4929
        dispatchEvent:event
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4930
        withFocusOn:focusViewOrNil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4931
        delegate:true
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4932
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4933
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4934
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4935
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4936
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4937
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4938
     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
  4939
     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
  4940
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4941
    ^ self
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4942
        dispatchEvent:event
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4943
        type:event type
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4944
        arguments:(event arguments)
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4945
        withFocusOn:focusViewOrNil
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4946
        delegate:doDelegate
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4947
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4948
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4949
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4950
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4951
noticeOfWindowClose:aWindow
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4952
    "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
  4953
     Can be redefined in subclasses for cleanup."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4954
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4955
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4956
    self windowEvent:(#close -> aWindow) from:aWindow.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4957
    ^ self
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4958
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4959
    "Created: / 18.6.1998 / 18:56:31 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4960
    "Modified: / 18.6.1998 / 19:14:16 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4961
!
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4962
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4963
noticeOfWindowOpen:aWindow
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4964
    "sent when a topView or applicationSubView has been opened.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4965
     Can be redefined in subclasses."
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4966
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4967
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4968
    self windowEvent:(#open -> aWindow) from:aWindow.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4969
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4970
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4971
    "Created: / 18.6.1998 / 18:56:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4972
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4973
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4974
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4975
processApplicationCommand:command with:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4976
    "a message from a secondary application instance (the exe has been started again).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4977
     Typically, the command is one like 'openPath:', as generated in StandaloneStartup."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4978
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4979
    command = 'openPath' ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4980
        self processOpenPathCommand:argument.
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  4981
        ^ self.
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4982
    ].
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4983
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4984
    Transcript showCR: 'Invalid command received: ', command.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4985
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4986
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4987
processOpenPathCommand:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4988
    "a message from a secondary application instance (the exe has been started again)
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4989
     to open another window on document as found in the pathName argument.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4990
     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
  4991
     editor window if supported."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4992
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4993
3200
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4994
processShortcut:aKeyEvent
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4995
     "a shortcut key event as forwarded from the keyboardProcessor - if there is the
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4996
      shortcut key defined, process the shortcut and return true - otherwise false."
3200
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4997
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4998
    ^false
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4999
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  5000
    "Created: / 23-07-2013 / 18:10:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  5001
!
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  5002
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5003
requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5004
    "the applicationWindow wants to know, if a close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5005
     is ok. Return false if not."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5006
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5007
    |w k|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5008
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5009
    builder notNil ifTrue:[
4173
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  5010
        (w := builder window) notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  5011
            (k := w keyboardProcessor) notNil ifTrue:[
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  5012
                ^ k requestForWindowClose
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  5013
            ]
d2e9d2a8f88f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4172
diff changeset
  5014
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5015
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5016
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5017
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5018
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5019
    "Created: / 19.6.1998 / 01:34:58 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5020
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5021
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5022
showActivity:someMessage
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5023
    "some activityNotification shalt be communicated to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5024
     the user. Forwarded from the topView and ignored here.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5025
     Can be redefined in concrete applications to show the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5026
     message either in some infoView (infoLabel as in Windows)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5027
     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
  5028
4272
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5029
    "/ should be redefined in concrete appModels to display this in an info area 
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5030
    "/ at the bottom of the main window. (see implementors on how to do this)
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5031
    
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5032
    Logger debug:'activity: %1' with:someMessage. 
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5033
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5034
4272
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5035
    "Created: / 16-12-1995 / 18:41:04 / cg"
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5036
    "Modified: / 24-04-1996 / 09:34:22 / cg"
a9fd4c6d13b3 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4270
diff changeset
  5037
    "Modified: / 28-05-2019 / 15:57:55 / Claus Gittinger"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5038
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5039
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5040
windowEvent:anEvent from:anApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5041
    "dummy: windowEvent forwarding is not yet implemented"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5042
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5043
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5044
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5045
    "Modified: 24.4.1996 / 09:32:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5046
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5047
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5048
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5049
2753
f8c6eadde7bb changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
  5050
version_CVS
3484
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  5051
    ^ '$Header$'
85
claus
parents: 83
diff changeset
  5052
! !
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  5053
3108
988608c69014 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3030
diff changeset
  5054
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  5055
ApplicationModel initialize!