ApplicationModel.st
author mawalch
Mon, 22 May 2017 12:19:24 +0200
changeset 3955 23fc9de7f301
parent 3947 e620986b4e2a
child 3971 192921e468df
permissions -rw-r--r--
#DOCUMENTATION by mawalch class: ApplicationModel comment/format in: #showActiveHelp:for:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     1
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
     3
	      All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     4
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     5
 This software is furnished under a license and may be used
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     6
 only in accordance with the terms of that license and with the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     8
 be provided or otherwise made available to, or used by, any
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     9
 other person.  No title to or ownership of the software is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    10
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    11
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    12
"{ Package: 'stx:libview2' }"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    13
3442
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    14
"{ NameSpace: Smalltalk }"
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
    15
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    16
Model subclass:#ApplicationModel
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    17
	instanceVariableNames:'builder resources device masterApplication'
3791
b524b306f7c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
    18
	classVariableNames:'DefaultExtents DefaultLabels DefaultVisuals
b524b306f7c1 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3785
diff changeset
    19
		RecentlyOpenedApplications'
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    20
	poolDictionaries:''
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    21
	category:'Interface-Framework'
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    22
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    23
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    24
ApplicationModel class instanceVariableNames:'ClassResources'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    25
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    26
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    27
 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
    28
"
1350
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    29
!
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    30
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    31
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    32
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
    33
copyright
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    34
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    35
 COPYRIGHT (c) 1995 by Claus Gittinger
2396
3202bf0d2ded *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2395
diff changeset
    36
	      All Rights Reserved
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    37
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    38
 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
    39
 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
    40
 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
    41
 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
    42
 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
    43
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    44
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    45
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    46
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    47
documentation
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
    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
    50
    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
    51
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    52
    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
    53
    compatible to the corresponding ST80 class; therefore, manual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    54
    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
    55
    (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
    56
     for them)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    57
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    58
    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
    59
    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
    60
    first concrete example.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    61
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    62
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    63
    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
    64
    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
    65
    a spec, you should at least redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    66
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    67
	#openInterface   - to create a topview and open it
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    68
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    69
    you may want to redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    70
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    71
	#closeRequest    - to catch window closing
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    72
	#focusSequence   - to define a sequence for focus-stepping
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    73
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    74
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    75
    Once the interfaceBuilder is finished & released, subclasses can
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    76
    alternatively provide the spec via a #windowSpec method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    77
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    78
    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
    79
    applications (which used to be subclasses of StandardSystemView)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    80
    to migrate smoothly into ApplicationModels (which is better design ...).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    81
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    82
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    83
    [Instance variables:]
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    84
	resources    ResourcePack       language string translation
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    85
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    86
	builder      WindowBuilder      a builder who knows how to create
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    87
					a window hierarchy from a specification
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    88
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    89
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    90
    Notice: this class was implemented using protocol information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    91
    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
    92
    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
    93
    please forward a note to the ST/X team.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    94
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    95
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    96
    [author:]
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
    97
	Claus Gittinger
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    98
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    99
    [see also:]
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   100
	StandardSystemView
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   101
	WindowGroup DeviceWorkstation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   102
"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   103
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   104
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   105
howToDealWithMultipleApplicationInstances
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   106
"
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   107
    The following relates to StandAlone applications (i.e. compiled exe's) only.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   108
    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
   109
    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
   110
    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
   111
    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
   112
    by the second application.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   113
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   114
    This is implemented via the following mechanism (see StandaloneStartup):
3704
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   115
        the first application instance leaves the information about its existence somewhere
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   116
            (under win32: in the registry, the window-ID of its main window is remembered;
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   117
             under unix, its stored into a locked file).
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   118
        a mutex is created to prevent a race on this informationduring startup
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   119
            (under win32: a mutex proper; under unix, the above locked file will do)
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   120
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   121
    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
   122
    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
   123
    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
   124
    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
   125
    The second instance simply exits and stops execution.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   126
    This guarantees that only one instance of an application is executing (if desired).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   127
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   128
    The implementation is found in:
3704
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   129
        StandaloneStartup:
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   130
            checkForAndExitIfAnotherApplicationInstanceIsRunning
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   131
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   132
        here:
9f4d55bc899f #OTHER by mawalch
mawalch
parents: 3678
diff changeset
   133
            processOpenPathCommand:aFilename
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   134
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   135
    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
   136
    redefine processOpenPathCommand: in ApplicationModel and also make sure that
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   137
    checkForAndExitIfAnotherApplicationInstanceIsRunning is called for in StandaloneStartup.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   138
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
   139
"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   140
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   141
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   142
!ApplicationModel class methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   143
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   144
initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   145
    self == ApplicationModel ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   146
	Smalltalk addDependent:self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   147
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   148
    DefaultLabels isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   149
	DefaultLabels := IdentityDictionary new
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   150
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   151
    DefaultVisuals isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   152
	DefaultVisuals := IdentityDictionary new
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   153
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   154
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   155
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   156
     ApplicationModel initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   157
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   158
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   159
    "Modified: 28.1.1997 / 12:31:38 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   162
!ApplicationModel class methodsFor:'instance creation'!
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
new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   165
    "return a new initialized instance"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   166
1977
abd5df24333e Make sure to return the new instance in #new (and not the return value
Stefan Vogel <sv@exept.de>
parents: 1972
diff changeset
   167
    ^ self basicNew basicInitialize; initialize; yourself.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   168
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   169
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   170
onDevice:aDevice
1828
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   171
    "return a new initialized instance, which shall open its interface on aDevice."
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   172
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   173
    ^ (super basicNew basicInitialize setDevice:aDevice) initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   174
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   175
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   176
!ApplicationModel class methodsFor:'accessing'!
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
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   179
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   180
3498
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   181
!
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   182
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   183
applicationName
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   184
    "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
   185
     If there is an application definition in my package, ask that one.
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   186
     Otherwise, return my name."
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   187
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   188
    |prjDef|
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 := self projectDefinitionClass) notNil ifTrue:[
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   191
        prjDef isApplicationDefinition ifTrue:[
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   192
            ^ prjDef applicationName
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   193
       ]. 
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   194
    ].
181d97244463 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3496
diff changeset
   195
    ^ self name
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   196
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   197
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   198
!ApplicationModel class methodsFor:'active help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   199
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   200
flyByHelpSpec
3852
a2a449894831 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3851
diff changeset
   201
    "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
   202
2569
4ea35689e2df flyByHelpSpec -> helpSpec
fm
parents: 2568
diff changeset
   203
    ^ self helpSpec
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   204
!
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   205
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   206
helpSpec
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   207
    "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
   208
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   209
    ^ IdentityDictionary new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   210
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   211
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   212
!ApplicationModel class methodsFor:'bindings'!
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
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   215
    "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
   216
     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
   217
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   218
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   219
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   220
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   221
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   222
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   223
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   224
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   225
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   226
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   227
!
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
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   230
    "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
   231
     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
   232
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   233
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   234
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   235
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   236
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   237
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   238
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   239
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   240
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   241
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   242
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   243
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   244
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   245
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   246
    "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
   247
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   248
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   249
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   250
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   251
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   252
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   253
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   254
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   255
    ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   256
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   257
    "/ ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   258
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   259
    "Modified: / 27.10.1997 / 13:43:12 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   260
!
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
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   263
    "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
   264
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   265
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   266
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   267
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   268
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   269
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   270
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   271
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   272
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   273
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   274
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
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   277
colorFor:aSymbol
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   278
    "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
   279
     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
   280
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   281
     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
   282
     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
   283
     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
   284
     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
   285
     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
   286
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   287
    (self respondsTo:aSymbol) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   288
	^ (self perform:aSymbol) value.
2387
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
2481
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   291
    "fall back to a possibly well defined color name"
1fc2941fe30e #colorFor:enhance color name resolution.
Stefan Vogel <sv@exept.de>
parents: 2472
diff changeset
   292
    ^ 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
   293
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   294
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   295
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   296
    "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
   297
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   298
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   299
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   300
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   301
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   302
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   303
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   304
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   305
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   306
    (self respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   307
	^ self perform:aKey
1419
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
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   310
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   311
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   312
fontFor:aSymbol
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   313
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   314
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   315
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   316
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   317
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   318
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   319
     holders from a Dictionary or whatever.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   320
     Typically, a font is returned there."
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   321
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   322
    (self respondsTo:aSymbol) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   323
	^ self perform:aSymbol.
2472
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
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   326
"/    "fall back to a well defined font name"
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   327
"/    (Font respondsTo:aSymbol) ifTrue:[
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   328
"/        ^ Font perform:aSymbol.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   329
"/    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   330
    ^ nil
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   331
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
   332
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   333
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   334
    "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
   335
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   336
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   337
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   338
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   339
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   340
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   341
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   342
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   343
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   344
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   345
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   346
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   347
    app isNil ifTrue:[^ nil].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   348
    (app respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   349
	^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   350
    ].
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   351
    ^ app labelAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   352
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   353
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   354
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   355
    "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
   356
     holder for a list.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   357
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   358
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   359
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   360
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   361
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   362
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   363
     Typically, a list-holding model (SelectionInList) is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   364
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   365
    |app|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   366
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   367
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   368
    app notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   369
	(app respondsTo:aKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   370
	    ^ app perform:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   371
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   372
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   373
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   374
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   375
    "Modified: 4.3.1997 / 00:53:03 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   376
!
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
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   379
    "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
   380
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   381
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   382
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   383
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   384
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   385
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   386
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   387
     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
   388
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   389
    ^ self application perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   390
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   393
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   394
    "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
   395
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   396
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   397
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   398
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   399
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   400
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   401
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   402
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   403
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   404
    ^ self
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   405
	specificationFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   406
	application:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   407
	onDevice:nil
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   408
!
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   409
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   410
specificationFor:aKey application:app onDevice:deviceOrNil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   411
    "sent by the builder to ask for an application provided
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   412
     specification for a subcanvas or subspecification.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   413
     The argument, aKey comes from an UI-spec
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   414
     for a subcanvases #specification property (minorKey).
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   415
     Here, a corresponding message is sent to myself,
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   416
     which ought to be defined in the application subclass.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   417
     Alternatively, a subclass may redefine this method, to provide
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   418
     interfaceSpecifications from a Dictionary or whatever.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   419
     Typically, an interfaceSpecification is returned there."
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   420
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   421
    |displayDevice displayDeviceType modifiedKey appClass|
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   422
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   423
    "/ this code is so ugly...
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   424
    "/ translate the specs name, if the display device type is different
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   425
    "/ 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
   426
    displayDevice := deviceOrNil.
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   427
    displayDevice isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   428
	displayDevice := Screen current.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   429
	displayDevice isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   430
	    displayDevice := Screen default.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   431
	]
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   432
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   433
    displayDevice notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   434
	displayDeviceType := displayDevice deviceType.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   435
	displayDeviceType notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   436
	    modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   437
	    modifiedKey notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   438
		(app respondsTo:modifiedKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   439
		    ^ app perform:modifiedKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   440
		].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   441
		app isBehavior ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   442
		    appClass := app application.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   443
		    (appClass respondsTo:modifiedKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   444
			^ appClass perform:modifiedKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   445
		    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   446
		].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   447
	    ]
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   448
	]
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   449
    ].
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   450
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   451
    app isBehavior ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   452
	(app respondsTo:aKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   453
	    ^ app perform:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   454
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   455
	appClass := app application.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   456
	(appClass respondsTo:aKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   457
	    ^ appClass perform:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   458
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   459
	^ app masterApplication specificationFor:aKey
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   460
    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   461
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   462
    ^ app perform:aKey
2926
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   463
d6663298affa changed: #specificationFor:application:onDevice:
Claus Gittinger <cg@exept.de>
parents: 2923
diff changeset
   464
    "Modified: / 18-07-2011 / 09:28:15 / cg"
1115
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   465
!
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   466
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   467
subApplicationFor:aKey
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   468
    "sent by subCanvas to ask for an application inside itself.
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   469
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   470
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   471
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   472
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   473
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   474
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   475
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   476
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   477
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   478
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   479
    (app respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   480
	^ app perform:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   481
    ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   482
    ^ nil
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   483
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   484
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   485
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   486
    "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
   487
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   488
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   489
     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
   490
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   491
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   492
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   493
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   494
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   495
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   496
    |app|
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   497
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   498
    app := self application.
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   499
    (app respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   500
	^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   501
    ].
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   502
    ^ app visualAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   503
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   504
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   505
!ApplicationModel class methodsFor:'change & update'!
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
update:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   508
    "flush resources on language changes"
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
    something == #Language ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   511
	self flushAllClassResources
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   512
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   513
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   514
    "Created: 15.6.1996 / 15:13:29 / cg"
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
!ApplicationModel class methodsFor:'defaults'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   518
3209
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   519
defaultExtentFor:anApplicationClass
3670
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   520
    "return a default extent for an app-class or nil.
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   521
     If the user has the corresponding userPreference set,
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   522
     previous extents are remembered (at close time)
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   523
     and used as default for the next opening."
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   524
     
3209
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   525
    DefaultExtents notNil ifTrue:[
3670
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   526
        UserPreferences current shouldRememberLastExtent ifTrue:[
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   527
            ^ DefaultExtents at:anApplicationClass name ifAbsent:nil
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   528
        ].
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   529
        "/ flush remebered values
21de0f66fa8e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3666
diff changeset
   530
        DefaultExtents := nil.
3209
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   531
    ].
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   532
    ^ nil.
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   533
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   534
    "Modified: / 31-07-2013 / 18:20:28 / cg"
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   535
!
6b5ee9760eca class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3207
diff changeset
   536
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   537
defaultHttpServerPort
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   538
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   539
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   540
    ^ HTTPServer defaultPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   541
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
   542
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   543
defaultIcon
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   544
    "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
   545
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   546
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   547
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   548
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   549
defaultIconForAboutBox
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   550
    "the icon to be shown in my about-this-app dialog"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
   551
2496
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   552
    ^ self defaultIcon
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   553
!
133bb0589d18 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   554
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   555
defaultServiceLinkName
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   556
    "old web server interface - remove me"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   557
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
   558
    <resource: #obsolete>
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   559
    ^ '/portal'
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   560
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
   561
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   562
labelAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   563
    "default is: no label (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   564
1419
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
labelAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   569
    "default is: no label (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
    ^ aBlock value
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
labelAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   575
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   576
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   577
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   578
labels
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   579
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   580
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   581
!
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
visualAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   584
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   585
1419
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   589
visualAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   590
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   591
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   592
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   593
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   594
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   595
visualAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   596
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   597
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   598
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   599
visuals
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   600
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   601
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   602
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   603
3307
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   604
!ApplicationModel class methodsFor:'font helpers'!
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   605
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   606
resolveFont:aSelector
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   607
    "resolve the font descriobed by aSelector.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   608
     Delegate to a WindowBuilder, whuch may forward to self fontOn:"
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   609
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   610
    |builder|
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   611
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   612
    builder := UIBuilder new isEditing:true; applicationClass:self.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
   613
    ^ builder resolveFont:aSelector.
3307
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   614
! !
38a2edb79086 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3304
diff changeset
   615
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   616
!ApplicationModel class methodsFor:'font specs'!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   617
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   618
buttonFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   619
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   620
    
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   621
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   622
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   623
    ^ Button defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   624
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   625
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   626
buttonFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   627
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   628
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   629
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   630
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   631
    ^ self bigFontFor:(self buttonFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   632
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   633
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   634
buttonFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   635
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   636
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   637
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   638
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   639
    ^ self smallFontFor:(self buttonFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   640
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   641
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   642
inputFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   643
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   644
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   645
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   646
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   647
    ^ EditField defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   648
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   649
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   650
inputFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   651
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   652
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   653
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   654
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   655
    ^ self smallFontFor:(self inputFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   656
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   657
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   658
labelFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   659
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   660
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   661
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   662
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   663
    ^ Label defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   664
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   665
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   666
labelFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   667
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   668
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   669
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   670
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   671
    ^ self bigFontFor:(self labelFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   672
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   673
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   674
labelFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   675
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   676
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   677
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   678
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   679
    ^ self smallFontFor:(self labelFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   680
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   681
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   682
listFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   683
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   684
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   685
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   686
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   687
    ^ SelectionInListView defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   688
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   689
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   690
listFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   691
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   692
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   693
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   694
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   695
    ^ self smallFontFor:(self listFont)
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   696
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   697
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   698
menuFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   699
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   700
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   701
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   702
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   703
    ^ MenuView defaultFont  
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   704
!
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   705
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   706
textFont
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   707
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   708
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   709
    <resource: #fontSpec>
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   710
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   711
    ^ TextView defaultFont  
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   712
!
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   713
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   714
textFontBig
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   715
    "that is a symbolic font"
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   716
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   717
    <resource: #fontSpec>
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   718
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   719
    ^ self bigFontFor:(self textFont)
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   720
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   721
3758
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   722
textFontSmall
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   723
    "that is a symbolic font"
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   724
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   725
    <resource: #fontSpec>
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   726
adf82354e055 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3754
diff changeset
   727
    ^ self smallFontFor:(self textFont)
3335
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   728
! !
27092004f1cc class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3317
diff changeset
   729
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   730
!ApplicationModel class methodsFor:'help'!
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
aboutImage
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   733
    "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
   734
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   735
    ^ self defaultIcon
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   736
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   737
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   738
aboutThisApplicationLabel
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   739
    "label for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   740
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   741
    ^ 'About This Application'
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   742
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   743
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   744
aboutThisApplicationText
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   745
    "text for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   746
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   747
    |rev clsRev msg|
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   748
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   749
    rev := ''.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   750
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   751
    (clsRev := self revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
3546
4d43beec43de #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3543
diff changeset
   752
    msg := "'\' withCRs ," self applicationName allBold, rev.
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   753
    ^ msg
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   754
2981
da09f3d57773 changed: #aboutThisApplicationText
Claus Gittinger <cg@exept.de>
parents: 2980
diff changeset
   755
    "Created: / 13-11-2001 / 12:28:36 / cg"
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   756
!
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   757
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   758
documentationPath
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   759
    |packageDir|
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   760
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   761
    packageDir := Smalltalk getPackageDirectoryForPackage:(self package).
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   762
    packageDir isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   763
	packageDir := Filename defaultDirectory
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   764
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   765
    #(
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   766
	'documentation'
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   767
	'doc'
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   768
    ) do:[:subDir |
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   769
	(packageDir construct:subDir) exists ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   770
	    ^ packageDir construct:subDir
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   771
	].
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   772
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   773
    ^ packageDir construct:'doc'
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   774
! !
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   775
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   776
!ApplicationModel class methodsFor:'history'!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   777
3366
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   778
forgetDefaultExtentFor:anApplicationClass
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   779
    "forget the remembered last extent for some application class.
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   780
     This is sent by the UIPainter, when a windowspec is saved,
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   781
     to bring up the application with its possibly changed default extent"
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   782
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   783
    DefaultExtents notNil ifTrue:[
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   784
        DefaultExtents removeKey:anApplicationClass name ifAbsent:[]
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
!
55e191acf1b0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3365
diff changeset
   787
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   788
forgetRecentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   789
    RecentlyOpenedApplications := nil
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   790
!
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   791
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   792
recentlyOpenedApplications
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   793
    ^ RecentlyOpenedApplications ? #()
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
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   796
rememberRecentlyOpenedApplication
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   797
    "support for the launcher's ''open recent...'' menu function.
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   798
     It is questionable, if dialogs should also be remembered
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   799
     (although it might be convenient dor developers)"
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   800
    
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   801
    |myName|
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   802
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   803
    myName := self name.
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   804
    RecentlyOpenedApplications isNil ifTrue:[
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
   805
        RecentlyOpenedApplications := OrderedCollection new.
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   806
    ].
3882
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   807
    
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   808
    #FIXME.
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   809
    "/ 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
   810
    "/ due to the new SeqCollection...
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   811
    
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   812
    "/ RecentlyOpenedApplications removeAndAddFirst:myName.
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   813
    RecentlyOpenedApplications remove:(self name) ifAbsent:[].
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   814
    RecentlyOpenedApplications addFirst:(self name).
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   815
0d96a44fe4f2 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   816
    "Modified: / 11-02-2017 / 15:05:20 / cg"
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   817
! !
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   818
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   819
!ApplicationModel class methodsFor:'private'!
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   820
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   821
bigFontFor:aFont
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   822
    |newSize|
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   823
    
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   824
    newSize := aFont size * 1.1.
3760
3ce893a0629d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3759
diff changeset
   825
    newSize := newSize ceiling asInteger.
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   826
    ^ aFont asSize:newSize.
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   827
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   828
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   829
selfResponsibleFor:aKey
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   830
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   831
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
   832
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   833
    ^ self respondsTo:aKey
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   834
!
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   835
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   836
smallFontFor:aFont
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   837
    |newSize|
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   838
    
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   839
    newSize := aFont size * 0.9.
3760
3ce893a0629d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3759
diff changeset
   840
    newSize := newSize floor asInteger.
3759
bc70c1966a9d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3758
diff changeset
   841
    ^ aFont asSize:newSize.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   842
! !
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   843
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   844
!ApplicationModel class methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   845
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   846
interfaceSpecFor:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   847
    "return an interface spec"
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   848
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   849
    |specOrSpecArray|
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   851
    specOrSpecArray := self application specificationFor:aSelector.
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   852
    specOrSpecArray isNil ifTrue:[^ nil].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   853
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   854
    "/ app could already return a decoded spec
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   855
    specOrSpecArray isCollection ifFalse:[^ specOrSpecArray].
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   856
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   857
    "/ app returns a literal array
3678
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   858
    MissingClassInLiteralArrayErrorSignal
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   859
        handle:[:ex |
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   860
            |clsInMyNamespace className|
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   861
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   862
            className := ex missingClassName.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   863
            className isSymbol ifTrue:[
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   864
                "retry with my nameSpace"
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   865
                clsInMyNamespace := self nameSpace at:className.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   866
                clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   867
            ].
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   868
            self warn:ex description.
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   869
            ex proceedWith:nil
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   870
        ]
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   871
        do:[
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   872
            ^ UISpecification from:specOrSpecArray
393a135d1c66 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3677
diff changeset
   873
        ]
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   874
2850
01f39c0dfe52 changed: #interfaceSpecFor:
Claus Gittinger <cg@exept.de>
parents: 2849
diff changeset
   875
    "Modified: / 25-07-2010 / 10:36:53 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   876
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   877
2999
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   878
isAbstract
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   879
    ^ self == ApplicationModel
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   880
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   881
    "
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   882
     self isAbstract
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   883
    "
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   884
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   885
    "Created: / 02-03-2012 / 15:56:48 / cg"
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   886
!
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   887
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   888
isVisualStartable
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   889
    "return true, if this application can be started via #open.
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   890
     (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
   891
3811
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
   892
    self isAbstract ifTrue:[^ false].
1556
388922a9c6eb implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   893
    ((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
   894
"/    (self respondsTo:#windowSpec) ifFalse:[^ false].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   895
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   896
2999
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   897
    "Created: / 27-10-1997 / 16:38:02 / cg"
43dab26f33db added: #isAbstract
Claus Gittinger <cg@exept.de>
parents: 2983
diff changeset
   898
    "Modified: / 02-03-2012 / 15:57:02 / cg"
3192
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   899
!
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   900
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   901
shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   902
    "to be redefined by concrete applications:
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   903
     if true is answered, the application's extent is remembered on close
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   904
     and used as a default when opened the next time"
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
   905
3207
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   906
    ^ UserPreferences current shouldRememberLastExtent
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   907
48b8042ea9d6 class: UserPreferences
Claus Gittinger <cg@exept.de>
parents: 3206
diff changeset
   908
    "Modified: / 31-07-2013 / 18:12:07 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   909
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   910
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   911
!ApplicationModel class methodsFor:'resources'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   912
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   913
classResources
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   914
    "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
   915
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   916
    ClassResources isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   917
	ClassResources := super classResources.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   918
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   919
    ^ ClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   920
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   921
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   922
classResources:aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   923
    "allow setting of the classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   924
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   925
    ClassResources := aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   926
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   927
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   928
flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   929
    "flush all classes resource translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   930
     Needed after a resource file / language setting has changed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   931
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   932
    ResourcePack flushCachedResourcePacks.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   933
    self flushClassResources.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   934
    self allSubclassesDo:[:aClass |
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   935
	aClass flushClassResources.
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   936
    ].
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   937
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   938
    WindowGroup scheduledWindowGroups
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   939
	do:[:wg |
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   940
	    |app|
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   941
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   942
	    (app := wg application) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   943
		app initializeResources
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   944
	    ]
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
   945
	]
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   946
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   947
    "Modified: / 13-09-2006 / 12:41:31 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   948
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   949
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   950
flushClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   951
    "flush classes resource string translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   952
     Needed whenever a resource file / language setting has changed"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   953
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   954
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   955
!
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
resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   958
    "return the application's resources -
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
   959
     that's a ResourcePack containing national language strings"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   960
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   961
    ^ self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   962
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   963
    "Created: / 19-05-1998 / 20:14:00 / cg"
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   964
    "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
   965
!
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
updateClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   968
    "update my classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   969
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   970
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   971
    self classResources
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
!ApplicationModel class methodsFor:'startup'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   975
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   976
open
3851
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
   977
    "create an instance of the application and open its view.
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
   978
     Sorry, but for visualworks compatibility, the builder is returned,
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
   979
     not the application instance"
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
   980
     
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   981
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   982
    ^ self new open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   983
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   984
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   985
     Launcher open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   986
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   987
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   988
    "Modified: 13.1.1997 / 20:54:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   989
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   990
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   991
openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   992
    "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
   993
     at some position."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   994
2797
f0eaec0d8847 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2769
diff changeset
   995
    self rememberRecentlyOpenedApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   996
    ^ self new openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   997
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   998
    "Modified: 14.2.1997 / 20:28:41 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1001
openDialogInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1002
    "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
  1003
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1004
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1005
    ^ self openDialogInterface:anInterfaceSymbol withBindings:nil
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
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1008
    "Created: 14.2.1997 / 20:33:10 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1009
    "Modified: 28.2.1997 / 14:07:36 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1012
openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1013
    "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
  1014
     specified by anInterfaceSymbol."
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
    ^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1017
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1018
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1019
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1020
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1021
!
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
openDialogInterfaceSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1024
    "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
  1025
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1026
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1027
    ^ self new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1028
	openDialogInterfaceSpec:anInterfaceSpec
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1029
	withBindings:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1030
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1031
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1032
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1033
    "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
  1034
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1035
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1036
    ^ self new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1037
	openDialogInterfaceSpec:anInterfaceSpec
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1038
	withBindings:bindings
1419
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
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1041
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1042
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1043
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1044
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1045
openDialogSpec:aSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1046
    "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
  1047
     specified by aSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1048
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1049
    ^ self openDialogSpec:aSpec withBindings:nil
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
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1052
    "Modified: / 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1053
    "Created: / 20.5.1998 / 20:27:08 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1056
openDialogSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1057
    "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
  1058
     specified by the spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1059
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1060
    ^ self new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1061
	openDialogSpec:aSpec
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1062
	withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1063
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1064
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1065
    "Modified: / 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1066
    "Created: / 20.5.1998 / 20:26:37 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1069
openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1070
    "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
  1071
     specified by anInterfaceSymbol."
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
    ^ self new openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1074
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1075
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1076
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1077
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1078
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1079
openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1080
    "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
  1081
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1082
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1083
    ^ self new openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1084
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1085
    "Modified: 14.2.1997 / 20:28:47 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1086
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1087
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1088
openLauncherOnInitializedDisplayNamed:displayName
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1089
    |display app wsClass|
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1090
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1091
    wsClass := Smalltalk classNamed:#XWorkstation.
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1092
    wsClass isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1093
	self error:'XWorkstation has not been loaded'
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1094
    ].
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1095
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1096
    [
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1097
	display := wsClass newDispatchingFor:displayName.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1098
	display deviceIOErrorSignal handlerBlock:[:ex |
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1099
	    'DeviceWorkstation [warning]: stop dispatch due to I/O error: ' errorPrint.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1100
	    display errorPrintCR.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1101
	    display brokenConnection.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1102
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1103
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1104
	Screen currentScreenQuerySignal answer:display do:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1105
	    Screen default isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1106
		Smalltalk secureFileIn:'keyboard.rc'.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1107
		"/ Smalltalk secureFileIn:'display.rc'.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1108
		display buttonTranslation:#(1 2 2 4 5 6 7).
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1109
		Screen default:display.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1110
	    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1111
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1112
	    app := NewLauncher new openAndWaitUntilVisible.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1113
	    app windowGroup isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1114
		"terminate event processor on error"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1115
		display stopDispatch.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1116
		self error:'Cannot open'.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1117
	    ] ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1118
		app windowGroup process addExitAction:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1119
		    "reset the default display"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1120
		    Screen default == display ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1121
			Screen default:nil.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1122
		    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1123
		].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1124
	    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1125
	]
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1126
    ] on:Screen deviceOpenErrorSignal do:[:ex|
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1127
	self error:('Cannot connect to display: <1s><br><2s>'
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1128
			expandMacrosWith:displayName with:ex description).
2843
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1129
    ].
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1130
    ^ app
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1131
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1132
    "Created: / 01-06-2010 / 11:23:52 / sr"
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1133
!
ff61eeb992d6 added: #openLauncherOnInitializedDisplayNamed:
sr
parents: 2842
diff changeset
  1134
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1135
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1136
    "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
  1137
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1138
    ^ self new openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1139
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1140
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1141
openOn:anApplicationModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1142
    "send an open message to the argument, anApplicationModel.
3110
721f2bb58301 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3108
diff changeset
  1143
     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
  1144
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1145
    ^ anApplicationModel open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1146
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1147
    "Modified: 13.1.1997 / 20:55:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1148
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1149
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1150
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1151
    "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
  1152
     on ANOTHER device.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1153
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1154
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1155
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1156
    Screen currentScreenQuerySignal
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1157
	answer:aDevice
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1158
	do:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1159
	    ^ (self onDevice:aDevice) open
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1160
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1161
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1162
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1163
     Launcher openOnDevice:Display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1164
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1165
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1166
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1167
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1168
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1169
openOnXScreenNamed:aScreenName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1170
    "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
  1171
     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
  1172
     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
  1173
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1174
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1175
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1176
    |newDevice|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1177
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1178
    (XWorkstation notNil and:[ XWorkstation isLoaded ]) ifFalse:[
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1179
        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
  1180
        ^ self
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1181
    ].    
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1182
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1183
    [
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1184
        newDevice := XWorkstation newDispatchingFor:aScreenName.
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
  1185
    ] on:Screen deviceOpenErrorSignal do:[:ex|
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1186
        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
  1187
        ^ self
995
63d1b9ce554b Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents: 983
diff changeset
  1188
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1189
    ^ self openOnDevice:newDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1190
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1191
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1192
     Launcher openOnXScreenNamed:'sgi:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1193
     Launcher openOnXScreenNamed:'foo:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1194
     NewLauncher openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1195
     NewLauncher openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1196
     SystemBrowser openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1197
     SystemBrowser openOnXScreenNamed:'bitsy:0'
3842
df8f461d3d31 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1198
     SystemBrowser openOnXScreenNamed:'localhost:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1199
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1200
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1201
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1202
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1203
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1204
openWithSpec:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1205
    "ST80 compatibility:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1206
     mhmh - what is the difference to #openInterface ?"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1207
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1208
    ^ self openInterface:aSpecSymbol
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
    "Modified: 29.8.1997 / 01:16:52 / cg"
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1211
! !
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1212
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1213
!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
  1214
3780
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1215
addRequiredForeignServicesTo:anHTTPServer
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1216
    "a hook to allow web apps to register additional services;
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1217
     typically: file services to deliver bitmaps"
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1218
     
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1219
    "/ intentionally left blank here;
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1220
    "/ to be redefined in subclasses
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1221
!
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1222
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1223
initialPageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1224
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1225
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1226
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1227
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1228
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1229
pageSpec
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1230
    "this is only used for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1231
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1232
    ^ self windowSpec
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1233
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1234
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1235
pageSpecs
2769
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1236
    "this is only required for web-applications"
d928dec02c93 comment/format
Claus Gittinger <cg@exept.de>
parents: 2753
diff changeset
  1237
2568
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1238
    self subclassResponsibility
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1239
!
0fa3e0207594 more for web-apps
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
  1240
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1241
startAsWebService
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1242
    "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
  1243
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1244
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1245
     Answer the webService."
2604
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1246
68f9951ec611 startAsWebService returns the new service
Claus Gittinger <cg@exept.de>
parents: 2586
diff changeset
  1247
    ^ self startAsWebService:(self webServiceLinkName)
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1248
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1249
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1250
     self startAsWebService
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1251
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1252
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1253
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1254
startAsWebService:linkName
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1255
    "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
  1256
     Start a web service for myself on link, an URL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1257
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1258
     Answer the webService.
2580
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1259
     Start a HTTP server, if not already running"
a7c51ca27505 Comments.
Stefan Vogel <sv@exept.de>
parents: 2579
diff changeset
  1260
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1261
    ^ HTTPPortalService
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1262
	startWithApplication:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1263
	link:linkName
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1264
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1265
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1266
     self startAsWebService:'hello'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1267
     UBS::UBSUsecase startAsWebService:'uuu'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1268
    "
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1269
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1270
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1271
startAsWebService:linkName inServer:httpServer
2631
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1272
    "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
  1273
     Start a web service for myself on the default webService linkURL.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1274
     The webService will create new instances of me for incoming sessions.
309f5bc96e08 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  1275
     Answer the webService.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1276
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1277
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1278
    ^ HTTPPortalService
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1279
	startWithApplication:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1280
	inServer:httpServer
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1281
	link:linkName
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1282
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1283
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1284
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1285
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1286
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1287
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1288
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1289
startAsWebService:linkName onPort:httpPort
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.
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1294
     Start a HTTP server, if not already running"
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1295
3780
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1296
    |service httpServer|
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1297
    
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1298
    service := HTTPPortalService
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1299
            startWithApplication:self
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1300
            inServer:(httpServer := HTTPServer serverOnPort:httpPort)
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1301
            link:linkName.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1302
    self addRequiredForeignServicesTo:httpServer.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1303
    ^ service.
5b25498da7d2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3764
diff changeset
  1304
    
2629
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1305
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1306
     self startAsWebService:'hello'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1307
     UBS::UBSUsecase startAsWebService:'uuu'
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1308
    "
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1309
!
06fea1ffe766 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2624
diff changeset
  1310
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1311
startAsWebService_old
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1312
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1313
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1314
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1315
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1316
    app := self basicNew.
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  1317
    app initializeAsWebServiceOnWebDevice:(WebApplicationDevice new).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1318
    app startAsWebService.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1319
    ^ app
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1320
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1321
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1322
     PortalTests::TestApplication1 startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1323
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1324
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1325
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1326
startInPortalService:aPortalServiceOrSession
2542
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1327
    "this is not yet a public interface. For internal exept use only"
514a2e2e75b6 comments
Claus Gittinger <cg@exept.de>
parents: 2541
diff changeset
  1328
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1329
    |app|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1330
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1331
    app := self basicNew.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1332
    app setDevice:(WebApplicationDevice new).
2544
2df3456aa8f7 initialization if I am a webService
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
  1333
    app initialize.
2543
df4bb767ea8b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2542
diff changeset
  1334
    app initializeResources.
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  1335
    app startInPortalService:aPortalServiceOrSession.
2605
20daca97e6c0 return values
Claus Gittinger <cg@exept.de>
parents: 2604
diff changeset
  1336
    ^ app.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1337
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1338
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1339
     PortalTests::TestApplication1
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1340
	startInPortalService:
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1341
	    (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
  1342
    "
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1343
!
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1344
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1345
webServiceLinkName
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1346
    "the link name, under which instances of myself are found in the httpServer"
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1347
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1348
    "/ typically, redefined as:
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1349
    ^ self name asLowercaseFirst
2579
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1350
    "/ or
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1351
    "/  ^ 'ubs'
85e611561864 *** empty log message ***
sr
parents: 2569
diff changeset
  1352
2581
c29b5ff7245f *** empty log message ***
sr
parents: 2580
diff changeset
  1353
"/    ^ self subclassResponsibility
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1354
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1355
3455
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1356
!ApplicationModel methodsFor:'Compatibility-VW'!
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1357
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1358
mainWindow
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1359
    ^ self window topView.
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1360
! !
0580d1c03d8b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3448
diff changeset
  1361
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1362
!ApplicationModel methodsFor:'accessing'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1363
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1364
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1365
    "application knows about interfaceSpecs, menuSpecs etc.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1366
     Usually this is my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1367
     This may be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1368
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1369
    ^ self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1370
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1371
    "Modified: / 5.2.1998 / 00:45:21 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1372
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1373
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1374
builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1375
    "return the applications builder; this one has more information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1376
     about views, components etc."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1377
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1378
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1379
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1380
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1381
builder:aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1382
    "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
  1383
     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
  1384
     was created."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1385
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1386
    builder := aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1387
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1388
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1389
componentAt:name
2747
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1390
    "return a component identified by its name"
66277799abc8 comment
Claus Gittinger <cg@exept.de>
parents: 2691
diff changeset
  1391
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1392
    ^ self builder componentAt:name
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1393
!
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
  1394
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1395
device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1396
    device isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1397
	self isWebService ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1398
	    device := WebApplicationDevice new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1399
	]
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1400
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1401
    ^ device
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1402
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  1403
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1404
masterApplication
3279
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1405
    "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
  1406
     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
  1407
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1408
    ^ masterApplication
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  1409
!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1410
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1411
masterApplication:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1412
    "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
  1413
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1414
    something == self ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1415
	self error:'an application cannot be its own masterApplication' mayProceed:true.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1416
	^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1417
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1418
    masterApplication := something.
2566
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1419
18b459bfc4d3 masterApplication: care for compatible device
sr
parents: 2561
diff changeset
  1420
    "/ ensure that the device is compatible.
2567
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1421
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1422
	device := masterApplication device.
2567
186b9a791442 changed #masterApplication:
sr
parents: 2566
diff changeset
  1423
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1424
!
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
resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1427
    "return the application's resources -
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1428
     that's a ResourcePack containing national language strings"
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1429
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1430
    resources isNil ifTrue:[
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1431
        masterApplication notNil ifTrue:[
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1432
            ^ masterApplication resources
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1433
        ]
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
  1434
    ].
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1435
    resources isNil ifTrue:[
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1436
        ^ ResourcePack new
2609
a78a9e0380b1 added warn:translate: to avoid double translation
Claus Gittinger <cg@exept.de>
parents: 2605
diff changeset
  1437
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1438
    ^ resources
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1439
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1440
    "Modified (comment): / 25-11-2016 / 15:25:28 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1441
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1442
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1443
resources:aResourcePack
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1444
    "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
  1445
     except for manually built dialogs"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1446
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1447
    resources := aResourcePack
3800
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1448
23bb1611cbbd #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1449
    "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
  1450
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1451
3279
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1452
topMasterApplication
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1453
    "return the topmost master application. Useful when nested subapplications are used"
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1454
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1455
    masterApplication isNil ifTrue:[^ self].
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1456
    ^ masterApplication topMasterApplication
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1457
!
196ff4d5d5ad class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3256
diff changeset
  1458
3256
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1459
topView
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1460
    "SimpleView compatibility - answer my topWindow"
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1461
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1462
    ^ self window
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1463
!
1eaaec0de5fe class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3240
diff changeset
  1464
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1465
window
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1466
    "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
  1467
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1468
    |win|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1469
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1470
    builder isNil ifTrue:[^ nil].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1471
    (win := builder window) notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1472
	^ win
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1473
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1474
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1475
	masterApplication ~~ self ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1476
	    "/ is that true ?
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1477
	    ^ masterApplication window
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1478
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1479
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1480
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1481
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1482
    "Modified: / 18.9.1998 / 15:18:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1483
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1484
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1485
window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1486
    "set my topWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1487
     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
  1488
     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
  1489
     when the builder is accessed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1490
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1491
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1492
	self createBuilder
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
    builder window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1495
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1496
    "Created: 18.4.1996 / 14:55:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1497
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1498
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1499
windowGroup
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1500
    "return the applications windowGroup"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1501
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1502
    |myWindow wg|
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1503
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1504
    builder notNil ifTrue:[
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1505
        (myWindow := builder window) notNil ifTrue:[
3907
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1506
            ^ myWindow windowGroup.
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1507
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1508
"/ Disabled. Leads to Bug https://expeccoalm.exept.de/D179727
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1509
"/ (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
  1510
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1511
"/            (wg := myWindow windowGroup) notNil ifTrue:[
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1512
"/                ^ wg
d2cafa2a9bb8 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3906
diff changeset
  1513
"/            ].
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1514
            #FIXME. "or at least: think about it"
3906
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1515
"/ Disabled. Leads to Bug https://expeccoalm.exept.de/D179727
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1516
"/ (Close on ExpeccoSettingsDialog closes also Expecco)
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1517
"/            "/ mhmh - it seems that a window was previously closed
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1518
"/            "/ but kept around, and is now reopened.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1519
"/            "/ So it lost its windowGroup.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1520
"/            "/ happens for example, when the expecco-guiBrowser is closed and reopened.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1521
"/            "/ 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
  1522
"/            "/ at the place, where it is reopened...
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1523
"/            "/ 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
  1524
"/            "/ Don't do this unconditionally:
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1525
"/            "/ applications may (and do) run in a separate windowGroup
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1526
"/            "/ from the master - for example to allow interaction while the other
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1527
"/            "/ is busy.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1528
"/            "/ 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
  1529
"/            "/ 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
  1530
"/            masterApplication notNil ifTrue:[
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1531
"/                (wg := masterApplication windowGroup) notNil ifTrue:[
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1532
"/                    myWindow windowGroup:wg.
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1533
"/                    ^ wg
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1534
"/                ].    
c456598a9f19 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3882
diff changeset
  1535
"/            ].    
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1536
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1537
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1538
    masterApplication notNil ifTrue:[
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1539
        ^ masterApplication windowGroup
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1540
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1541
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1542
3881
0a7eb980eca0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3864
diff changeset
  1543
    "Modified (comment): / 11-02-2017 / 11:46:37 / cg"
3195
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1544
!
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1545
bad1f2ae24eb class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3193
diff changeset
  1546
windowTitle:aString
3472
2baae8443032 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3455
diff changeset
  1547
    builder windowTitle:aString
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1548
! !
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
!ApplicationModel methodsFor:'binding access'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1551
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1552
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1553
    "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
  1554
     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
  1555
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1556
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1557
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1558
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1559
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1560
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1561
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1562
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1563
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1564
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1565
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1566
	    ^ masterApplication actionFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1567
	].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1568
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1569
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1570
    ^ MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1571
    "/ ^ [self perform:aKey]   "/ could use:  MessageSend receiver:self selector:aKey
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1572
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1573
    "Modified: / 28-07-2010 / 11:56:49 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1574
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1575
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1576
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1577
    "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
  1578
     a Button which passes a value.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1579
     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
  1580
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1581
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1582
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1583
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1584
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1585
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1586
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1587
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1588
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1589
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1590
	    ^ masterApplication actionFor:aKey withValue:aValue
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1591
	].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1592
    ].
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1593
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1594
"/ sigh - too many senders of #isBlock around...
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1595
"/    ^ MessageSend receiver:self selector:aKey argument:aValue
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1596
     ^ [self perform:aKey with:aValue]
2853
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1597
3c021208873a changed:
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1598
    "Modified: / 28-07-2010 / 11:56:42 / cg"
2863
d4a525e2ac4e changed: #actionFor:withValue:
sr
parents: 2853
diff changeset
  1599
    "Modified: / 30-07-2010 / 10:40:35 / sr"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1600
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1601
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1602
actionFor:aKey withValue:value1 withValue:value2
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1603
    "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
  1604
     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
  1605
     Here, a corresponding message is sent to myself,
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1606
     which ought to be defined in the application subclass.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1607
     Alternatively, a subclass may redefine this method, to provide
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1608
     actionBlocks from a Dictionary or whatever.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1609
     Typically, a block is returned there."
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1610
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1611
    aKey isNil ifTrue:[ self error:'nil action key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1612
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1613
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1614
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1615
	    ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1616
	].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1617
    ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1618
    ^ [self perform:aKey with:value1 with:value2]
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1619
!
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
  1620
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1621
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1622
    "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
  1623
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1624
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1625
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1626
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1627
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1628
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1629
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1630
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1631
    aKey isNil ifTrue:[ self error:'nil aspect key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1632
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1633
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1634
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1635
	    ^ masterApplication aspectFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1636
	].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1637
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1638
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1639
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1640
    "Modified: / 18.6.1998 / 20:33:23 / cg"
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
1742
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1643
aspectOrNil:aKey forSubApplication:aSubApp
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1644
    ^ nil
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1645
!
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1646
3515
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1647
aspectValueFor:aspectKeySymbol
3514
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1648
    "fetch an aspect's value
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1649
     same as (self aspectFor:aKey) value"
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1650
3515
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1651
    ^ (self aspectFor:aspectKeySymbol) value
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1652
!
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1653
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1654
aspectValueOr:default for:aspectKeySymbol
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1655
    "common helper - fetches the aspect value; 
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1656
     if it is nil, return a default."
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1657
6997e791c077 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3514
diff changeset
  1658
    ^ (self aspectValueFor:aspectKeySymbol) ? default
3514
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1659
!
666702598f5c #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3498
diff changeset
  1660
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1661
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1662
    "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
  1663
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1664
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1665
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1666
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1667
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1668
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1669
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1670
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1671
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1672
    aKey isNil ifTrue:[ self error:'nil client key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1673
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1674
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1675
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1676
	    ^ masterApplication clientFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1677
	].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1678
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1679
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1680
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1681
    "Modified: / 18.6.1998 / 20:33:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1682
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1683
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1684
colorFor:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1685
    "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
  1686
     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
  1687
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1688
     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
  1689
     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
  1690
     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
  1691
     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
  1692
     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
  1693
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1694
    (self respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1695
	^ (self perform:aKey) value
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1696
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1697
    (self class respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1698
	^ (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
  1699
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1700
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1701
	^ masterApplication colorFor:aKey
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1702
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1703
    ^ self class colorFor:aKey.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1704
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1705
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1706
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1707
    "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
  1708
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1709
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1710
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1711
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1712
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1713
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1714
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1715
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1716
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1717
    aKey isNil ifTrue:[ self error:'nil component key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1718
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1719
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1720
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1721
	    ^ masterApplication componentFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1722
	].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1723
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1724
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1725
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1726
    "Modified: / 18.6.1998 / 20:33:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1727
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1728
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1729
fontFor:aKey
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1730
    "sent by the builder to ask for an application provided font.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1731
     The argument, aKey comes from an UI-spec
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1732
     for a widgets #*Font property.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1733
     Here, a corresponding message is sent to myself,
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1734
     which ought to be defined in the application subclass.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1735
     Alternatively, a subclass may redefine this method, to provide
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1736
     holders from a Dictionary or whatever.
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1737
     Typically, a font is returned there.
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1738
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1739
     Use #resolveFont:, if you are not a builder!!"
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1740
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1741
    (self respondsTo:aKey) ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1742
        ^ self perform:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1743
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1744
    (self class respondsTo:aKey) ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1745
        ^ self class perform:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1746
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1747
    masterApplication notNil ifTrue:[
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  1748
        ^ masterApplication fontFor:aKey
2472
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1749
    ].
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1750
    ^ self class fontFor:aKey.
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1751
!
882f7468e7f0 symbolic font resolving
Claus Gittinger <cg@exept.de>
parents: 2445
diff changeset
  1752
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1753
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1754
    "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
  1755
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1756
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1757
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1758
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1759
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1760
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1761
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1762
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1763
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1764
    aKey isNil ifTrue:[ self error:'nil label key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1765
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1766
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1767
	(self respondsTo:aKey) ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1768
	    ^ masterApplication labelFor:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1769
	].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1770
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1771
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1772
    (self respondsTo:aKey) ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1773
	(self class respondsTo:aKey) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1774
	    ^ self class perform:aKey
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1775
	].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1776
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1777
    ^ self perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1778
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1779
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1780
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1781
    "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
  1782
     holder for a list (for example, a popUpLists list).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1783
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1784
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1785
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1786
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1787
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1788
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1789
     Typically, a list-holding model (SelectionInList) is returned there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1790
     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
  1791
     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
  1792
     chance."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1793
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1794
    |a|
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
    aKey isNil ifTrue:[ self error:'nil list key' ].
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1797
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1798
    a := self aspectFor:aKey.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1799
    a notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1800
	^ a
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
    ^ self application listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1803
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1804
    "Modified: / 18.6.1998 / 20:33:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1805
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1806
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1807
menuFor:key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1808
    "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
  1809
     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
  1810
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1811
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1812
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1813
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1814
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1815
     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
  1816
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1817
    | menu |
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1818
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1819
    key isNil ifTrue:[ self error:'nil menu key' ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1820
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1821
    "/ Ask myself first...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1822
    (thisContext isRecursive not and:[ self respondsTo: key ]) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1823
	menu := self perform: key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1824
    ] ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1825
	"/ Ask my class...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1826
	(self class respondsTo: key) ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1827
	    menu := self class perform: key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1828
	] ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1829
	    "/ Ask masterApplication if any...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1830
	    masterApplication notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1831
		menu := masterApplication menuFor: key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1832
	    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1833
	].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1834
    ].
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  1835
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1836
    "/ 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
  1837
    menu isArray ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1838
	menu :=  Menu decodeFromLiteralArray: menu.
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1839
    ].
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1840
    ^ menu.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1841
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1842
    "Modified: / 18-06-1998 / 20:33:56 / cg"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1843
    "Modified: / 24-01-2014 / 09:46:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1844
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1845
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1846
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1847
    "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
  1848
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1849
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1850
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1851
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1852
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1853
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1854
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1855
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1856
3811
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1857
    ^ self class
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1858
        specificationFor:aKey
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1859
        application:self
8b644e261e17 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3800
diff changeset
  1860
        onDevice:(self graphicsDevice)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1861
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1862
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1863
subApplicationFor:aKey
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1864
    "sent by subCanvas to ask for an application inside itself.
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1865
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1866
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1867
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1868
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1869
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1870
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1871
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1872
     (self respondsTo:aKey) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1873
	 ^ self perform:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1874
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1875
     masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1876
	 ^ masterApplication subApplicationFor:aKey
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1877
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1878
     ^ nil.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1879
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1880
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1881
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1882
    "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
  1883
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1884
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1885
     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
  1886
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1887
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1888
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1889
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1890
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1891
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1892
    ^ self application visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1893
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1894
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1895
!ApplicationModel methodsFor:'building'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1896
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1897
allButOpen
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1898
    "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
  1899
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1900
    ^ self allButOpenInterface:(self defaultWindowSpecName).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1901
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1902
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1903
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1904
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1905
allButOpenFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1906
    "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
  1907
     The argument is a spec which defines the interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1908
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1909
    |window|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1910
2691
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1911
    window notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1912
	self error:'building twice (window is already built) ?' mayProceed:true.
2691
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1913
    ].
5fdc86bfcf2c error if building twice
Claus Gittinger <cg@exept.de>
parents: 2689
diff changeset
  1914
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1915
"/ DISABLED; see comment in basicInitialize
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1916
"/
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1917
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1918
"/     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
  1919
"/     instance of the no-op WindowBuilder. Now, it becomes
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1920
"/     a UIBuilder ....
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1921
"/     This allows for ApplicationModels without a UIBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1922
"/     if not needed.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1923
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1924
"/    realBuilder := UIBuilder new.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1925
"/    builder := realBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1926
"/    builder application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1927
"/    builder bindings:builder bindings.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1928
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1929
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1930
	self createBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1931
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1932
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1933
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1934
    builder buildWindowFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1935
    window := builder window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1936
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1937
    window model:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1938
    (window respondsTo:#application:) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1939
	window application:self.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1940
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1941
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1942
    self showingHelp ifTrue: [ActiveHelp startFor: self].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1943
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1944
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1945
    "Modified: / 19.6.1998 / 03:35:31 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1946
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1947
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1948
allButOpenInterface:aSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1949
    "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
  1950
     The argument specifies a selector of a method,
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1951
     which when sent to myself should return a spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1952
     Notice, this returns the windowBuilder."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1953
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1954
    self allButOpenFrom:(self interfaceSpecFor:aSymbol).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1955
    ^ builder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1956
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1957
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1958
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1959
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1960
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1961
    "build a subcanvases spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1962
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1963
    |sameApp prevSpec prevSource|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1964
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1965
    aBuilder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1966
	prevSpec := aBuilder spec.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1967
	prevSource := aBuilder source.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1968
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1969
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1970
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1971
	builder := aBuilder.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1972
	aBuilder isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1973
	    self createBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1974
	]
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1975
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1976
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1977
    aBuilder source:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1978
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1979
    "/ if the subcanvases appModel is NOT the same as
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1980
    "/ the topApp, it must be pre/post-built.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1981
    "/ Otherwise, we invoke pre/post-builtAsSubcanvas.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1982
    "/ which provides a hook for redefinition in concrete appModels.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1983
    "/ This avoids invoking pre/postBuild twice for subCanvases which
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1984
    "/ have the topApp as appModel.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1985
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1986
    sameApp := aBuilder application == aBuilder window topView application.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1987
    sameApp ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1988
	self preBuildAsSubcanvasWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1989
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1990
	self preBuildWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1991
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1992
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1993
    aBuilder buildFromSpec:specToBuild.
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
    sameApp ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1996
	self postBuildAsSubcanvasWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1997
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  1998
	self postBuildWith:aBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1999
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2000
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2001
    prevSpec notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2002
	"/ restore state in builder if original builder was used
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2003
	aBuilder spec:prevSpec.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2004
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2005
    prevSource notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2006
	"/ restore state in builder if original builder was used
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2007
	aBuilder source:prevSource.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2008
    ].
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
    ^ aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2011
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2012
    "Created: / 18-06-1998 / 20:08:45 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2013
    "Modified: / 27-10-2006 / 11:45:25 / cg"
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
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2016
buildSubCanvas:spec withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2017
    "build a subcanvases' spec into aSubcanvas"
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
    self buildSubCanvas:spec withMenu:false withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2020
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2021
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2022
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2023
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2024
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2025
    |specToBuild|
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
    specToBuild := spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2028
    withMenuBoolean ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2029
	"/ subapps should not build the menu and other fullSpec stuff.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2030
	spec class == FullSpec ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2031
	    specToBuild := spec component.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2032
	]
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2033
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2034
    self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
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
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2037
!ApplicationModel methodsFor:'component manipulations'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2038
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2039
components:aSymbolOrArray do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2040
    "evaluate aBlock for all components listed aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2041
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2042
    |coll|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2043
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2044
    aSymbolOrArray isSymbol ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2045
	"/ a single components name
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2046
	coll := Array with:aSymbolOrArray
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2047
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2048
	coll := aSymbolOrArray
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2049
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2050
    coll do:[:aSymbol |
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2051
	|component|
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2052
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2053
	(component := self componentFor:aSymbol) isNil ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2054
	    aBlock value:component
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2055
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2056
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2057
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2058
    "Modified: 26.3.1997 / 16:23:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2059
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2060
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2061
disable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2062
    "disable the components whose id's are aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2063
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2064
    self components:aSymbolOrArray do:[:comp | comp disable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2065
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2066
    "Modified: 14.2.1997 / 17:32:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2067
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2068
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2069
enable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2070
    "enables the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2071
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2072
    self components:aSymbolOrArray do:[:comp | comp enable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2073
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2074
    "Modified: 14.2.1997 / 17:32:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2075
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2076
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2077
invalidate:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2078
    "invalidates the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2079
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2080
    self components:aSymbolOrArray do:[:comp | comp invalidate]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2081
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2082
    "Modified: 14.2.1997 / 17:32:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2083
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2084
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2085
makeInvisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2086
    "makes the components whose id's are aSymbolOrArray invisible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2087
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2088
    self components:aSymbolOrArray do:[:comp | comp beInvisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2089
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2090
    "Modified: 14.2.1997 / 17:32:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2091
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2092
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2093
makeReadOnly:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2094
    "make all components identified by aSymbolOrArray read only
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2095
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2096
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2097
    self components:aSymbolOrArray do:[:comp | comp readOnly:true]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2098
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2099
    "Modified: 14.2.1997 / 17:36:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2100
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2101
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2102
makeVisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2103
    "makes the components whose id's are aSymbolOrArray visible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2104
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2105
    self components:aSymbolOrArray do:[:comp | comp beVisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2106
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2107
    "Modified: 14.2.1997 / 17:32:52 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2108
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2109
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2110
makeWritable:aSymbolOrArray
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2111
    "make all components identified by aSymbolOrArray writable
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2112
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2113
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2114
    self components:aSymbolOrArray do:[:comp | comp readOnly:false]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2115
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2116
    "Created: 14.2.1997 / 17:36:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2117
! !
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
!ApplicationModel methodsFor:'copying'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2120
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2121
postCopy
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2122
    builder := device := nil.
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
    "Created: / 19.4.1998 / 11:44:44 / cg"
2053
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2125
!
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2126
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2127
postDeepCopy
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2128
    builder := device := nil.
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2129
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  2130
    "Created: / 19.4.1998 / 11:44:44 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2131
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2132
3651
05e12fada50b #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3618
diff changeset
  2133
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2134
!ApplicationModel methodsFor:'delayed actions (enqueue)'!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2135
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2136
delayedUpdate:something with:aParameter from:changedObject
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2137
    "support for delayed updates -
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2138
     subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:)
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2139
     must also redefine this method, and perform the actual update there."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2140
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2141
    ^ self
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2142
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2143
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2144
enqueueDelayedAction:aBlock
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2145
    "This will enqueue a delayed action - the application-process will
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2146
     eventually execute aBlock.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2147
     Useful for synchronization"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2148
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2149
    ^ self
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2150
	enqueueMessage:#value
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2151
	for:aBlock
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2152
	arguments:#().
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2153
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2154
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2155
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2156
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2157
enqueueDelayedUpdate:something with:aParameter from:changedObject
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2158
    "support for delayed updates - to be invoked from a concrete classes
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2159
     #update:with:from: method.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2160
     This will enqueue a delayed update, and resend #delayedUpdate:with:from:
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2161
     whenever the receiver is handling events.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2162
     Especially useful, if many updates arrive at high frequency, to avoid
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2163
     multiple redraws."
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2164
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2165
    ^ self
3448
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2166
        enqueueMessage:#delayedUpdate:with:from:
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2167
        for:self
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2168
        arguments:{ something . aParameter . changedObject }.
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2169
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2170
    "Modified: / 26.2.2000 / 18:01:44 / cg"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2171
!
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2172
3542
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2173
enqueueMessage:selector 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2174
    "enqueue a message without arguments to be sent to myself later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2175
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2176
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2177
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2178
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2179
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2180
    self enqueueMessage:selector for:self arguments:#()
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2181
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2182
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2183
enqueueMessage:selector arguments:argumentArray 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2184
    "enqueue a message to be sent to myself later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2185
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2186
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2187
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2188
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2189
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2190
    self enqueueMessage:selector for:self arguments:argumentArray
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2191
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2192
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2193
enqueueMessage:selector for:someone 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2194
    "enqueue a message without arguments to be sent to someone later, 
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2195
     when my process is back in its eventLoop. Also, filter duplicates.
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2196
     This is useful, to buffer redraws and avoid flicker due to multiple
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2197
     redraws (especially in browsers, when reacting on changeMessages resulting
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2198
     from changes made in other browsers)"
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2199
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2200
    self enqueueMessage:selector for:someone arguments:#()
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2201
!
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2202
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2203
enqueueMessage:selector for:someone arguments:argList
3542
d8217915da41 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3540
diff changeset
  2204
    "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
  2205
     is back in its eventLoop. Also, filter duplicates.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2206
     This is useful, to buffer redraws and avoid flicker due to multiple
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2207
     redraws (especially in browsers, when reacting on changeMessages resulting
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2208
     from changes made in other browsers)"
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2209
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2210
    |window sensor|
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2211
2561
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2212
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2213
    self isWebService ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2214
        self breakPoint:#sr.
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2215
        ^ self
2561
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2216
    ].
988773d7d69a changed #enqueueMessage:for:arguments:
sr
parents: 2557
diff changeset
  2217
3527
sr
parents: 3524
diff changeset
  2218
    ((window := self window) notNil and:[window isOpen]) ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2219
        sensor := window sensor.
2556
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
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2222
    sensor isNil ifTrue:[
3444
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2223
        "no window (yet or any longer)"
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2224
        someone perform:selector withArguments:argList.
0dcda0d77105 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3442
diff changeset
  2225
        ^ self.
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2226
    ].
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2227
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
    "/ if such a message is already in the queue, ignore it.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2230
    "/ 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
  2231
    "/ back in the event loop.
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2232
    "/
3448
587ee262282f class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
  2233
    sensor enqueueMessage:selector for:someone arguments:argList
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2234
2902
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2235
    "Created: / 26-02-2000 / 18:01:31 / cg"
c47d671282f9 comment/format in: #enqueueMessage:for:arguments:
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  2236
    "Modified: / 23-03-2011 / 19:46:41 / cg"
3543
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2237
!
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2238
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2239
enqueueMessage:selector with:argument 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2240
    "enqueue a message with one argument to be sent to myself later, 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2241
     when my process is back in its eventLoop. Also, filter duplicates.
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2242
     This is useful, to buffer redraws and avoid flicker due to multiple
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2243
     redraws (especially in browsers, when reacting on changeMessages resulting
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2244
     from changes made in other browsers)"
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2245
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2246
    self enqueueMessage:selector for:self arguments:{ argument }
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2247
!
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2248
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2249
enqueueMessage:selector with:argument1 with:argument2
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2250
    "enqueue a message with one argument to be sent to myself later, 
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2251
     when my process is back in its eventLoop. Also, filter duplicates.
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2252
     This is useful, to buffer redraws and avoid flicker due to multiple
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2253
     redraws (especially in browsers, when reacting on changeMessages resulting
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2254
     from changes made in other browsers)"
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2255
d1d2688ebb49 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 3542
diff changeset
  2256
    self enqueueMessage:selector for:self arguments:{ argument1. argument2 }
2556
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2257
! !
7b4fce0b3b2a changed #enqueueDelayedAction:
Claus Gittinger <cg@exept.de>
parents: 2555
diff changeset
  2258
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2259
!ApplicationModel methodsFor:'drag & drop'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2260
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2261
canDropObjects:aCollectionOfDropObjects
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2262
    "drop manager asked if a drop is possible
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2263
     - 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
  2264
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2265
    ^ false
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2266
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2267
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2268
canDropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2269
    "drop manager asked if a drop is possible
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2270
     - should be redefined by apps which can do it, to return true"
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2271
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2272
    ^ self canDropObjects:aCollectionOfDropObjects
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2273
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2274
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2275
canDropObjects:aCollectionOfDropObjects in:aComponent at:position
2405
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2276
    "drop manager asked if a drop is possible.
e1c1fc97daf8 comment
Stefan Vogel <sv@exept.de>
parents: 2396
diff changeset
  2277
     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
  2278
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2279
    ^ self canDropObjects:aCollectionOfDropObjects in:aComponent
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2280
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  2281
    "Created: / 13-10-2006 / 15:52:20 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2282
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2283
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2284
dropObjects:aCollectionOfDropObjects
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2285
    "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
  2286
     This is ony sent, if #canDrop: returned true.
2865
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2287
     Must be redefined in order for drop to work."
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2288
e6c70eef987c comment changed: #dropObjects:
Stefan Vogel <sv@exept.de>
parents: 2863
diff changeset
  2289
    ^ self subclassResponsibility
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2290
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2291
    "Created: / 13-10-2006 / 18:25:06 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2292
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  2293
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2294
dropObjects:aCollectionOfDropObjects in:aComponent
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2295
    "drop manager wants to drop.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2296
     This is ony sent, if #canDrop: returned true.
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2297
     Must be redefine in order for drop to work."
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2298
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2299
    ^ self dropObjects:aCollectionOfDropObjects
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2300
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2301
!
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2302
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2303
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2304
    "drop manager wants to drop.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2305
     This is ony sent, if #canDrop:in: returned true.
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2306
     Can be redefined in apps which return true to #canDrop."
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  2307
2557
Claus Gittinger <cg@exept.de>
parents: 2556
diff changeset
  2308
    ^ self dropObjects:aCollectionOfDropObjects in:aComponent
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2309
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  2310
    "Created: / 13-10-2006 / 18:25:13 / cg"
2824
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2311
!
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2312
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2313
droppedFile:aFilename in:aComponent
9a0756baf461 added: #droppedFile:in:
Claus Gittinger <cg@exept.de>
parents: 2801
diff changeset
  2314
    "ignored here - only sent by textView components, sometimes"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2315
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2316
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2317
!ApplicationModel methodsFor:'easy bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2318
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2319
registerInterestIn:aValueModel using:aSelectorOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2320
    "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
  2321
     aSelectorOrArray can be one of three things:
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2322
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2323
	    1) nil                  in which case no interest is registered
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2324
	    2) a selector           in which case the receiver is understood to be self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2325
	    3) an Array             in which case the size is two where the first element is the
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2326
				    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
  2327
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2328
    aSelectorOrArray isNil ifTrue:[^ aValueModel].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2329
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2330
    (aSelectorOrArray isArray) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2331
	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
  2332
    ] ifFalse: [
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2333
	aValueModel onChangeSend:aSelectorOrArray to:self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2334
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2335
    ^aValueModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2336
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2337
    "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
  2338
!
3764f680134d allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  2339
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2340
valueHolderFor:aSelector initialValue:anObject
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2341
    "Return a ValueHolder on anObject."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2342
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2343
    ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2344
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2345
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2346
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2347
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2348
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2349
    "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
  2350
     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
  2351
     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
  2352
     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
  2353
     the second element is the interested object. "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2354
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2355
    |holder|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2356
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2357
    (builder bindings includesKey:aSelector) ifFalse:[
3738
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2358
        holder := ValueHolder with:anObject.
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2359
        builder aspectAt:aSelector put:holder.
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2360
        aSelectorOrArrayOrNil notNil ifTrue:[
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2361
            ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2362
        ].
0374df3b40a6 #OTHER by mawalch
mawalch
parents: 3704
diff changeset
  2363
        ^ holder
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2364
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2365
    ^ builder aspectAt:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2366
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2367
    "Modified: / 21.5.1998 / 03:31:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2368
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2369
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2370
!ApplicationModel methodsFor:'forced actions'!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2371
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2372
doAcceptByReturnKey
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2373
    |acceptAction|
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2374
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2375
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2376
	acceptAction := builder bindingAt:#doAccept.
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2377
    ].
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2378
    acceptAction notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2379
	acceptAction value
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2380
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2381
	self doAccept
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  2382
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2383
!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2384
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2385
doCancelByEscapeKey
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2386
    |cancelAction|
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2387
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2388
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2389
	cancelAction := builder bindingAt:#doCancel.
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2390
    ].
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2391
    cancelAction notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2392
	cancelAction value
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2393
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2394
	self doCancel
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  2395
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2396
! !
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  2397
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2398
!ApplicationModel methodsFor:'help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2399
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2400
aboutImage
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2401
    "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
  2402
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2403
    ^ self class aboutImage
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2404
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2405
    "Modified: / 13.11.2001 / 12:32:44 / cg"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2406
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2407
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2408
aboutThisApplicationLabel
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2409
    "label for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2410
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2411
    ^ self class aboutThisApplicationLabel
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2412
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2413
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2414
aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2415
    "text for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2416
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  2417
    ^ self class aboutThisApplicationText
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2418
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2419
3240
d1f8004ad752 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  2420
activeHelpViewFor:text onDevice:aDevice
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2421
    "redefinable to allow for applications to provide their own active help
3239
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2422
     (aka tooltip) bubble window"
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2423
3240
d1f8004ad752 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3239
diff changeset
  2424
    ^ ActiveHelpView for:text onDevice:aDevice
3239
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2425
!
666c50f06f0b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3209
diff changeset
  2426
2520
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2427
flyByHelpDependsOnPositionIn:aView
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2428
    "subclasses where the help-text depends upon the pointer position might
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2429
     want to redefine this"
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2430
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2431
    ^ false
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2432
!
b4cb0d37c0d4 + flyByHelpDependsOnPositionIn:
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
  2433
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2434
openAboutThisApplication
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2435
    "opens an about box for this application.
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2436
     Can be specialized by redefining #aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2437
     and #aboutThisApplicationLabel"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  2438
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2439
    Dialog
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2440
	about:(self translateString:self aboutThisApplicationText)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2441
	label:(self translateString:self aboutThisApplicationLabel)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2442
	icon:self aboutImage
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2443
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  2444
    "Modified: / 17.11.2001 / 23:05:52 / cg"
1419
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2447
openHelpViewOnFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2448
    "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
  2449
     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
  2450
     (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
  2451
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2452
    self withWaitCursorDo:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2453
	HTMLDocumentView openFullOnHelpFile:pathToHelpText
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2454
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2455
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2456
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2457
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2458
showActiveHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2459
    "This is invoked from the activeHelp event listener, to display some popup-help
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2460
     for a component. If false is returned, the help manager will pop up
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2461
     some active help bubble; if true is returned, it will assume that the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2462
     help text has been already displayed and will not do any further actions.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2463
     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
  2464
     queue, so that the help text will be displayed asynchronously by myself,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2465
     vis the #showHelp:for: method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2466
     This can be redefined in concrete classes to handle active help differently."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2467
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2468
    |wg mySensor|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2469
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2470
    self showingHelp ifFalse: [
3764
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2471
        ^ true
1419
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2474
"/    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2475
"/        (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2476
"/            ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2477
"/        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2478
"/    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2479
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2480
    "/ NEW: push it into the event queue, to have it displayed
3955
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2481
    "/ synchronously with other events.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2482
    "/ (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
  2483
    "/  instead of occurring in the activeHelp context).
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
    (wg := self windowGroup) notNil ifTrue:[
3764
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2486
        mySensor := wg sensor.
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2487
        mySensor notNil ifTrue:[
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2488
            mySensor flushEventsFor:self withType:#showHelp:for:.
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2489
            mySensor
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2490
                pushUserEvent:#showHelp:for: for:self
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2491
                withArguments:(Array with:aHelpText with:view).
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2492
            ^ true
a76c6c4cd637 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2493
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2494
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2495
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2496
    "/ mhmh - can this happen ?
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2497
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2498
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2499
3955
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2500
    "Modified: / 21-08-1998 / 16:00:37 / cg"
23fc9de7f301 #DOCUMENTATION by mawalch
mawalch
parents: 3947
diff changeset
  2501
    "Modified (comment): / 22-05-2017 / 12:07:03 / mawalch"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2502
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2503
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2504
showHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2505
    "actual method which is supposed to display the help text.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2506
     Should be redefined in concrete classes, to put the help text
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2507
     into some info label, or the windows title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2508
     Here, the help text is ignored."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2509
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2510
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2511
	masterApplication showHelp:aHelpText for:view
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2512
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2513
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2514
    "Modified: / 31.7.1998 / 19:13:59 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2515
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2516
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2517
showingHelp
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2518
    "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
  2519
     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
  2520
     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
  2521
     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
  2522
     or into the view's title bar.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2523
     You may also redefine the showingHelp/showingHelp: methods, to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2524
     remember the flag setting."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2525
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2526
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2527
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2528
    "Modified: / 31.7.1998 / 17:55:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2529
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2530
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2531
!ApplicationModel methodsFor:'help texts'!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2532
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2533
basicFlyByHelpTextForKey:aKey
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  2534
    "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
  2535
     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
  2536
     Return the original (english) text as written in the helpSpec; 
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2537
     needs to be translated as per language"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2538
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2539
    |helpSpecFromBindings helpText helpSpec "resourceArgs"|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2540
3108
988608c69014 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3030
diff changeset
  2541
    helpSpecFromBindings := self aspectFor:#flyByHelpSpec.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2542
    helpSpecFromBindings notNil ifTrue:[
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2543
        helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
3108
988608c69014 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3030
diff changeset
  2544
    ] ifFalse:[
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2545
        helpSpecFromBindings := self aspectFor:#helpSpec.
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2546
        helpSpecFromBindings notNil ifTrue:[
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2547
            helpText := helpSpecFromBindings at:aKey ifAbsent:nil.
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2548
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2549
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2550
    helpText isNil ifTrue:[
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2551
        helpSpec := self flyByHelpSpec.
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2552
        helpSpec notNil ifTrue:[
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2553
            helpText := helpSpec at:aKey ifAbsent:nil.
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2554
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2555
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2556
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2557
    "/ new: allow for a collection (resource-key arg1 arg2...)
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2558
    helpText isNonByteCollection ifTrue:[
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2559
        helpText := helpText first.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2560
"/        resourceArgs := helpText copyFrom:2.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2561
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2562
    ^ helpText
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2563
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  2564
    "Modified: / 27-01-2012 / 14:30:20 / cg"
3785
ecbdc53f07da #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  2565
    "Modified (comment): / 17-11-2016 / 22:37:05 / cg"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2566
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2567
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2568
basicHelpTextForKey:aKey
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2569
    "activeHelp interface: return some help text for a key
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2570
     key is the symbol associated with some widget or menu item.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2571
     Return the original (english) text; needs to be translated as per language"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2572
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2573
    |helpText helpSpec "resourceArgs"|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2574
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2575
    helpSpec := self helpSpec.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2576
    helpSpec notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2577
	helpText := helpSpec at:aKey ifAbsent:nil.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2578
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2579
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2580
    "/ new: allow for a collection (resource-key arg1 arg2...)
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2581
    helpText isNonByteCollection ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2582
	helpText := helpText first.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2583
"/        resourceArgs := helpText copyFrom:2.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2584
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2585
    ^ helpText
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2586
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2587
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2588
flyByHelpSpec
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2589
    "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
  2590
3029
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  2591
    |specFromBuilder|
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  2592
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  2593
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2594
	(specFromBuilder := builder bindingAt:#flyByHelpSpec) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2595
	    ^ specFromBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2596
	].
3029
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  2597
2ca2cd205636 changed: #flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 3013
diff changeset
  2598
    ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2599
    ^ self class flyByHelpSpec
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2600
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2601
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2602
flyByHelpTextFor:aComponent
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2603
    "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
  2604
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2605
    |key|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2606
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2607
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2608
	(key := builder helpKeyFor:aComponent) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2609
	    ^ self flyByHelpTextForKey:key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2610
	]
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2611
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2612
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2613
	^ masterApplication flyByHelpTextFor:aComponent
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2614
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2615
    ^ nil
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2616
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2617
    "Modified: / 31.7.1998 / 23:03:10 / cg"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2618
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2619
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2620
flyByHelpTextForKey:aKey
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2621
    "flyByHelp interface: return some short help text for a key
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2622
     key is the symbol associated with some widget or menu item.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2623
     (from my flyByHelpSpec); return a language variant (if available)"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2624
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2625
    |helpText translatedHelpText translatedKey|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2626
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2627
    ActiveHelp debugging ifTrue:[ Transcript showCR:'help key: ', aKey].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2628
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2629
    helpText := self basicFlyByHelpTextForKey:aKey.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2630
    helpText isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2631
	masterApplication notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2632
	    "here we get an already translated helpText"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2633
	    helpText := masterApplication flyByHelpTextForKey:aKey.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2634
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2635
	helpText isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2636
	    "there is no help text - resolve key from resources"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2637
	    helpText := (self translateString:aKey) withCRs.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2638
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2639
	^ helpText.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2640
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2641
    "/ 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
  2642
    helpText isBlock ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2643
	^ helpText value.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2644
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2645
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2646
    "get the translation"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2647
    translatedHelpText := self translateString:helpText.
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  2648
    (helpText = aKey and:[ translatedHelpText = helpText ]) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2649
	"there is no translation in the resources - maybe there is one for the key?"
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2650
	translatedKey := self translateString:aKey.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2651
	translatedKey ~~ aKey ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2652
	     translatedHelpText := translatedKey.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2653
	].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2654
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2655
    ^ translatedHelpText withCRs.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2656
2983
8e31ab670ea3 comment/format in: #basicFlyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  2657
    "Modified: / 27-01-2012 / 14:33:54 / cg"
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2658
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2659
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2660
flyByHelpTextForKey:aKey row:aRowNr
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2661
    "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
  2662
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2663
    "Default: no row specific help"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2664
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2665
    ^ self flyByHelpTextForKey:aKey.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2666
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2667
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2668
helpSpec
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2669
    "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
  2670
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2671
    ^ self class helpSpec
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2672
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2673
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2674
helpTextFor:aComponent
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2675
    "activeHelp interface: return some help text for a widget component"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2676
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2677
    |key|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2678
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2679
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2680
	(key := builder helpKeyFor:aComponent) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2681
	    ^ self helpTextForKey:key
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2682
	]
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2683
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2684
    masterApplication notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2685
	^ masterApplication helpTextFor:aComponent
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2686
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2687
    ^ nil
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2688
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2689
    "Modified: / 31.7.1998 / 23:03:10 / cg"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2690
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2691
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2692
helpTextForKey:aKey
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2693
    "activeHelp interface: return some help text for a key
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2694
     key is the symbol associated with some widget or menu item.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2695
     (from my helpSpec); return a language variant (if available)"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2696
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2697
    |helpText translatedHelpText translatedKey|
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2698
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2699
    helpText := self basicHelpTextForKey:aKey.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2700
    helpText isNil ifTrue:[
3666
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2701
        masterApplication notNil ifTrue:[
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2702
            "here we get an already translated helpText"
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2703
            helpText := masterApplication helpTextForKey:aKey.
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2704
        ].
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2705
        helpText isNil ifTrue:[
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2706
            "there is no help text - resolve key from resources"
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2707
            helpText := (self translateString:aKey) withCRs.
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2708
        ].
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2709
        ^ helpText.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2710
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2711
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2712
    "/ kludge to allow for dynamic translation by the application itself.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2713
    helpText isBlock ifTrue:[
3666
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2714
        ^ helpText value.
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2715
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2716
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2717
    "get the translation"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2718
    translatedHelpText := self translateString:helpText.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2719
    translatedHelpText == helpText ifTrue:[
3666
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2720
        "there is no translation in the resources - maybe there is one for the key?"
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2721
        translatedKey := self translateString:aKey.
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2722
        translatedKey ~~ aKey ifTrue:[
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2723
             translatedHelpText := translatedKey.
e65ca937cdbd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
  2724
        ].
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2725
    ].
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2726
    ^ translatedHelpText withCRs.
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2727
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2728
    "Modified: / 22-12-2011 / 11:07:03 / cg"
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2729
! !
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  2730
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2731
!ApplicationModel methodsFor:'hooks'!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2732
2185
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2733
aboutToOpen:whichTopView
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2734
    "the topView is about to be opened.
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2735
     This is sent by whichTopView, right before its really open
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2736
     (i.e. finally visible)"
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2737
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2738
    self preOpenWith:builder
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2739
!
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  2740
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2741
commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2742
    "a common hook for postBuildWith: and postBuildAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2743
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2744
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2745
commonPostOpen
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2746
    "a common hook for postOpenWith:, postOpenAsSubcanvasWith: and postOpenAsDialogWith:.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2747
     Notice: redefined methods should do a super send.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2748
     otherwise resources might be undefined."
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2749
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2750
    <modifier: #super>
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2751
    
3860
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  2752
    resources isNil ifTrue:[
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  2753
        resources := self resources
8c5600174a7b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3852
diff changeset
  2754
    ].
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2755
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2756
    "Modified: / 07-02-2017 / 18:43:35 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2757
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2758
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2759
commonPreBuild
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2760
    "a common hook for preBuildWith:, preBuildAsSubcanvasWith: and preBuildAsDialogWith:."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2761
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2762
    "Modified (comment): / 07-07-2011 / 17:13:51 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2763
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2764
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2765
commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2766
    "A common hook for preOpenWith:, preOpenAsSubcanvasWith: and preOpenAsDialogWith:."
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2767
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2768
    "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
  2769
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2770
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2771
postApplicationProcessCreate:newProcess windowGroup:newGroup
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2772
    "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
  2773
     which forks its own windowGroup process. Allows for process group management,
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2774
     or process-global exception handlers to be installed.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2775
     Nothing done here - to be redefined in concrete applications"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2776
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2777
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2778
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2779
postBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2780
    "this is sent after an interface is built from a spec as subcanvas.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2781
     Can be redefined in subclasses for additional setup after
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2782
     the subcanvas' view has been built, but not yet opened."
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2783
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2784
    |sameApp|
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2785
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2786
    sameApp := aBuilder application == aBuilder window topView application.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2787
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2788
    "/ If I am opened as subcanvas in another application
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2789
    "/ then treat this like a regular open.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2790
    "/ otherwise ignore it.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2791
    sameApp ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2792
	self postBuildWith:aBuilder.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2793
    ] ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2794
	"/ I no not think, that this is a good default
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2795
	"/ self commonPostBuild.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2796
    ].
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2797
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2798
    "Modified (comment): / 07-07-2011 / 17:16:30 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2799
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2800
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2801
postBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2802
    "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
  2803
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2804
     Can be redefined in subclasses for additional setup after
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2805
     the dialog's view has been built, but not yet opened."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2806
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2807
    |sameApp|
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2808
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2809
    sameApp := (aBuilder application == aBuilder window topView application).
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2810
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2811
    "/ If I am opened as subcanvas in another application
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2812
    "/ then treat this like a regular open.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2813
    "/ otherwise ignore it.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2814
    sameApp ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2815
	self postBuildWith:aBuilder.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2816
    ] ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2817
	self commonPostBuild.
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2818
    ].
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2819
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2820
    "Modified: / 08-07-1998 / 18:28:55 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2821
    "Created: / 07-07-2011 / 17:20:29 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2822
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2823
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2824
postBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2825
    "this is sent after an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2826
     Can be redefined in subclasses for additional setup after
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2827
     the view has been built, but not yet opened."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2828
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2829
    <modifier: #super> "must be called if redefined"
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2830
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2831
    self commonPostBuild
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2832
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  2833
    "Modified: / 08-02-2017 / 00:22:38 / cg"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2834
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2835
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2836
postOpenAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2837
    "this is sent after the applications window is opened inside another application.
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2838
     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
  2839
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2840
    self commonPostOpen
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2841
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2842
    "Modified (comment): / 07-07-2011 / 17:16:46 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2843
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2844
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2845
postOpenDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2846
    "this is sent after the applications window is opened as a dialog with me
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2847
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2848
     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
  2849
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2850
    self commonPostOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2851
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2852
    "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
  2853
    "Modified: / 05-03-2014 / 18:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2854
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2855
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2856
postOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2857
    "this is sent after the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2858
     Can be redefined in subclasses for actions after opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2859
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2860
    self commonPostOpen
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2861
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2862
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2863
preBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2864
    "this is sent before an interface is built from a spec as a subcanvas.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2865
     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
  2866
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2867
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2868
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2869
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2870
preBuildDialogWith:aBuilder
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2871
    "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
  2872
     as a source (for aspects) i.e. via openDialogInterface:.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2873
     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
  2874
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2875
    "Created: / 07-07-2011 / 17:20:48 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2876
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  2877
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2878
preBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2879
    "this is sent before an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2880
     Can be redefined in subclasses.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2881
     mhmh - what should this do here ?"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2882
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2883
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2884
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2885
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2886
preOpenAsSubcanvasWith:aBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2887
    "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
  2888
     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
  2889
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2890
    self commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2891
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2892
    "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
  2893
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2894
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2895
preOpenDialogWith:aBuilder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2896
    "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
  2897
     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
  2898
     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
  2899
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2900
    self commonPreOpen
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2901
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2902
    "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
  2903
!
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2904
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2905
preOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2906
    "this is sent before the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2907
     Can be redefined in subclasses for actions right before opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2908
! !
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  2909
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2910
!ApplicationModel methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2911
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2912
addTopViewsToCurrentProject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2913
    "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
  2914
     This allows hiding views on a per-project basis.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2915
     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
  2916
     (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
  2917
1972
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2918
    |wg|
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2919
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  2920
    (wg := self windowGroup) notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2921
	(wg topViews ? #()) do:[:aView |
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2922
	    aView addToCurrentProject
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2923
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2924
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2925
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2926
    "Modified: 17.1.1997 / 19:43:39 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2927
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2928
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2929
basicInitialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2930
    "initialize the application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2931
     Since ST-80 applications seem commonly to redefine #initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2932
     without doing a super initialize, the real initialization is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2933
     done here ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2934
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2935
    self initializeDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2936
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2937
    "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
  2938
     builder till later, to allow setting to another builder.
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2939
     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
  2940
     creation, which might lead to trouble.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2941
     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
  2942
     late.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2943
     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
  2944
    "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2945
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2946
"/    builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2947
"/    builder notNil ifTrue:[builder application:self].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2948
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2949
    self initializeResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2950
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2951
    "Modified: / 13-09-2006 / 12:39:30 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2952
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2953
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2954
initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2955
    "nothing done here;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2956
     but can be redefined in concrete applications"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2957
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2958
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2959
initializeDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2960
    self isWebService ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2961
	self initializeWebServiceDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2962
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  2963
	self initializeScreenDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2964
    ].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2965
!
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2966
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2967
initializeResources
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2968
    "initialize the applications resources (NLS support)."
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2969
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2970
    resources := self class classResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2971
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2972
    "Created: / 13-09-2006 / 12:39:22 / cg"
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2973
!
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2974
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2975
initializeScreenDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2976
    Screen notNil ifTrue:[
3523
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  2977
        device := Screen current.
3524
375cfd9a940c #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2978
        (device notNil and:[device isOpen not]) ifTrue:[
375cfd9a940c #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2979
            (self class name,' [warning]: screen device is not open') errorPrintCR
3523
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  2980
        ].    
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2981
    ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2982
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2983
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2984
setDevice:aDevice
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  2985
    "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
  2986
     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
  2987
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2988
    device := aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2989
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2990
    "Created: 5.7.1996 / 12:01:40 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2991
    "Modified: 17.1.1997 / 19:44:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2992
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2993
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2994
!ApplicationModel methodsFor:'opening'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2995
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  2996
hideWindows
3943
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  2997
    |wg|
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  2998
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  2999
    wg := self windowGroup.
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3000
    wg notNil ifTrue:[
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3001
        wg hideTopViews.
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3002
    ].
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3003
0051277ccb4a #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3938
diff changeset
  3004
    "Modified: / 17-03-2017 / 17:22:31 / stefan"
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3005
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3006
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3007
open
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3008
    "open a standard interface.
3851
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  3009
     Sorry, but for visualworks compatibility, the builder is returned,
97062791c237 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3842
diff changeset
  3010
     not the receiver."
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3011
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3012
    ^ self openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3013
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3014
    "Modified: / 03-05-1996 / 13:39:15 / cg"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3015
    "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
  3016
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3017
1592
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3018
openAndWaitUntilVisible
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3019
    "open a standard interface, and wait until my window is visible"
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3020
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3021
    self open.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3022
    self window waitUntilVisible.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3023
!
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  3024
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3025
openAs:windowType
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3026
    "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
  3027
     Sorry, but for visualworks compatibility, the builder is returned"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3028
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3029
    ^ self openInterfaceAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3030
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3031
    "Modified: / 04-03-2011 / 15:03:19 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3032
    "Modified (comment): / 27-12-2011 / 10:42:28 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3033
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3034
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3035
openAsSlave
1726
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  3036
    "open a standard interface as slave.
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  3037
     Notice: there is still a need to make the current window a master
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3038
	(see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3039
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3040
    ^ self openAs:#slave
1724
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3041
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3042
    "
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3043
     WorkspaceApplication new openAsSlave.
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  3044
    "
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3045
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3046
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3047
openAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3048
    "open a standard interface at some point"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3049
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3050
    ^ self openInterfaceAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3051
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3052
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3053
    "Created: 14.2.1997 / 20:17:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3054
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3055
3181
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3056
openAtPointer
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3057
    "open a standard interface at the current pointer position.
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3058
     Sorry, but for visualworks compatibility, the builder is returned"
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3059
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3060
    ^ self openInterfaceAt:(device pointerPosition)
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3061
!
4befd1e4e8d0 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
  3062
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3063
openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3064
    "open a standard interface.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3065
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3066
     Subclasses which do not have an interfaceSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3067
     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
  3068
     (see Launcher as an example).
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3069
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3070
     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
  3071
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3072
    ^ self openInterface:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3073
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3074
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3075
    "Modified: / 23-01-1998 / 18:16:50 / cg"
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3076
    "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
  3077
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3078
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3079
openInterface:aSymbol
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3080
    "open a specific interface.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3081
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3082
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3083
     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
  3084
     which must return an interfaceSpec.
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3085
     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
  3086
     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
  3087
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3088
     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
  3089
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3090
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3091
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3092
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3093
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3094
    "Modified: / 03-03-2011 / 18:57:04 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3095
    "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
  3096
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3097
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3098
openInterface:aSymbol as:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3099
    "open a specific interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3100
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3101
     The argument, aSymbol specifies which interface.
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3102
     The concrete application subclass must provide a method with that name,
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3103
     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
  3104
     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
  3105
     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
  3106
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3107
     Sorry, but for visualworks compatibility, the builder is returned"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3108
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3109
    self allButOpenInterface:aSymbol.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3110
    self openWindowAs:windowType.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3111
    ^ builder
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3112
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3113
    "Modified: / 03-03-2011 / 18:56:23 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3114
    "Modified (comment): / 27-12-2011 / 10:42:37 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3115
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3116
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3117
openInterface:aSymbol at:aLocation
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3118
    "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
  3119
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3120
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3121
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3122
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3123
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3124
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3125
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3126
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3127
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3128
    self openWindowAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3129
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3130
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3131
    "Created: / 14-02-1997 / 20:19:44 / cg"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3132
    "Modified: / 03-03-2011 / 18:55:26 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3133
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3134
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3135
openInterfaceAs:windowType
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3136
    "open a standard interface in a special mode.
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3137
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3138
     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
  3139
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3140
    ^ self openInterface:(self defaultWindowSpecName) as:windowType
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3141
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3142
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
2898
30406aa580fc comments
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  3143
    "Modified: / 04-03-2011 / 15:03:28 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3144
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3145
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3146
openInterfaceAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3147
    "open a standard interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3148
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3149
    ^ self openInterface:(self defaultWindowSpecName) at:aLocation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3150
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3151
    "Created: / 14.2.1997 / 20:18:20 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3152
    "Modified: / 23.1.1998 / 18:17:13 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3153
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3154
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3155
openInterfaceModal
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3156
    "open a standard interface as a modal dialog.
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3157
     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
  3158
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3159
    ^ self openInterfaceModal:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3160
2895
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3161
    "Modified: / 09-09-1996 / 22:39:23 / stefan"
b7abc3d3321f comment/format in:5 methods
Claus Gittinger <cg@exept.de>
parents: 2893
diff changeset
  3162
    "Modified: / 03-03-2011 / 18:54:48 / cg"
2980
b2a90134c2cd comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 2977
diff changeset
  3163
    "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
  3164
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3165
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3166
openInterfaceModal:aSymbol
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3167
    "open a specific interface as a modal dialog.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3168
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3169
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3170
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3171
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3172
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3173
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3174
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3175
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3176
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3177
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3178
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3179
    "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
  3180
!
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  3181
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3182
openInterfaceModal:aSymbol at:location
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3183
    "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
  3184
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3185
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3186
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3187
     the builder to create the views.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3188
     Typically, applications only use one interface,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3189
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3190
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3191
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3192
    self openWindowModalAt:location.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3193
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3194
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3195
    "Modified: 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3196
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3197
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3198
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3199
    "open a standard interface as a modal dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3200
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3201
    ^ self openInterfaceModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3202
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3203
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3204
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3205
3618
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3206
openModalAtPointer
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3207
    "open a standard interface modal at the current pointer position.
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3208
     Sorry, but for visualworks compatibility, the builder is returned"
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3209
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3210
    ^ self openInterfaceModal:(self defaultWindowSpecName) at:(device pointerPosition)
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3211
!
97bc95ba47d3 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3546
diff changeset
  3212
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3213
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3214
    "open a standard interface on some other device"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3215
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3216
    self setDevice:aDevice.
3365
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3217
    Screen currentScreenQuerySignal 
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3218
        answer:aDevice
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3219
        do:[
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3220
            ^ self open
49cb7d13746c class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3335
diff changeset
  3221
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3222
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3223
    "Created: 13.1.1997 / 21:24:11 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3224
    "Modified: 13.1.1997 / 21:24:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3225
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3226
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3227
openSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3228
    "open a view as specified in anInterfaceSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3229
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3230
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3231
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3232
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3233
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3234
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3235
    "Created: / 20.5.1998 / 20:08:51 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3236
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3237
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3238
openSpec:anInterfaceSpec withBindings:bindings
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3239
    "open a view as specified in anInterfaceSpec."
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3240
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3241
    self openSpec:anInterfaceSpec withBindings:bindings modal:false
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3242
!
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3243
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3244
openSpec:anInterfaceSpec withBindings:bindings modal:modal
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3245
    "open a view as specified in anInterfaceSpec."
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3246
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3247
    self createBuilder.
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3248
    builder bindings:bindings.
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3249
    self allButOpenFrom:anInterfaceSpec.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3250
    modal ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3251
	self openWindowModal.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3252
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3253
	self openWindow.
2624
739a72458353 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2615
diff changeset
  3254
    ]
2393
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3255
!
14e0b6215b42 +openSpec:withBindings:
Claus Gittinger <cg@exept.de>
parents: 2387
diff changeset
  3256
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3257
openSpecModal:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3258
    "open an interface spec modal"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3259
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3260
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3261
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3262
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3263
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3264
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3265
    "Created: / 20.5.1998 / 20:20:21 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3266
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3267
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3268
openWindow
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3269
    "open the window
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3270
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3271
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3272
    builder "openWindow."
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3273
	openAt:nil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3274
	withExtent:(self defaultWindowExtent)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3275
	andType:(self defaultWindowType)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3276
2270
a7c797806d46 correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  3277
    "Created: / 14-02-1997 / 20:20:39 / cg"
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3278
    "Modified: / 11-07-2011 / 22:30:27 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3279
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3280
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3281
openWindowAs:windowType
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3282
    "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
  3283
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3284
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3285
    builder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3286
	openAt:nil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3287
	withExtent:(self defaultWindowExtent)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3288
	andType:windowType
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3289
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3290
    "Modified: / 11-07-2011 / 22:30:35 / cg"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3291
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  3292
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3293
openWindowAs:windowType at:originOrNil
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3294
    "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
  3295
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3296
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3297
    builder
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3298
	openAt:originOrNil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3299
	withExtent:(self defaultWindowExtent)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3300
	andType:windowType
2931
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3301
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3302
    "Modified: / 11-07-2011 / 22:30:35 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3303
    "Created: / 25-07-2011 / 16:00:24 / cg"
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3304
!
0163ade8b5d8 added: #openWindowAs:at:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  3305
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3306
openWindowAt:aPoint
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3307
    "open the window
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3308
     - assumes that the builder has already setup the interface."
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
    builder "openWindowAt:aLocation."
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3311
	openAt:aPoint
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3312
	withExtent:(self defaultWindowExtent)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3313
	andType:(self defaultWindowType)
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3314
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3315
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3316
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3317
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3318
openWindowAtCenter
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3319
    "open the window centered on the screen
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3320
     - assumes that the builder has already setup the interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3321
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3322
    builder openWindowAt:#center
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3323
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3324
    "Created: 14.2.1997 / 20:20:55 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3325
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3326
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3327
openWindowModal
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3328
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3329
     - 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
  3330
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3331
"/    builder openDialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3332
    builder
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3333
	openAt:nil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3334
	withExtent:(self defaultWindowExtent)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3335
	andType:#dialog
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3336
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3337
    "Created: / 14-02-1997 / 20:20:39 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3338
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3339
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3340
openWindowModalAt:aLocation
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3341
    "open the window as a modal dialog
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3342
     - 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
  3343
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3344
    builder openDialogAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3345
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3346
    "Created: / 14-02-1997 / 20:20:55 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3347
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3348
1478
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3349
openWithExtent:extPoint
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3350
    "open a standard interface with given extent"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3351
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3352
    |bldr|
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3353
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3354
    bldr := self allButOpen.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3355
    bldr openWithExtent:extPoint.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3356
    ^ bldr
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3357
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3358
    "Modified: 3.5.1996 / 13:39:15 / cg"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3359
!
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  3360
1968
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3361
opened:whichTopView
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3362
    "the topView has been opened.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3363
     This is sent by whichTopView, when its really open
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3364
     (i.e. finally visible)"
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3365
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3366
    self addTopViewsToCurrentProject.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  3367
    self postOpenWith:builder
3750
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3368
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3369
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3370
showWindows
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3371
    self window map;activate.
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3372
!
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3373
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3374
unhideWindows
73f907f202bc #UI_ENHANCEMENT by mawalch
mawalch
parents: 3738
diff changeset
  3375
    self windowGroup unhideTopViews
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3376
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3377
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3378
!ApplicationModel methodsFor:'opening-dialogs'!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3379
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3380
openDialog
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3381
    "open my window as a modal dialog
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3382
     - assumes that the builder has already setup the interface."
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3383
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3384
    self window beToolDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3385
    ^ builder openDialog.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3386
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3387
    "Modified: / 14-02-1997 / 20:32:52 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3388
    "Modified (comment): / 07-07-2011 / 17:25:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3389
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3390
3540
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3391
openDialogAt:aPoint
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3392
    "open my window as a modal dialog
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3393
     - assumes that the builder has already setup the interface."
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3394
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3395
    self window beToolDialog.
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3396
    ^ builder openDialogAt:aPoint.
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3397
!
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3398
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3399
openDialogAtPointer
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3400
    "open my window as a modal dialog
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3401
     - assumes that the builder has already setup the interface."
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3402
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3403
    ^ self openDialogAt:(device pointerPosition).
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3404
!
155ab23de4e5 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3527
diff changeset
  3405
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3406
openDialogInterface:aSelector
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3407
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3408
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3409
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3410
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3411
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3412
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3413
    ^ self openDialogInterface:aSelector withBindings:nil
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3414
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3415
    "Modified: / 28-02-1997 / 14:08:01 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3416
    "Modified (comment): / 07-07-2011 / 17:25:26 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3417
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3418
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3419
openDialogInterface:aSelector withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3420
    "open a dialog, given a spec-selector"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3421
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3422
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3423
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3424
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3425
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3426
    ^ SimpleDialog new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3427
	openFor:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3428
	interface:aSelector
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3429
	withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3430
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3431
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3432
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3433
    "Modified (comment): / 07-07-2011 / 17:25:23 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3434
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3435
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3436
openDialogInterfaceSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3437
    "open a dialog, given a spec"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3438
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3439
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3440
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3441
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3442
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3443
    ^ SimpleDialog new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3444
	openFor:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3445
	interfaceSpec:aSpec
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3446
	withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3447
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3448
    "Created: / 28-02-1997 / 14:07:45 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3449
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3450
    "Modified (comment): / 07-07-2011 / 17:25:20 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3451
!
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3452
3496
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3453
openDialogModeless
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3454
    "open my window as a modal dialog
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3455
     - assumes that the builder has already setup the interface."
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3456
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3457
    self window beToolDialog.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3458
    ^ builder open.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3459
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3460
    "Modified: / 14-02-1997 / 20:32:52 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3461
    "Modified (comment): / 07-07-2011 / 17:25:45 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3462
!
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3463
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3464
openDialogSpec:aSpec withBindings:bindings
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3465
    "open a dialog"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3466
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3467
    "/ Notice: the opened dialog will be technically another instance
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3468
    "/ (of SimpleDialog) but use me as aspect provider.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3469
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3470
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3471
    ^ SimpleDialog new
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3472
	openFor:self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3473
	spec:aSpec
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3474
	withBindings:bindings
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3475
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3476
    "Modified: / 23-01-1998 / 18:18:14 / cg"
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3477
    "Created: / 20-05-1998 / 20:27:56 / cg"
3496
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3478
!
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3479
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3480
openDialogSpecModeless:aSpec withBindings:bindings
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3481
    "open a dialog, but without blocking the caller"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3482
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3483
    "/ Notice: the opened dialog will be technically another instance
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3484
    "/ (of SimpleDialog) but use me as aspect provider.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3485
    "/ It will call postOpenDialog: and postBuildDialog: as callbacks.
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3486
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3487
    ^ SimpleDialog new
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3488
        openModelessFor:self
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3489
        spec:aSpec
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3490
        withBindings:bindings
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3491
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3492
    "Modified: / 23-01-1998 / 18:18:14 / cg"
76829f8a4156 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3484
diff changeset
  3493
    "Created: / 20-05-1998 / 20:27:56 / cg"
2921
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3494
! !
8ba6636c45e4 added postBuildDialog hooks
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  3495
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3496
!ApplicationModel methodsFor:'opening-webInterface'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3497
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3498
addToService
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3499
    self service
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3500
	addPage:(builder page)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3501
	link:(self webLink)
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3502
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3503
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3504
createWebBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3505
    "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
  3506
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3507
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3508
	builder := self webBuilderClass new.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3509
	builder application:self.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3510
    ]
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3511
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3512
    "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
  3513
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3514
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3515
defaultPageSpecName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3516
    ^ #pageSpec
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3517
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3518
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3519
defineInterface
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3520
    "define a standard interface.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3521
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3522
     Subclasses which do not have an interfaceSpec
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3523
     should redefine this method and create their page there."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3524
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3525
    ^ self defineInterface:(self defaultPageSpecName)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3526
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3527
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3528
defineInterface:aSpecSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3529
    "define an interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3530
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3531
    ^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3532
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3533
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3534
defineInterfaceFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3535
    "define an interface (setup a page), given a spec."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3536
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3537
    |page|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3538
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3539
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3540
	self createWebBuilder.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3541
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3542
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3543
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3544
    builder buildPageFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3545
    page := builder page.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3546
    page application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3547
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3548
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3549
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3550
    "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
  3551
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3552
2554
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3553
httpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3554
    "on which port will a HTTP server be started"
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3555
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3556
    ^ self class defaultHttpServerPort
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3557
!
d76514961c2f Rename #port -> #httpServerPort
Stefan Vogel <sv@exept.de>
parents: 2549
diff changeset
  3558
2547
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3559
initializeAsWebServiceOnWebDevice:webDevice
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3560
    self setDevice:(WebApplicationDevice new).
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3561
    self initialize.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3562
    self initializeWebServiceDevice.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3563
    self initializeResources.
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3564
!
b0896e2b4a9c changed #initializeAsWebServiceOnWebDevice:
Claus Gittinger <cg@exept.de>
parents: 2545
diff changeset
  3565
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3566
initializeWebServiceDevice
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3567
    "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
  3568
     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
  3569
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3570
    |server|
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3571
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3572
    self service isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3573
	server := HTTPServer serverOnPort:(self httpServerPort).
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3574
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3575
	self service:(server
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3576
		    serviceForLink:(self serviceLinkName)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3577
		    ifAbsent:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3578
			|service|
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3579
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3580
			service := HTTPPortalService new.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3581
			service linkName:(self serviceLinkName).
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3582
			service class unRegisterServiceOn:server.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3583
			service registerServiceOn:server.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3584
			service
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3585
		    ]).
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3586
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3587
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3588
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3589
pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3590
    ^ self class pageSpecs
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3591
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3592
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3593
service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3594
    device isNil ifTrue:[^ nil].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3595
    self assert:(device isWebServiceDevice).
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3596
    ^ device service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3597
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3598
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3599
service:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3600
    self device service:something.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3601
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3602
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3603
serviceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3604
    ^ self class defaultServiceLinkName
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3605
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3606
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3607
startAsWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3608
    device isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3609
	self initializeDevice.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3610
    ].
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3611
    self startInPortalService:self service
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3612
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3613
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3614
     self new startInWebService
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3615
    "
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3616
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3617
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3618
startInPortalService:aPortalServiceOrSession
2632
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  3619
    aPortalServiceOrSession application:self.
ced2473521b1 changed #startInPortalService:
Claus Gittinger <cg@exept.de>
parents: 2631
diff changeset
  3620
    self service:aPortalServiceOrSession.
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3621
    self defineInterface.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3622
    self addToService.
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3623
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3624
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3625
webBuilderClass
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3626
    "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
  3627
     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
  3628
     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
  3629
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3630
    ^ WebPageBuilder
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3631
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3632
    "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
  3633
    "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
  3634
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3635
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3636
webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3637
    "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
  3638
     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
  3639
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3640
    ^ self device webLink
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3641
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3642
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3643
webLink:something
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3644
    self device webLink:something
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3645
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3646
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3647
!ApplicationModel methodsFor:'private'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3648
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3649
builderClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3650
    "return the UIBuilder class for me.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3651
     This method can be redefined if (eventually) there are
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3652
     spec readers for other UI languages (motif UIL ?)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3653
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3654
    self isWebService ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3655
	^ self webBuilderClass
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3656
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3657
    ^ UIBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3658
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3659
    "Created: / 19.6.1998 / 01:39:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3660
    "Modified: / 19.6.1998 / 01:45:24 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3663
createBuilder
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3664
    "create a WindowBuilder if not already present"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3665
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3666
    builder isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3667
	builder := self builderClass new.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3668
	builder application:self.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3669
    ]
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
    "Created: / 19.6.1998 / 03:32:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3672
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3673
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3674
!ApplicationModel methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3675
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3676
defaultWindowExtent
3947
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  3677
    "returns my default winoow extent.
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  3678
     The code here asks for the last extent of an instance of this class"
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  3679
     
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  3680
    ^ self class defaultExtentFor:self class
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3681
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3682
    "Created: / 11-07-2011 / 22:30:12 / cg"
3947
e620986b4e2a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3943
diff changeset
  3683
    "Modified (comment): / 09-04-2017 / 22:30:52 / cg"
2923
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3684
!
f8b4ed9ccc80 added: #defaultWindowExtent
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  3685
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3686
defaultWindowSpecName
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3687
    ^ #windowSpec
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3688
!
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  3689
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3690
defaultWindowType
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3691
    "Applications come up non-modal, by default"
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
    ^ #normal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3694
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3695
    "Created: 17.1.1997 / 19:57:34 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3698
graphicsDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3699
    "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
  3700
     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
  3701
     active screen."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3702
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3703
    ^ device
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3704
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3705
    "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
  3706
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3707
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3708
interfaceSpecFor:aSelectorOrSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3709
    "return an interface spec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3710
     Here, the query is forwarded to my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3711
     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
  3712
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3713
    aSelectorOrSpec isSymbol ifFalse:[
3677
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3714
        (aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3715
    ].
3677
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3716
    UnhandledAttributeInLiteralArrayErrorSignal handle:[:ex |
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3717
        "/ that is to support debugging - to easily find the bad spec
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3718
        Transcript showCR:'%1 [warning]: Error in spec (%2):' withCRs 
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3719
                                with:self class name 
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3720
                                with:aSelectorOrSpec.
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3721
        Transcript showCR:ex description. 
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3722
        ex proceed.
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3723
    ] do:[    
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3724
        ^ self class interfaceSpecFor:aSelectorOrSpec
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3725
    ].
1fd6bb99c343 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 3670
diff changeset
  3726
    
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3727
    "Created: / 25-01-1998 / 19:45:12 / cg"
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  3728
    "Modified: / 14-01-2008 / 17:54:29 / cg"
1419
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
1481
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3731
isOpen
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3732
   "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
  3733
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3734
   |win|
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3735
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3736
   ^ (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
  3737
!
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  3738
3484
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3739
isShown
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3740
   "answer true if the application's window is shown"
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3741
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3742
   |win|
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3743
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3744
   ^ (win := self window) notNil and:[win shown]
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3745
!
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  3746
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3747
isWebService
2545
d32d7c7cc96a changed #isWebService
Claus Gittinger <cg@exept.de>
parents: 2544
diff changeset
  3748
    ^ device notNil and:[ device askFor:#isWebServiceDevice ]
2541
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3749
!
08d27acc9fe1 merged in WebAppModel code - to allow for an application
Claus Gittinger <cg@exept.de>
parents: 2528
diff changeset
  3750
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3751
processName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3752
    "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
  3753
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3754
    self class == ApplicationModel ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3755
	^ 'Application'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3756
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3757
    ^ self class nameWithoutPrefix
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3758
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3759
    "Modified: / 4.12.1997 / 12:39:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3760
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3761
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3762
resolveClassNamed:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3763
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3764
     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
  3765
     current namespace and finally in Smalltalk
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3766
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3767
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3768
    ^ Smalltalk resolveName:something inClass:aClass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3769
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3770
3304
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  3771
resolveFont:something
3308
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  3772
    "resolve the font. Delegate to windowBuilder"
77d90ac8ef37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3307
diff changeset
  3773
3304
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  3774
    ^ builder resolveFont:something
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  3775
!
d215db7f356d class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3297
diff changeset
  3776
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3777
resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3778
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  3779
     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
  3780
     current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3781
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3782
    ^ self resolveName:something inClass:self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3783
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3784
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3785
resolveName:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3786
    "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
  3787
     first we are looking in the namespace of the application,
2099
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3788
     then in the current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  3789
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3790
    |cls|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3791
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3792
    aClass notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3793
	(cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3794
	    ^ cls
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3795
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3796
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3797
	masterApplication notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3798
	    ^ masterApplication resolveName:something
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3799
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3800
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3801
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3802
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3803
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3804
selfResponsibleFor:aKey
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3805
    "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
  3806
2586
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3807
    <resource: #obsolete>
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3808
023716eba50a code cleanup: responsibleFor
Claus Gittinger <cg@exept.de>
parents: 2581
diff changeset
  3809
    self obsoleteMethodWarning:'obsoleted for de-obfuscation'.
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3810
    ^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]])
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3811
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  3812
3192
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3813
shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3814
    "to be redefined by concrete applications:
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3815
     if true is answered, the application's extent is remembered on close
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3816
     and used as a default when opened the next time"
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3817
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3818
    ^ self class shouldRememberLastExtent
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3819
!
cfb6ff5f6b39 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3181
diff changeset
  3820
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3821
topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3822
    "return the top-master application"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3823
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3824
    masterApplication isNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3825
	^ self
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
    ^ masterApplication topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3828
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3829
    "Created: / 6.6.1998 / 19:40:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3830
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3831
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1750
diff changeset
  3832
!ApplicationModel methodsFor:'startup & release'!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3833
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3834
applicationWindowClass
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3835
    "return the class used for my (top-) windows"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  3836
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3837
    ^ ApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3838
!
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
close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3841
    "this is sent by my topView when about to be closed
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3842
     by the program (not by the windowManager).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3843
     Notice, that we get a closeRequest message if closed by the windowManager,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3844
     which can be rejected by the app (or confirmed via a dialog)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3845
     Could be redefined in subclasses."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3846
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3847
    self closeDownViews
1132
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3848
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  3849
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3850
closeDownViews
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  3851
    "close down the application's view(s)"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3852
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3853
    <modifier: #super> "must be called if redefined"
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3854
2893
c003538ed1f1 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2890
diff changeset
  3855
    |wg wgProcess window|
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3856
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3857
    self release.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3858
    ActiveHelp stopFor:self.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3859
3193
84e87100e57b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3192
diff changeset
  3860
    self shouldRememberLastExtent ifTrue:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3861
        self rememberLastExtent.
3193
84e87100e57b class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3192
diff changeset
  3862
    ].
3938
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3863
    wg := self windowGroup.
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3864
    (wg notNil and:[wg isModal not]) ifTrue:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3865
        wgProcess := wg process.
3938
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3866
        (wgProcess notNil and:[Processor activeProcess ~~ wgProcess]) ifTrue:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3867
            wgProcess terminate
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3868
        ] ifFalse:[
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3869
            wg closeDownViews.
3938
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3870
        ].
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3871
        ^ self.
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3872
    ].
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3873
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3874
    window := self window.
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3875
    window notNil ifTrue:[
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3876
        window destroy.
2890
e7ac796279d7 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  3877
    ].
e7ac796279d7 changed: #closeDownViews
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  3878
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3879
    "Modified: / 08-02-2017 / 00:24:14 / cg"
3938
0fcfd5e383f1 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 3936
diff changeset
  3880
    "Modified: / 03-03-2017 / 12:00:22 / stefan"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3881
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3882
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3883
closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3884
    "this is sent by my topView when about to be closed by the windowManager.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3885
     Could be redefined in subclasses to suppress close or confirm."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3886
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3887
    <modifier: #super> "must be called if redefined"
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3888
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3889
    |sav window|
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3890
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3891
    window := self window.
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3892
    window isNil ifTrue:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3893
        'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3894
        ^ self
1461
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3895
    ].
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  3896
1831
766f0b3cd453 not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  3897
    window isTopView ifFalse:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3898
        window topView isModal ifTrue:[
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3899
            WindowGroup leaveSignal raise.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3900
        ].
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3901
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3902
        'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3903
        ^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3904
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3905
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3906
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3907
    "/ (but not if I am a modal reincarnation)
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3908
    (masterApplication notNil
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  3909
    and:[window isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3910
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3911
        "/ temporary clear my masterApplication to prevent
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3912
        "/ endless recursion, in case the master sends me
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3913
        "/ a closeRequest (although, it is supposed to
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3914
        "/ send me a closeDownViews ...)
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3915
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3916
        sav := masterApplication.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3917
        masterApplication := nil.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3918
        sav closeRequestFor:window.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3919
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3920
        "/ restore - in case master did not want me to close ...
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3921
        masterApplication := sav.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3922
    ] ifFalse:[
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3923
        "/ ST/X does close-check by redefining this message without
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3924
        "/ a supersend;
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3925
        "/ VW does it by returning false from requestForWindowClose
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3926
        "/ sigh.
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3927
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3928
        self requestForWindowClose ifTrue:[
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3929
            window isSlave ifTrue:[
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3930
                window destroy
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3931
            ] ifFalse:[
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3932
                self closeDownViews
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3933
            ]
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3934
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3935
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3936
3864
37f4e48a35e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
  3937
    "Modified: / 08-02-2017 / 00:25:11 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3938
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3939
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3940
closeRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3941
    "this is sent by any of my topViews when about to be closed by the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3942
     windowmanager. For backward compatibility with single-view applications,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3943
     this is forwarded here to a simple (non topView-specific) closeRequest,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3944
     effectively closing all of my views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3945
     MultiView applications should redefine this method if closing of individual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3946
     views closing is to be caught and/or should not close all of them."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3947
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3948
    |savedMaster myWindow|
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3949
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3950
    myWindow := self window.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3951
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3952
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3953
    "/ (but not if I am a modal reincarnation)
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3954
    (masterApplication notNil
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  3955
    and:[myWindow topView isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3956
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3957
	"/ temporary clear my masterApplication to prevent
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3958
	"/ endless recursion, in case the master sends me
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3959
	"/ a closeRequest (although, it is supposed to
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3960
	"/ send me a closeDownViews ...)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3961
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3962
	savedMaster := masterApplication.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3963
	masterApplication := nil.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3964
	aTopView isSlave ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3965
	    savedMaster closeRequestFor:aTopView.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3966
	] ifFalse:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3967
	    savedMaster closeRequestFor:myWindow.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3968
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3969
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3970
	"/ restore - in case master did not want me to close ...
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3971
	masterApplication := savedMaster.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3972
	^ self
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3973
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3974
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3975
    (aTopView == myWindow) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3976
	self closeRequest.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3977
	^ self
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3978
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3979
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3980
    (aTopView isPartner or:[aTopView isMaster]) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3981
	aTopView application closeRequest.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3982
	self closeRequest.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3983
	^ self.
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3984
    ].
1924
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3985
    aTopView isSlave ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3986
	aTopView closeRequest
1924
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3987
    ] ifFalse:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  3988
	aTopView application closeRequest.
1924
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  3989
    ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3990
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3991
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3992
doAccept
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3993
    "this is invoked by the Return-Key (if returnIsOK) or
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3994
     the ok-button (if any), IFF the application has been
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3995
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3996
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3997
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3998
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3999
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4000
    "/ However, it may be useful, to open some app (which is normally
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4001
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4002
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4003
    "/ to remember the accept vs. cancel case.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4004
    "/
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4005
    self window isModal ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4006
	masterApplication notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4007
	    masterApplication window topView == self window topView ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4008
		masterApplication window isModal ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4009
		    masterApplication doAccept.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4010
		    ^ self.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4011
		].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4012
	    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4013
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4014
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4015
	"/ mhmh - is this a good idea ?
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4016
	self perform:#accept ifNotUnderstood:[self closeRequest].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4017
	^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4018
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4019
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4020
    ^ self      "/ nothing done here ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4021
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4022
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4023
doCancel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4024
    "this is invoked by the Escape-Key (if escapeIsCancel) or
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4025
     the cancel-button (if any), IFF the application has been
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4026
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4027
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4028
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4029
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4030
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4031
    "/ However, it may be useful, to open some app (which is normally
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4032
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4033
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4034
    "/ to remember the accept vs. cancel case.
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
  4035
    "/
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4036
    self window isModal ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4037
	"/ mhmh - is this a good idea ?
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4038
	self perform:#cancel ifNotUnderstood:[self closeRequest].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4039
	^ self
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4040
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4041
    ^ self      "/ nothing done here ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4042
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4043
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4044
releaseAsSubCanvas
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4045
    "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
  4046
     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
  4047
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4048
    "/ used to self release here,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4049
    "/ but that is incompatible to VW (RefactoryBrowser).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4050
    "/ Therefore, if you need it, you MUST now redefine
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4051
    "/ this method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4052
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4053
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4054
rememberLastExtent
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4055
    "remember my current extent for the next open"
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4056
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4057
    |window|
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4058
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4059
    window := self window.
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4060
    (window notNil and:[window isTopView]) ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4061
	DefaultExtents isNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4062
	    DefaultExtents := Dictionary new.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4063
	].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4064
	DefaultExtents at:self class name put:(window extent).
3203
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4065
    ].
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4066
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4067
    "Created: / 31-07-2013 / 14:41:33 / cg"
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4068
!
a23326b61afe class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3200
diff changeset
  4069
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4070
restarted
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4071
    "sent by my topWindow, when restarted from an image.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4072
     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
  4073
     required to reset the application after an image-restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4074
     (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
  4075
      subprocesses etc.)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4076
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4077
    "Modified: 1.6.1996 / 16:55:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4078
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4079
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4080
saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4081
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4082
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4083
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4084
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4085
    self closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4086
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4087
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4088
saveAndTerminateRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4089
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4090
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4091
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4092
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4093
    self saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4094
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4095
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4096
!ApplicationModel methodsFor:'translating'!
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4097
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4098
translateString:aString
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4099
    "translate aString to the current language.
3754
c6a86012772b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3750
diff changeset
  4100
     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
  4101
     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
  4102
3936
1007d2747659 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3907
diff changeset
  4103
    aString isNil ifTrue:[^ nil]. 
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4104
    ^ self resources stringWithCRs:aString
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4105
3936
1007d2747659 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3907
diff changeset
  4106
    "Modified: / 27-02-2017 / 13:50:46 / cg"
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4107
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4108
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4109
translateString:aString with:anArgument
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4110
    "translate aString to the current language.
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4111
     We use the resources as default.
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4112
     Subclasses may redefine this to use another mechanism"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4113
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4114
    ^ self resources stringWithCRs:aString with:anArgument
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4115
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4116
    "Created: / 25-11-2016 / 09:54:32 / cg"
2528
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4117
! !
abeb2b5c60da New: let the Application do the string translation
Stefan Vogel <sv@exept.de>
parents: 2527
diff changeset
  4118
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4119
!ApplicationModel methodsFor:'user interaction & notifications'!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4120
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4121
beep
3442
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4122
    "output an audible beep or bell on my screen device"
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4123
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4124
    device notNil ifTrue:[
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4125
        device beep.
341156060a57 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
  4126
    ].
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4127
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4128
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4129
information:aString
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4130
    "like Object's information, but translates the string via the
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4131
     resourcePack, thus giving a translated string automatically"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4132
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4133
    super information:(self translateString:aString)
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4134
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4135
    "Created: / 20-05-1998 / 03:48:43 / cg"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4136
    "Modified: / 25-11-2016 / 09:55:53 / cg"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4137
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4138
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4139
informationTranslated:aString
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4140
    "like Object's information, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4141
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4142
3799
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4143
    self information:(self translateString:aString)
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4144
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4145
    "Created: / 25-11-2016 / 09:59:47 / cg"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4146
!
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4147
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4148
informationTranslated:aString with:anArgument
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4149
    "like Object's information, but translates the string via the
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4150
     resourcePack, thus giving a translated string automatically"
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4151
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4152
    self information:(self translateString:aString with:anArgument)
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4153
2c432f023d01 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  4154
    "Created: / 25-11-2016 / 10:01:32 / cg"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4155
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4156
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4157
notify:aString
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4158
    "like Objects notify, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4159
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4160
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4161
    super notify:(self translateString:aString) withCRs
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4162
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4163
    "Created: / 20.5.1998 / 01:14:52 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4164
    "Modified: / 13.11.2001 / 20:10:12 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4165
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4166
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4167
openDocumentationFile:aFilename
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4168
    HTMLDocumentView notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4169
	HTMLDocumentView openFullOnDocumentationFile:aFilename.
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4170
    ].
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4171
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4172
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4173
restoreCursors
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4174
    "restore the original cursors in all of my views"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4175
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4176
    ^ self window windowGroup restoreCursors
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4177
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4178
    "Created: 1.6.1996 / 17:01:24 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4179
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4180
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4181
showCursor:aCursor
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4182
    "set all of my views cursor to aCursor.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4183
     It can be restored with #restoreCursor."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4184
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4185
    ^ self window windowGroup showCursor:aCursor
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4186
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4187
    "Created: 1.6.1996 / 17:01:09 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4188
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4189
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4190
warn:aString
3179
9bcc92bcbcee class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
  4191
    "like Object's warn, but translates the string via the
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4192
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4193
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4194
    self warn:aString translate:true
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4195
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4196
    "Created: / 20.5.1998 / 01:14:52 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4197
    "Modified: / 13.11.2001 / 20:10:12 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4198
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4199
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4200
warn:aString translate:aBoolean
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4201
    "like Objects warn, but optionally translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4202
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4203
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4204
    super warn:(aBoolean
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4205
		    ifTrue:[ (self translateString:aString) withCRs ]
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4206
		    ifFalse:[ aString ]).
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4207
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4208
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4209
warn:aString with:arg
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4210
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4211
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4212
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4213
    self warn:aString withArguments:(Array with:arg)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4214
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4215
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4216
warn:aString with:arg1 with:arg2
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4217
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4218
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4219
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4220
    self warn:aString withArguments:(Array with:arg1 with:arg2)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4221
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4222
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4223
warn:aString with:arg1 with:arg2 with:arg3
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4224
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4225
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4226
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4227
    self warn:aString withArguments:(Array with:arg1 with:arg2 with:arg3)
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4228
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4229
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4230
warn:aString with:arg1 with:arg2 with:arg3 with:arg4
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4231
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4232
     resourcePack, thus giving a translated string automatically"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4233
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4234
    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
  4235
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4236
    "Created: / 23.2.2000 / 09:43:04 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4237
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4238
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4239
warn:aString withArguments:argArray
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4240
    "like Objects warn, but translates the string via the
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4241
     resourcePack, thus giving a translated string automatically.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4242
     Also translates \'s to newLine."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4243
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4244
    |translatedString stream|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4245
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4246
    translatedString := self translateString:aString.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4247
    stream := TextStream on:(translatedString species new:translatedString size + (argArray size * 10)).
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4248
    translatedString withCRs expandPlaceholdersWith:argArray on:stream.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4249
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4250
    self warn:(stream contents) translate:false.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4251
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4252
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4253
withCursor:aCursor do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4254
    "evaluate aBlock, showing aCursor in my topView and all of its subviews.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4255
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4256
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4257
    |w|
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4258
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4259
    w := self window.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4260
    w notNil ifTrue:[
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4261
        ^ w topView withCursor:aCursor do:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4262
    ].
3317
550f2e3a8f37 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3308
diff changeset
  4263
    ^ aCursor showWhile:aBlock.
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4264
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4265
    "Modified: / 23.9.1998 / 17:00:25 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4266
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4267
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4268
withExecuteCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4269
    "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
  4270
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4271
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4272
    ^ self withCursor:(Cursor execute) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4273
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4274
    "Created: 14.12.1995 / 20:57:03 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4275
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4276
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4277
withReadCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4278
    "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
  4279
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4280
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4281
    ^ self withCursor:(Cursor read) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4282
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4283
    "Created: 14.12.1995 / 20:56:47 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4284
    "Modified: 14.12.1995 / 20:57:36 / cg"
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4285
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4286
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4287
withVisibleCursor:aCursor do:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4288
    "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
  4289
     Return the value of aBlock.
2940
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4290
     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
  4291
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4292
    |ret|
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4293
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4294
    self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4295
	withCursor:aCursor do:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4296
	    |time|
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4298
	    time := Time millisecondsToRun:[ ret := aBlock value].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4299
	    time := UserPreferences current waitCursorVisibleTime - time.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4300
	    time > 0 ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4301
		Delay waitForMilliseconds:time.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4302
	    ].
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4303
	].
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4304
    ^ ret.
2940
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4305
4d8f61704b4a comment/format in: #withVisibleCursor:do:
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  4306
    "Modified (comment): / 12-09-2011 / 12:14:31 / cg"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4307
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4308
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4309
withWaitCursorDo:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4310
    "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
  4311
     Return the value of aBlock."
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4312
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4313
    ^ self withCursor:(Cursor wait) do:aBlock
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4314
!
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4315
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4316
withWaitCursorVisibleDo:aBlock
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4317
    "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
  4318
     Return the value of aBlock.
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4319
     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
  4320
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4321
    ^ self withVisibleCursor:(Cursor wait) do:aBlock
3013
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4322
!
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4323
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4324
withWriteCursorDo:aBlock
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4325
    "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
  4326
     Return the value of aBlock."
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4327
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4328
    ^ self withCursor:(Cursor write) do:aBlock
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4329
08e54e554b13 added: #withWriteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
  4330
    "Created: / 27-07-2012 / 09:42:53 / cg"
2869
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4331
! !
fd029e1ec24c added: #beep
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  4332
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4333
!ApplicationModel methodsFor:'window events'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4334
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4335
clientMessage:msgType format:msgFormat eventData:msgData
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4336
    "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
  4337
     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
  4338
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4339
2526
d2be37e49195 changed #copyDataEvent:eventData:
Claus Gittinger <cg@exept.de>
parents: 2522
diff changeset
  4340
copyDataEvent:parameter eventData:msgData
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4341
    "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
  4342
     Subclasses prepared to receive them should redefine this method"
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4343
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4344
    |messageStream command argument|
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4345
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4346
    messageStream := msgData asString readStream.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4347
    command := messageStream upTo: $:.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4348
    argument := messageStream upTo: Character null.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4349
    self processApplicationCommand:command with:argument
2522
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4350
!
ff119836dbec hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents: 2520
diff changeset
  4351
3416
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4352
delayedAutoRaiseEventFor:oneOfMyViews
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4353
    "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
  4354
     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
  4355
     - for example, if one view is controlling another. 
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4356
     These get a chance to redefine this method"
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4357
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4358
    oneOfMyViews raise.
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4359
!
0741150eb5ae class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  4360
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4361
dispatchEvent:event
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4362
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4363
     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
  4364
     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
  4365
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4366
    ^ self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4367
	dispatchEvent:event
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4368
	withFocusOn:nil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4369
	delegate:true
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4370
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4371
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4372
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4373
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4374
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4375
     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
  4376
     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
  4377
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4378
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4379
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4380
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4381
    "Modified: / 20.6.1998 / 16:44:05 / cg"
1290
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  4382
!
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  4383
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4384
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
  4385
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4386
     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
  4387
     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
  4388
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4389
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4390
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4391
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4392
    "Modified: / 20.6.1998 / 16:44:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4393
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4394
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4395
dispatchEvent:event withFocusOn:focusViewOrNil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4396
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4397
     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
  4398
     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
  4399
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4400
    ^ self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4401
	dispatchEvent:event
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4402
	withFocusOn:focusViewOrNil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4403
	delegate:true
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4404
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4405
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4406
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4407
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4408
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4409
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4410
     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
  4411
     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
  4412
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4413
    ^ self
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4414
	dispatchEvent:event
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4415
	type:event type
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4416
	arguments:(event arguments)
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4417
	withFocusOn:focusViewOrNil
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4418
	delegate:doDelegate
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4419
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4423
noticeOfWindowClose:aWindow
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4424
    "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
  4425
     Can be redefined in subclasses for cleanup."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4426
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4427
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4428
    self windowEvent:(#close -> aWindow) from:aWindow.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4429
    ^ self
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4430
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4431
    "Created: / 18.6.1998 / 18:56:31 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4432
    "Modified: / 18.6.1998 / 19:14:16 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4433
!
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4434
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4435
noticeOfWindowOpen:aWindow
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4436
    "sent when a topView or applicationSubView has been opened.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4437
     Can be redefined in subclasses."
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4438
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4439
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  4440
    self windowEvent:(#open -> aWindow) from:aWindow.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4441
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4442
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4443
    "Created: / 18.6.1998 / 18:56:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4444
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4445
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4446
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4447
processApplicationCommand:command with:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4448
    "a message from a secondary application instance (the exe has been started again).
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4449
     Typically, the command is one like 'openPath:', as generated in StandaloneStartup."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4450
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4451
    command = 'openPath' ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4452
	self processOpenPathCommand:argument.
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4453
	^ self.
2527
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4454
    ].
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4455
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4456
    Transcript showCR: 'Invalid command received: ', command.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4457
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4458
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4459
processOpenPathCommand:argument
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4460
    "a message from a secondary application instance (the exe has been started again)
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4461
     to open another window on document as found in the pathName argument.
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4462
     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
  4463
     editor window if supported."
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4464
!
ff77cb089e9e comment
Claus Gittinger <cg@exept.de>
parents: 2526
diff changeset
  4465
3200
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4466
processShortcut:aKeyEvent
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4467
     "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
  4468
      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
  4469
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4470
    ^false
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4471
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4472
    "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
  4473
!
009ddfb1e69a Added ApplicationModel>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3195
diff changeset
  4474
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4475
requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4476
    "the applicationWindow wants to know, if a close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4477
     is ok. Return false if not."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4478
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4479
    |w k|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4480
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4481
    builder notNil ifTrue:[
3297
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4482
	(w := builder window) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4483
	    (k := w keyboardProcessor) notNil ifTrue:[
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4484
		^ k requestForWindowClose
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4485
	    ]
eafb68a0471b Added pre-open hooks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3294
diff changeset
  4486
	]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4487
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4488
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4489
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4490
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4491
    "Created: / 19.6.1998 / 01:34:58 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4492
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4493
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4494
showActivity:someMessage
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4495
    "some activityNotification shalt be communicated to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4496
     the user. Forwarded from the topView and ignored here.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4497
     Can be redefined in concrete applications to show the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4498
     message either in some infoView (infoLabel as in Windows)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4499
     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
  4500
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4501
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4502
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4503
    "Created: 16.12.1995 / 18:41:04 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4504
    "Modified: 24.4.1996 / 09:34:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4505
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4506
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4507
windowEvent:anEvent from:anApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4508
    "dummy: windowEvent forwarding is not yet implemented"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4509
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4510
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4511
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4512
    "Modified: 24.4.1996 / 09:32:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4513
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4514
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4515
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4516
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  4517
version
3484
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4518
    ^ '$Header$'
2977
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  4519
!
ee3185e19167 category of:9 methods
Claus Gittinger <cg@exept.de>
parents: 2976
diff changeset
  4520
2753
f8c6eadde7bb changed: #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2747
diff changeset
  4521
version_CVS
3484
5ddc6828a753 class: ApplicationModel
Stefan Vogel <sv@exept.de>
parents: 3472
diff changeset
  4522
    ^ '$Header$'
85
claus
parents: 83
diff changeset
  4523
! !
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  4524
3108
988608c69014 class: ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 3030
diff changeset
  4525
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  4526
ApplicationModel initialize!