ApplicationModel.st
author Stefan Vogel <sv@exept.de>
Mon, 25 Feb 2008 11:21:55 +0100
changeset 2387 ef4a9559c9e6
parent 2382 9c27d7006631
child 2393 14e0b6215b42
permissions -rw-r--r--
Changes from Zürich: support symbolic colors in UISpecifications
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     3
	      All Rights Reserved
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     4
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     5
 This software is furnished under a license and may be used
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     6
 only in accordance with the terms of that license and with the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     8
 be provided or otherwise made available to, or used by, any
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
     9
 other person.  No title to or ownership of the software is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    10
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    11
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    12
"{ Package: 'stx:libview2' }"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    13
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    14
Model subclass:#ApplicationModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    15
	instanceVariableNames:'builder resources device masterApplication'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    16
	classVariableNames:'DefaultLabels DefaultVisuals'
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
    17
	poolDictionaries:''
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    18
	category:'Interface-Framework'
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    19
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    20
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    21
ApplicationModel class instanceVariableNames:'ClassResources'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    22
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    23
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    24
 No other class instance variables are inherited by this class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    25
"
1350
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    26
!
cf8c3c79df78 added #warn:with:with:with:
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
    27
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    28
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    29
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
    30
copyright
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    31
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    32
 COPYRIGHT (c) 1995 by Claus Gittinger
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    33
	      All Rights Reserved
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    34
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    35
 This software is furnished under a license and may be used
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    36
 only in accordance with the terms of that license and with the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    38
 be provided or otherwise made available to, or used by, any
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    39
 other person.  No title to or ownership of the software is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    40
 hereby transferred.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    41
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    42
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    43
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    44
documentation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    45
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    46
    Since many ST-80 classes are subclasses of ApplicationModel, this class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    47
    is provided here to allow easier porting of ST-80 code.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    48
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    49
    It does not (currently) provide all functionality and is NOT
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    50
    compatible to the corresponding ST80 class; therefore, manual
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    51
    changes have to be made to get those applications to run under ST/X.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    52
    (but at least, this enables you to fileIn that code and have a superclass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    53
     for them)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    54
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    55
    As time goes by, ST/X applications are going to be converted to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    56
    become subclasses of this abstract class - see Launcher for a
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    57
    first concrete example.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    58
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    59
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    60
    ApplicationModel is prepared to build a view from a windowSpec, as
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    61
    created by the windowBuilder. If your subclass does not provide such
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    62
    a spec, you should at least redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    63
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    64
        #openInterface   - to create a topview and open it
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    65
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    66
    you may want to redefine:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    67
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    68
        #closeRequest    - to catch window closing
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    69
        #focusSequence   - to define a sequence for focus-stepping
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    70
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    71
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    72
    Once the interfaceBuilder is finished & released, subclasses can
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    73
    alternatively provide the spec via a #windowSpec method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    74
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    75
    The classResources have been put into this class to allow ST/X
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    76
    applications (which used to be subclasses of StandardSystemView)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    77
    to migrate smoothly into ApplicationModels (which is better design ...).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    78
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    79
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    80
    [Instance variables:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    81
        resources    ResourcePack       language string translation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    82
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    83
        builder      WindowBuilder      a builder who knows how to create
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    84
                                        a window hierarchy from a specification
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    85
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    86
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    87
    Notice: this class was implemented using protocol information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    88
    from alpha testers and PD code - it may not be complete or compatible to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    89
    the corresponding ST-80 class. If you encounter any incompatibilities,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    90
    please forward a note to the ST/X team.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    91
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    92
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    93
    [author:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    94
        Claus Gittinger
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    95
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    96
    [see also:]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    97
        StandardSystemView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    98
        WindowGroup DeviceWorkstation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
    99
"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   100
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   101
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   102
!ApplicationModel class methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   103
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   104
initialize 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   105
    self == ApplicationModel ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   106
        Smalltalk addDependent:self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   107
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   108
    DefaultLabels isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   109
        DefaultLabels := IdentityDictionary new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   110
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   111
    DefaultVisuals isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   112
        DefaultVisuals := IdentityDictionary new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   113
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   114
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   115
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   116
     ApplicationModel initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   117
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   118
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   119
    "Modified: 28.1.1997 / 12:31:38 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   120
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   121
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   122
!ApplicationModel class methodsFor:'instance creation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   123
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   124
new
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   125
    "return a new initialized instance"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   126
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
   127
    ^ self basicNew basicInitialize; initialize; yourself.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   128
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   129
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   130
onDevice:aDevice
1828
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   131
    "return a new initialized instance, which shall open its interface on aDevice."
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   132
d90487a76176 comment
Claus Gittinger <cg@exept.de>
parents: 1792
diff changeset
   133
    ^ (super basicNew basicInitialize setDevice:aDevice) initialize
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   134
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   135
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   136
!ApplicationModel class methodsFor:'accessing'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   137
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   138
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   139
    ^ self
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   143
!ApplicationModel class methodsFor:'active help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   144
1538
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   145
flyByHelpSpec
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   146
    "default is: no help-spec (should be redefined by concrete class if help is wanted)."
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   147
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   148
    ^ IdentityDictionary new.
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   149
!
e906245e5171 flyByHelp
Claus Gittinger <cg@exept.de>
parents: 1531
diff changeset
   150
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   151
helpSpec
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   152
    "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
   153
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   154
    ^ IdentityDictionary new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   155
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   156
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   157
!ApplicationModel class methodsFor:'bindings'!
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
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   160
    "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
   161
     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
   162
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   163
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   164
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   165
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   166
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   167
     Typically, a block is returned there."
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
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   170
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   171
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   172
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   173
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   174
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   175
    "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
   176
     a Button which passes a value to the actionMethod. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   177
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   178
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   179
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   180
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   181
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   182
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   183
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   184
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   185
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   186
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   187
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   188
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   189
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   190
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   191
    "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
   192
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   193
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   194
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   195
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   196
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   197
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   198
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   199
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   200
    ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   201
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   202
    "/ ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   203
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   204
    "Modified: / 27.10.1997 / 13:43:12 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   205
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   206
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   207
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   208
    "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
   209
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   210
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   211
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   212
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   213
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   214
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   215
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   216
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   217
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   218
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   219
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   220
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   221
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   222
colorFor:aSymbol
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   223
    "sent by the builder to ask for an application provided
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   224
     holder for a color.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   225
     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
   226
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   227
     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
   228
     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
   229
     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
   230
     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
   231
     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
   232
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   233
    (self respondsTo:aSymbol) ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   234
        ^ self perform:aSymbol.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   235
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   236
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   237
    "fall back to a well defined color name"
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   238
    (Color respondsTo:aSymbol) ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   239
        ^ Color perform:aSymbol.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   240
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   241
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   242
    ^ nil
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   243
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
   244
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   245
componentFor: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 application provided
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   247
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   248
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   249
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   250
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   251
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   252
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   253
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   254
     Typically, a view is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   255
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   256
    (self respondsTo:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   257
        ^ self perform:aKey
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
    ^ nil
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
labelFor: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
     label for a component.
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 components #label 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
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   271
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   272
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   273
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   274
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   275
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   276
    app isNil ifTrue:[^ nil].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   277
    (app respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   278
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   279
    ].
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   280
    ^ app labelAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   281
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   282
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   283
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   284
    "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
   285
     holder for a list.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   286
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   287
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   288
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   289
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   290
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   291
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   292
     Typically, a list-holding model (SelectionInList) is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   293
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   294
    |app|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   295
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   296
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   297
    app notNil ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   298
        (app respondsTo:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   299
            ^ app perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   300
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   301
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   302
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   303
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   304
    "Modified: 4.3.1997 / 00:53:03 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   307
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   308
    "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
   309
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   310
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   311
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   312
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   313
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   314
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   315
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   316
     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
   317
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   318
    ^ self application perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   319
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   320
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   321
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   322
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   323
    "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
   324
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   325
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   326
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   327
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   328
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   329
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   330
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   331
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   332
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   333
    ^ self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   334
        specificationFor:aKey 
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   335
        application:self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   336
        onDevice:nil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   337
!
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   338
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   339
specificationFor:aKey application:app onDevice:deviceOrNil
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   340
    "sent by the builder to ask for an application provided
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   341
     specification for a subcanvas or subspecification.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   342
     The argument, aKey comes from an UI-spec
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   343
     for a subcanvases #specification property (minorKey).
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   344
     Here, a corresponding message is sent to myself,
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   345
     which ought to be defined in the application subclass.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   346
     Alternatively, a subclass may redefine this method, to provide
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   347
     interfaceSpecifications from a Dictionary or whatever.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   348
     Typically, an interfaceSpecification is returned there."
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   349
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   350
    |displayDevice displayDeviceType modifiedKey appClass|
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   351
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   352
    "/ this code is so ugly...
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   353
    "/ translate the specs name, if the display device type is different
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   354
    "/ for example, if the type is pda, the xxxSpec_pda spec will be used.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   355
    displayDevice := deviceOrNil ? Screen current ? Screen default.
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   356
    displayDevice notNil ifTrue:[
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   357
        displayDeviceType := displayDevice deviceType.
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   358
        displayDeviceType notNil ifTrue:[
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   359
            modifiedKey := (aKey , '_' , displayDeviceType) asSymbolIfInterned.
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   360
            modifiedKey notNil ifTrue:[
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   361
                (app respondsTo:modifiedKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   362
                    ^ app perform:modifiedKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   363
                ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   364
                app isBehavior ifFalse:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   365
                    appClass := app application.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   366
                    (appClass respondsTo:modifiedKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   367
                        ^ appClass perform:modifiedKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   368
                    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   369
                ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   370
            ]
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   371
        ]
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   372
    ].
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   373
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   374
    app isBehavior ifFalse:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   375
        (app respondsTo:aKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   376
            ^ app perform:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   377
        ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   378
        appClass := app application.
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   379
        (appClass respondsTo:aKey) ifTrue:[
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   380
            ^ appClass perform:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   381
        ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   382
        ^ app masterApplication specificationFor:aKey
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   383
    ].
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   384
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
   385
    ^ app perform:aKey
1115
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   386
!
7fa80d141ed3 added #allButOpen
Claus Gittinger <cg@exept.de>
parents: 1110
diff changeset
   387
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   388
subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   389
    "sent by subCanvas to ask for an application inside itself. 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   390
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   391
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   392
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   393
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   394
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   395
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   396
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   397
    |app|
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   398
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   399
    app := self application.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   400
    (app respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   401
        ^ app perform:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   402
    ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   403
    ^ nil
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   404
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
   405
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   406
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   407
    "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
   408
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   409
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   410
     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
   411
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   412
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   413
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   414
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   415
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   416
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   417
    |app|
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   418
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   419
    app := self application.
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   420
    (app respondsTo:aKey) ifTrue:[
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   421
        ^ app perform:aKey
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   422
    ].
1781
1107d2237d7f *** empty log message ***
Michael Beyl <mb@exept.de>
parents: 1766
diff changeset
   423
    ^ app visualAt:aKey ifAbsent:nil
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   424
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   425
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   426
!ApplicationModel class methodsFor:'change & update'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   427
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   428
update:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   429
    "flush resources on language changes"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   430
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   431
    something == #Language ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   432
        self flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   433
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   434
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   435
    "Created: 15.6.1996 / 15:13:29 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   436
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   437
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   438
!ApplicationModel class methodsFor:'defaults'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   439
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   440
defaultIcon
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   441
    "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
   442
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   443
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   444
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   445
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   446
labelAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   447
    "default is: no label (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   448
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   449
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   450
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   451
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   452
labelAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   453
    "default is: no label (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   454
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   455
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   456
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   457
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   458
labelAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   459
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   460
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   461
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   462
labels
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   463
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   464
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   465
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   466
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   467
visualAt:aKey
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   468
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   469
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   470
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   471
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   472
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   473
visualAt:aKey ifAbsent:aBlock
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   474
    "default is: no visual (could be redefined by concrete class )."
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
   475
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   476
    ^ aBlock value
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   477
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   478
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   479
visualAt:aKey put:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   480
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   481
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   482
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   483
visuals
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   484
    "/ not yet implemented
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   485
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   486
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   487
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   488
!ApplicationModel class methodsFor:'help'!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   489
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   490
aboutImage
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   491
    "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
   492
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   493
    ^ self defaultIcon
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   494
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   495
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   496
aboutThisApplicationLabel
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   497
    "label for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   498
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   499
    ^ 'About This Application'
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   500
!
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   501
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   502
aboutThisApplicationText
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   503
    "text for an about box for this application."
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   504
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   505
    |rev clsRev msg|
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   506
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   507
    rev := ''.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   508
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   509
    (clsRev := self revision) notNil ifTrue: [rev := '  (rev: ', clsRev printString, ')'].
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   510
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   511
    msg := '\' withCRs , self name asBoldText, rev.
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   512
    ^ msg
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   513
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   514
    "Created: / 13.11.2001 / 12:28:36 / cg"
2382
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   515
!
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   516
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   517
documentationPath
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   518
    |packageDir|
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   519
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   520
    packageDir := Smalltalk getPackageDirectoryForPackage:(self package).
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   521
    packageDir isNil ifTrue:[
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   522
        packageDir := Filename defaultDirectory
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   523
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   524
    #(
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   525
        'documentation'
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   526
        'doc'
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   527
    ) do:[:subDir |
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   528
        (packageDir construct:subDir) exists ifTrue:[
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   529
            ^ packageDir construct:subDir
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   530
        ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   531
    ].
9c27d7006631 +documentationPath
Claus Gittinger <cg@exept.de>
parents: 2380
diff changeset
   532
    ^ packageDir construct:'doc'
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   533
! !
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
   534
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   535
!ApplicationModel class methodsFor:'private'!
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   536
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   537
selfResponsibleFor:aKey
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   538
    ^ self respondsTo:aKey
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   539
! !
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   540
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   541
!ApplicationModel class methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   542
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   543
interfaceSpecFor:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   544
    "return an interface spec"
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   545
    
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   546
    |spec|
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   547
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   548
    spec := self application specificationFor:aSelector.
2355
ea393eb88f25 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
   549
    spec isNil ifTrue:[^ nil].
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   550
    spec class missingClassInLiteralArrayErrorSignal
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   551
        handle:[:ex |
2295
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   552
            |clsInMyNamespace className|
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   553
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   554
            className := ex parameter.
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   555
            className isSymbol ifTrue:[
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   556
                "retry with my nameSpace"
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   557
                clsInMyNamespace := self nameSpace at:className.
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   558
                clsInMyNamespace notNil ifTrue:[ ex proceedWith:clsInMyNamespace].
c303807aa17e Fix exception handling with non-symbol classes
Stefan Vogel <sv@exept.de>
parents: 2289
diff changeset
   559
            ].
2287
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   560
            self warn:ex description.
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   561
            ex proceedWith:nil
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   562
        ]
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   563
        do:[
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   564
            ^ UISpecification from:(self application specificationFor:aSelector)
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   565
        ]
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   566
fc04b196d28c care for namespace in a literalspec
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
   567
    "Modified: / 26-02-2007 / 18:30:25 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   568
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   569
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   570
isVisualStartable
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   571
    "return true, if this application can be started via #open.
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   572
     (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
   573
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   574
    (self == ApplicationModel) ifTrue:[^ false "I am abstract"].
1556
388922a9c6eb implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1548
diff changeset
   575
    ((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
   576
"/    (self respondsTo:#windowSpec) ifFalse:[^ false].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   577
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   578
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   579
    "Created: / 27.10.1997 / 16:38:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   580
    "Modified: / 14.3.1998 / 16:30:50 / cg"
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
!ApplicationModel class methodsFor:'resources'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   584
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   585
classResources
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   586
    "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
   587
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   588
    ClassResources isNil ifTrue:[
1955
257a4acb852b classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents: 1924
diff changeset
   589
        ClassResources := super classResources.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   590
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   591
    ^ ClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   592
!
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
classResources:aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   595
    "allow setting of the classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   596
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   597
    ClassResources := aResourcePack
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   600
flushAllClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   601
    "flush all classes resource translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   602
     Needed after a resource file / language setting has changed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   603
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   604
    ResourcePack flushCachedResourcePacks.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   605
    self flushClassResources.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   606
    self allSubclassesDo:[:aClass |
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   607
        aClass flushClassResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   608
    ].
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   609
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   610
    WindowGroup scheduledWindowGroups
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   611
        do:[:wg | |app| 
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   612
                    (app := wg application) notNil ifTrue:[
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   613
                        app initializeResources
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   614
                    ]
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   615
           ]
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   616
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
   617
    "Modified: / 13-09-2006 / 12:41:31 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   618
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   619
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   620
flushClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   621
    "flush classes resource string translations.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   622
     Needed whenever a resource file / language setting has changed"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   623
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   624
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   625
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   626
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   627
resources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   628
    "return the applications resources - thats a ResourcePack containing
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   629
     language strings"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   630
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   631
    ^ self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   632
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   633
    "Created: / 19.5.1998 / 20:14:00 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   634
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   635
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   636
updateClassResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   637
    "update my classResources"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   638
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   639
    ClassResources := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   640
    self classResources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   641
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   642
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   643
!ApplicationModel class methodsFor:'startup'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   644
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   645
open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   646
    "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
   647
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   648
    ^ self new open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   649
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   650
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   651
     Launcher open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   652
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   653
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   654
    "Modified: 13.1.1997 / 20:54:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   655
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   656
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   657
openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   658
    "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
   659
     at some position."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   660
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   661
    ^ self new openAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   662
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   663
    "Modified: 14.2.1997 / 20:28:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   664
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   665
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   666
openDialogInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   667
    "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
   668
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   669
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   670
    ^ self openDialogInterface:anInterfaceSymbol withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   671
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   672
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   673
    "Created: 14.2.1997 / 20:33:10 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   674
    "Modified: 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   675
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   676
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   677
openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   678
    "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
   679
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   680
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   681
    ^ self new openDialogInterface:anInterfaceSymbol withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   682
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   683
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   684
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   685
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   686
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   687
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   688
openDialogInterfaceSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   689
    "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
   690
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   691
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   692
    ^ self new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   693
        openDialogInterfaceSpec:anInterfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   694
        withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   695
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   696
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   697
openDialogInterfaceSpec:anInterfaceSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   698
    "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
   699
     specified by the given spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   700
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   701
    ^ self new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   702
        openDialogInterfaceSpec:anInterfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   703
        withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   704
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   705
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   706
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   707
    "Created: 28.2.1997 / 14:07:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   708
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   709
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   710
openDialogSpec:aSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   711
    "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
   712
     specified by aSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   713
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   714
    ^ self openDialogSpec:aSpec withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   715
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   716
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   717
    "Modified: / 28.2.1997 / 14:07:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   718
    "Created: / 20.5.1998 / 20:27:08 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   719
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   720
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   721
openDialogSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   722
    "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
   723
     specified by the spec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   724
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   725
    ^ self new 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   726
        openDialogSpec:aSpec 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   727
        withBindings:bindings
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   728
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   729
    "Modified: / 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   730
    "Modified: / 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   731
    "Created: / 20.5.1998 / 20:26:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   732
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   733
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   734
openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   735
    "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
   736
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   737
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   738
    ^ self new openInterface:anInterfaceSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   739
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   740
    "Modified: 5.9.1995 / 17:54:50 / claus"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   741
    "Modified: 13.1.1997 / 20:55:02 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   742
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   743
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   744
openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   745
    "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
   746
     specified by anInterfaceSymbol."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   747
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   748
    ^ self new openInterface:anInterfaceSymbol at:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   749
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   750
    "Modified: 14.2.1997 / 20:28:47 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   751
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   752
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   753
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   754
    "create an instance of the application and open its view modal"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   755
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   756
    ^ self new openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   757
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   758
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   759
openOn:anApplicationModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   760
    "send an open message to the argument, anApplicationModel.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   761
     I dont really understand what this method is useful for ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   762
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   763
    ^ anApplicationModel open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   764
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   765
    "Modified: 13.1.1997 / 20:55:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   766
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   767
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   768
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   769
    "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
   770
     on ANOTHER device. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   771
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   772
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   773
2071
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   774
    Screen currentScreenQuerySignal 
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   775
        answer:aDevice
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   776
        do:[
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   777
            ^ (self onDevice:aDevice) open
9be6a5197cec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   778
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   779
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   780
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   781
     Launcher openOnDevice:Display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   782
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   783
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   784
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   785
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   786
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   787
openOnXScreenNamed:aScreenName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   788
    "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
   789
     on some X display screen. The argument aScreenName must be 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   790
     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
   791
     For more info, read the document on multiple display
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   792
     support and the documentation of the DeviceWorkstation class."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   793
1570
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   794
    |newDevice|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   795
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   796
    [
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   797
        newDevice := XWorkstation newDispatchingFor:aScreenName.
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   798
    ] on:Screen deviceOpenErrorSignal do:[:ex|
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   799
        self warn:'Could not open display: ' , aScreenName.
5ef90b35b7d6 Changed Workstation initialization.
Stefan Vogel <sv@exept.de>
parents: 1565
diff changeset
   800
        ^ self
995
63d1b9ce554b Avoid invoking pre/postBuild twice for subCanvases which
Claus Gittinger <cg@exept.de>
parents: 983
diff changeset
   801
    ].
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   802
    ^ self openOnDevice:newDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   803
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   804
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   805
     Launcher openOnXScreenNamed:'sgi:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   806
     Launcher openOnXScreenNamed:'foo:0'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   807
     NewLauncher openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   808
     NewLauncher openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   809
     SystemBrowser openOnXScreenNamed:'dawn:0'
1479
c30179d243db allow device-specific windowSpecs
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
   810
     SystemBrowser openOnXScreenNamed:'bitsy:0'
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   811
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   812
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   813
    "Modified: 13.1.1997 / 20:55:27 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   814
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   815
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   816
openWithSpec:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   817
    "ST80 compatibility:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   818
     mhmh - what is the difference to #openInterface ?"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   819
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   820
    ^ self openInterface:aSpecSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   821
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   822
    "Modified: 29.8.1997 / 01:16:52 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   823
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   824
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   825
!ApplicationModel methodsFor:'accessing'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   826
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   827
application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   828
    "application knows about interfaceSpecs, menuSpecs etc.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   829
     Usually this is my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   830
     This may be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   831
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   832
    ^ self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   833
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   834
    "Modified: / 5.2.1998 / 00:45:21 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   835
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   836
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   837
builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   838
    "return the applications builder; this one has more information
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   839
     about views, components etc."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   840
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   841
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   842
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   843
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   844
builder:aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   845
    "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
   846
     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
   847
     was created."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   848
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   849
    builder := aBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   850
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   851
1602
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
   852
componentAt:name
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
   853
    ^ self builder componentAt:name
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
   854
!
6648285d6a14 componentAt:
Claus Gittinger <cg@exept.de>
parents: 1592
diff changeset
   855
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   856
masterApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   857
    "return the value of the instance variable 'masterApplication' (automatically generated)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   858
1427
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   859
    ^ masterApplication
b3e355574ccf comment only
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
   860
!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   861
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   862
masterApplication:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   863
    "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
   864
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   865
    something == self ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   866
        self error:'an application cannot be its own masterApplication' mayProceed:true.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   867
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   868
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   869
    masterApplication := something.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   870
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   871
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   872
resources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   873
    "return the applications resources - thats a ResourcePack containing
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   874
     national language strings"
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   875
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   876
    resources isNil ifTrue:[
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   877
        masterApplication notNil ifTrue:[
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   878
            ^ masterApplication resources
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   879
        ]
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   880
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   881
    ^ resources
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   882
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   883
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   884
resources:aResourcePack
1988
7b33c9095fe9 resources via master, if there is one
Claus Gittinger <cg@exept.de>
parents: 1985
diff changeset
   885
    "set the applications resources - usually this is done automatically,
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   886
     except for manually built dialogs"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   887
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   888
    resources := aResourcePack
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   889
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   890
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   891
window
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   892
    "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
   893
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   894
    |win|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   895
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   896
    builder isNil ifTrue:[^ nil].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   897
    (win := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   898
        ^ win
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   899
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   900
    masterApplication notNil ifTrue:[
1442
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
   901
        masterApplication ~~ self ifTrue:[
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
   902
            "/ is that true ?
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
   903
            ^ masterApplication window
96d3aff662c3 check for masterApplication == self (to avoid endless recursion)
Claus Gittinger <cg@exept.de>
parents: 1432
diff changeset
   904
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   905
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   906
    ^ nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   907
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   908
    "Modified: / 18.9.1998 / 15:18:19 / cg"
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
window:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   912
    "set my topWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   913
     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
   914
     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
   915
     when the builder is accessed."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   916
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   917
    builder isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   918
        self createBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   919
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   920
    builder window:aTopView
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
    "Created: 18.4.1996 / 14:55:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   923
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   924
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   925
windowGroup 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   926
    "return the applications windowGroup"
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
    |w|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   929
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   930
    builder notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   931
        (w := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   932
            ^ w windowGroup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   933
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   934
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   935
    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   936
        ^ masterApplication windowGroup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   937
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   938
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   939
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   940
    "Modified: / 7.9.1998 / 23:37:00 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   941
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   942
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   943
!ApplicationModel methodsFor:'binding access'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   944
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   945
actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   946
    "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
   947
     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
   948
     for a buttons #action property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   949
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   950
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   951
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   952
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   953
     Typically, a block is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   954
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   955
     (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   956
         ^ [self perform:aKey]   "/ could use:  MessageSend receiver:self selector:aKey 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   957
     ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   958
     ^ masterApplication actionFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   959
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
   960
     "Modified: / 28.10.1997 / 20:34:51 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   961
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   962
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   963
actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   964
    "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
   965
     a Button which passes a value. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   966
     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
   967
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   968
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   969
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   970
     actionBlocks from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   971
     Typically, a block is returned there."
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
     (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   974
         ^ [self perform:aKey with:aValue]
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
     ^ masterApplication actionFor:aKey withValue:aValue
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   977
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   978
2364
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   979
actionFor:aKey withValue:value1 withValue:value2
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   980
    "sent by the builder to ask for an actionBlock for a Button which passes two values. 
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   981
     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
   982
     Here, a corresponding message is sent to myself,
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   983
     which ought to be defined in the application subclass.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   984
     Alternatively, a subclass may redefine this method, to provide
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   985
     actionBlocks from a Dictionary or whatever.
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   986
     Typically, a block is returned there."
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   987
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   988
     (self selfResponsibleFor:aKey) ifTrue:[
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   989
         ^ [self perform:aKey with:value1 with:value2]
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   990
     ].
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   991
     ^ masterApplication actionFor:aKey withValue:value1 withValue:value2
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   992
!
b6ba7b2b21be fixed two-arg actions
Claus Gittinger <cg@exept.de>
parents: 2355
diff changeset
   993
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   994
aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   995
    "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
   996
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   997
     for a components #aspect property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   998
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
   999
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1000
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1001
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1002
     Typically, a valueHolder is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1003
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1004
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1005
        ^ self perform:aKey
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
    ^ masterApplication aspectFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1008
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1009
    "Modified: / 18.6.1998 / 20:33:23 / 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
1742
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1012
aspectOrNil:aKey forSubApplication:aSubApp
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1013
    ^ nil
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1014
!
e463f28400fd hook for subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents: 1741
diff changeset
  1015
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1016
clientFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1017
    "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
  1018
     subcanvas's application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1019
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1020
     for a subcanvas's #client property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1021
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1022
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1023
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1024
     appModels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1025
     Typically, an applicationModel is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1026
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1027
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1028
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1029
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1030
    ^ masterApplication clientFor:aKey
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
    "Modified: / 18.6.1998 / 20:33:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1033
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1034
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1035
colorFor:aKey
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1036
    "sent by the builder to ask for an application provided
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1037
     holder for a color.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1038
     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
  1039
     for a widgets #*Color property.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1040
     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
  1041
     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
  1042
     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
  1043
     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
  1044
     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
  1045
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1046
    (self respondsTo:aKey) ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1047
        ^ self perform:aKey
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1048
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1049
    (self class respondsTo:aKey) ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1050
        ^ self class perform:aKey
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1051
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1052
    masterApplication notNil ifTrue:[
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1053
        ^ masterApplication colorFor:aKey
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1054
    ].
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1055
    ^ self class colorFor:aKey.
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1056
!
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  1057
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1058
componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1059
    "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
  1060
     component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1061
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1062
     for a viewHolders #view property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1063
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1064
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1065
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1066
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1067
     Typically, a view is returned there."
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
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1070
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1071
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1072
    ^ masterApplication componentFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1073
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1074
    "Modified: / 18.6.1998 / 20:33:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1075
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1076
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1077
labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1078
    "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
  1079
     label for a component.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1080
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1081
     for a components #label property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1082
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1083
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1084
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1085
     labels from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1086
     Typically, a string is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1087
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1088
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1089
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1090
    ].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1091
    (self class selfResponsibleFor:aKey) ifTrue:[
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1092
        ^ self class perform:aKey
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1093
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1094
    ^ masterApplication labelFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1095
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1096
    "Modified: / 18.6.1998 / 20:33:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1097
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1098
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1099
listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1100
    "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
  1101
     holder for a list (for example, a popUpLists list).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1102
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1103
     for a listWidgets #list property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1104
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1105
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1106
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1107
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1108
     Typically, a list-holding model (SelectionInList) is returned there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1109
     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
  1110
     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
  1111
     chance."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1112
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1113
    |a|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1114
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1115
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1116
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1117
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1118
    a := self aspectFor:aKey.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1119
    a notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1120
        ^ a
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1121
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1122
    ^ self application listFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1123
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1124
    "Modified: / 18.6.1998 / 20:33:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1125
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1126
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1127
menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1128
    "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
  1129
     holder for a menu.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1130
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1131
     for a widgets #menu property.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1132
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1133
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1134
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1135
     holders from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1136
     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
  1137
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1138
    (self selfResponsibleFor:aKey) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1139
        ^ self perform:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1140
    ].
1997
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1141
    (self class selfResponsibleFor:aKey) ifTrue:[
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1142
        ^ self class perform:aKey
420fac06a489 menuFor: and labelFor:
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
  1143
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1144
    ^ masterApplication menuFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1145
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1146
    "Modified: / 18.6.1998 / 20:33:56 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1147
!
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
specificationFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1150
    "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
  1151
     specification for a subcanvas or subspecification.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1152
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1153
     for a subcanvases #specification property (minorKey).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1154
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1155
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1156
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1157
     interfaceSpecifications from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1158
     Typically, an interfaceSpecification is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1159
1584
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1160
    ^ ApplicationModel
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1161
        specificationFor:aKey 
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1162
        application:self
1643bdbd15e2 specificationFor code refactored
ca
parents: 1570
diff changeset
  1163
        onDevice:(self graphicsDevice)
1419
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
2058
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1166
subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1167
    "sent by subCanvas to ask for an application inside itself. 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1168
     The argument, aKey comes from a TabList-specs majorKey.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1169
     Here, a corresponding message is sent to myself,
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1170
     which ought to be defined in the application subclass.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1171
     Alternatively, a subclass may redefine this method, to provide
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1172
     an application from a Dictionary or whatever.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1173
     Typically, an ApplicationModel subinstance is returned there."
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1174
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1175
     (self respondsTo:aKey) ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1176
         ^ self perform:aKey 
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1177
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1178
     masterApplication notNil ifTrue:[
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1179
         ^ masterApplication subApplicationFor:aKey
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1180
     ].
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1181
     ^ nil.
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1182
!
3f814cdba5d6 subApplicationFor
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1183
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1184
visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1185
    "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
  1186
     image or element for a label.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1187
     The argument, aKey comes from an UI-spec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1188
     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
  1189
     Here, a corresponding message is sent to myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1190
     which ought to be defined in the application subclass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1191
     Alternatively, a subclass may redefine this method, to provide
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1192
     images from a Dictionary or whatever.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1193
     Typically, an image is returned there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1194
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1195
    ^ self application visualFor:aKey
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1196
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1197
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1198
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1199
!ApplicationModel methodsFor:'binding access-help'!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1200
2087
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1201
basicFlyByHelpTextForKey:aKey
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1202
    "flyByHelp interface: return some short help text for a key
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1203
     key is the symbol associated with some widget or menu item.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1204
     Return the original (english) text; needs to be translated as per language"
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1205
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1206
    |helpText helpSpec resourceArgs|
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1207
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1208
    helpSpec := self flyByHelpSpec.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1209
    helpSpec notNil ifTrue:[
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1210
        helpText := helpSpec at:aKey ifAbsent:nil.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1211
    ].
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1212
    helpText isNil ifTrue:[
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1213
        masterApplication notNil ifTrue:[
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1214
            helpText := masterApplication flyByHelpTextForKey:aKey
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1215
        ]
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1216
    ].
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1217
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1218
    "/ new: allow for a collection (resource-key arg1 arg2...)
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1219
    (helpText isCollection and:[helpText isString not]) ifTrue:[
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1220
        resourceArgs := helpText copyFrom:2.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1221
        helpText := helpText first.
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1222
    ].
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1223
    ^ helpText
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1224
!
69abec0dd510 help texts
Claus Gittinger <cg@exept.de>
parents: 2086
diff changeset
  1225
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1226
basicHelpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1227
    "activeHelp interface: return some help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1228
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1229
     Return the original (english) text; needs to be translated as per language"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1230
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1231
    |helpText|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1232
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1233
    helpText := (self helpSpec) at:aKey ifAbsent:nil.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1234
    helpText isNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1235
        masterApplication notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1236
            helpText := masterApplication helpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1237
        ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1238
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1239
    ^ helpText
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1240
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1241
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1242
flyByHelpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1243
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1244
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1245
    ^ self class flyByHelpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1246
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1247
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1248
flyByHelpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1249
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1250
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1251
    |key|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1252
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1253
    builder notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1254
        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1255
            ^ self flyByHelpTextForKey:key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1256
        ]
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1257
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1258
    masterApplication notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1259
        ^ masterApplication flyByHelpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1260
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1261
    ^ nil
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1262
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1263
    "Modified: / 31.7.1998 / 23:03:10 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1264
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1265
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1266
flyByHelpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1267
    "flyByHelp interface: return some short help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1268
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1269
     (from my flyByHelpSpec); return a language variant (if available)"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1270
2088
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
  1271
    |helpText resourceArgs|
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
  1272
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
  1273
    helpText := self basicFlyByHelpTextForKey:aKey.
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1274
    (resources notNil and:[helpText notNil]) ifTrue:[
2345
3502dcdf4372 allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1275
        "/ kludge to allow for dynamic translation by the application itself.
3502dcdf4372 allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1276
        helpText isBlock ifTrue:[
3502dcdf4372 allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1277
            ^ helpText value
3502dcdf4372 allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1278
        ].
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1279
        "/ translate.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1280
        resourceArgs notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1281
            ^ resources stringWithCRs:helpText withArgs:resourceArgs
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1282
        ].
2336
edfa675d2987 changed #flyByHelpTextForKey:
Claus Gittinger <cg@exept.de>
parents: 2295
diff changeset
  1283
        ^ resources stringWithCRs:helpText
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1284
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1285
    ^ helpText
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1286
2345
3502dcdf4372 allow for a block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1287
    "Modified: / 03-11-2007 / 12:04:14 / cg"
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1288
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1289
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1290
helpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1291
    "activeHelp interface: return some short help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1292
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1293
    ^ self class helpSpec
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1294
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1295
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1296
helpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1297
    "activeHelp interface: return some help text for a widget component"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1298
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1299
    |key|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1300
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1301
    builder notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1302
        (key := builder helpKeyFor:aComponent) notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1303
            ^ self helpTextForKey:key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1304
        ]
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1305
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1306
    masterApplication notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1307
        ^ masterApplication helpTextFor:aComponent
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1308
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1309
    ^ nil
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1310
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1311
    "Modified: / 31.7.1998 / 23:03:10 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1312
!
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1313
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1314
helpTextForKey:aKey
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1315
    "activeHelp interface: return some help text for a key
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1316
     key is the symbol associated with some widget or menu item.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1317
     (from my helpSpec); return a language variant (if available)"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1318
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1319
    |helpText xLated|
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1320
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1321
    helpText := self basicHelpTextForKey:aKey.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1322
    helpText isNil ifTrue:[
2095
eabe0a21ebc9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2094
diff changeset
  1323
        aKey isSymbol ifFalse:[^ nil].
2094
bbddf66ad97c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2088
diff changeset
  1324
        ^ 'Sorry, no help for: ',aKey "/ nil
2086
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1325
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1326
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1327
    "/ translate.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1328
    resources notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1329
        xLated := resources string:helpText default:nil.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1330
        xLated isNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1331
            (helpText endsWith:'.') ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1332
                xLated := resources string:(helpText copyWithoutLast:1) default:nil.
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1333
                xLated notNil ifTrue:[
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1334
                    ^ xLated , '.'
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1335
                ]
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1336
            ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1337
        ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1338
        ^ resources string:helpText
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1339
    ].
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1340
    ^ helpText
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1341
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1342
    "Modified: / 4.2.2000 / 15:30:16 / cg"
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1343
! !
d357dc59885a help texts
Claus Gittinger <cg@exept.de>
parents: 2079
diff changeset
  1344
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1345
!ApplicationModel methodsFor:'building'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1346
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1347
allButOpen
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1348
    "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
  1349
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1350
    ^ self allButOpenInterface:(self defaultWindowSpecName).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1351
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1352
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1353
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1354
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1355
allButOpenFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1356
    "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
  1357
     The argument is a spec which defines the interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1358
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1359
    |window|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1360
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1361
"/ DISABLED; see comment in basicInitialize
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1362
"/
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1363
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1364
"/     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
  1365
"/     instance of the no-op WindowBuilder. Now, it becomes
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1366
"/     a UIBuilder ....
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1367
"/     This allows for ApplicationModels without a UIBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1368
"/     if not needed.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1369
"/    "
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1370
"/    realBuilder := UIBuilder new.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1371
"/    builder := realBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1372
"/    builder application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1373
"/    builder bindings:builder bindings.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1374
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1375
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1376
        self createBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1377
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1378
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1379
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1380
    builder buildWindowFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1381
    window := builder window.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1382
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1383
    window model:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1384
    (window respondsTo:#application:) ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1385
        window application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1386
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1387
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1388
    self showingHelp ifTrue: [ActiveHelp startFor: self].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1389
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1390
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1391
    "Modified: / 19.6.1998 / 03:35:31 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1392
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1393
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1394
allButOpenInterface:aSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1395
    "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
  1396
     The argument specifies a selector of a method,
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1397
     which when sent to myself should return a spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1398
     Notice, this returns the windowBuilder."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1399
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1400
    self allButOpenFrom:(self interfaceSpecFor:aSymbol).
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1401
    ^ builder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1402
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1403
    "Modified: / 19.6.1998 / 01:48:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1404
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1405
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1406
buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1407
    "build a subcanvases spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1408
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1409
    |sameApp prevSpec prevSource|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1410
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1411
    aBuilder notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1412
        prevSpec := aBuilder spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1413
        prevSource := aBuilder source.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1414
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1415
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1416
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1417
        builder := aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1418
        aBuilder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1419
            self createBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1420
        ]
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1421
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1422
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1423
    aBuilder source:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1424
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1425
    "/ if the subcanvases appModel is NOT the same as
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1426
    "/ the topApp, it must be pre/post-built.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1427
    "/ Otherwise, we invoke pre/post-builtAsSubcanvas.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1428
    "/ which provides a hook for redefinition in concrete appModels.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1429
    "/ This avoids invoking pre/postBuild twice for subCanvases which
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1430
    "/ have the topApp as appModel.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1431
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1432
    sameApp := aBuilder application == aBuilder window topView application.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1433
    sameApp ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1434
        self preBuildAsSubcanvasWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1435
    ] ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1436
        self preBuildWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1437
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1438
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1439
    aBuilder buildFromSpec:specToBuild.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1440
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1441
    sameApp ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1442
        self postBuildAsSubcanvasWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1443
    ] ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1444
        self postBuildWith:aBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1445
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1446
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1447
    prevSpec notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1448
        "/ restore state in builder if original builder was used
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1449
        aBuilder spec:prevSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1450
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1451
    prevSource notNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1452
        "/ restore state in builder if original builder was used
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1453
        aBuilder source:prevSource.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1454
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1455
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1456
    ^ aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1457
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1458
    "Created: / 18-06-1998 / 20:08:45 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1459
    "Modified: / 27-10-2006 / 11:45:25 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1460
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1461
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1462
buildSubCanvas:spec withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1463
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1464
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1465
    self buildSubCanvas:spec withMenu:false withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1466
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1467
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1468
buildSubCanvas:spec withMenu:withMenuBoolean withBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1469
    "build a subcanvases' spec into aSubcanvas"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1470
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1471
    |specToBuild|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1472
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1473
    specToBuild := spec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1474
    withMenuBoolean ifFalse:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1475
        "/ subapps should not build the menu and other fullSpec stuff.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1476
        spec class == FullSpec ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1477
            specToBuild := spec component.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1478
        ]
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1479
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1480
    self buildSpec:specToBuild asSubCanvasWithBuilder:aBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1481
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  1482
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1483
!ApplicationModel methodsFor:'change & update'!
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
delayedUpdate:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1486
    "support for delayed updates - 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1487
     subclasses which invoke #enqueueDelayedUpdate:with:from: (from #update:with:from:)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1488
     must also redefine this method, and perform the actual update there."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1489
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1490
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1491
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1492
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1493
enqueueDelayedUpdate:something with:aParameter from:changedObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1494
    "support for delayed updates - to be invoked from a concrete classes
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1495
     #update:with:from: method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1496
     This will enqueue a delayed update, and resend #delayedUpdate:with:from:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1497
     whenever the receiver is handling events.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1498
     Especially useful, if many updates arrive at high frequency, to avoid
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1499
     multiple redraws."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1500
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1501
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1502
        enqueueMessage:#delayedUpdate:with:from:
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1503
        for:self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1504
        arguments:(Array 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1505
                        with:something 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1506
                        with:aParameter 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1507
                        with:changedObject).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1508
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1509
    "Modified: / 26.2.2000 / 18:01:44 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1510
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1511
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1512
enqueueMessage:selector for:someone arguments:argList
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1513
    "enqueue a message to be sent to myself later, when my process
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1514
     is back in its eventLoop. Also, filter duplicates.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1515
     This is useful, to buffer redraws and avoid flicker due to multiple
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1516
     redraws (especially in browsers, when reacting on changeMessages resulting
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1517
     from changes made in other browsers)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1518
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1519
    |window sensor|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1520
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1521
    (window := self window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1522
        sensor := window sensor.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1523
    ].
1749
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1524
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1525
    sensor isNil ifTrue:[
1749
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1526
        "no window (yet or any longer)"
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1527
        someone perform:selector withArguments:argList.
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1528
        ^ self.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1529
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1530
1749
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1531
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
  1532
    "/
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1533
    "/ if such a message is already in the queue, ignore it.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1534
    "/ Otherwise push it as an event, to be handled when my thread is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1535
    "/ back in the event loop.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1536
    "/
1749
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1537
    sensor synchronized:[
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1538
        (sensor hasEvent:selector for:someone withArguments:argList) ifFalse:[
1669
6130b670c22e must enqueue messages with protection;
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1539
            sensor pushUserEvent:selector for:someone withArguments:argList
6130b670c22e must enqueue messages with protection;
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1540
        ].
1749
1f58fbcd4b96 Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents: 1742
diff changeset
  1541
    ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1542
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1543
    "Modified: / 5.2.2000 / 00:01:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1544
    "Created: / 26.2.2000 / 18:01:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1545
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1546
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1547
!ApplicationModel methodsFor:'component manipulations'!
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
components:aSymbolOrArray do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1550
    "evaluate aBlock for all components listed aSymbolOrArray."
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
    |coll|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1553
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1554
    aSymbolOrArray isSymbol ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1555
        "/ a single components name
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1556
        coll := Array with:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1557
    ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1558
        coll := aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1559
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1560
    coll do:[:aSymbol |
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1561
        |component|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1562
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1563
        (component := self componentFor:aSymbol) isNil ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1564
            aBlock value:component
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1565
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1566
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1567
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1568
    "Modified: 26.3.1997 / 16:23:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1569
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1570
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1571
disable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1572
    "disable the components whose id's are aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1573
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1574
    self components:aSymbolOrArray do:[:comp | comp disable]
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
    "Modified: 14.2.1997 / 17:32:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1577
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1578
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1579
enable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1580
    "enables the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1581
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1582
    self components:aSymbolOrArray do:[:comp | comp enable]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1583
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1584
    "Modified: 14.2.1997 / 17:32:19 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1585
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1586
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1587
invalidate:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1588
    "invalidates the component(s) identified by aSymbolOrArray."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1589
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1590
    self components:aSymbolOrArray do:[:comp | comp invalidate]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1591
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1592
    "Modified: 14.2.1997 / 17:32:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1593
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1594
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1595
makeInvisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1596
    "makes the components whose id's are aSymbolOrArray invisible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1597
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1598
    self components:aSymbolOrArray do:[:comp | comp beInvisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1599
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1600
    "Modified: 14.2.1997 / 17:32:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1601
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1602
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1603
makeReadOnly:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1604
    "make all components identified by aSymbolOrArray read only
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1605
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1606
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1607
    self components:aSymbolOrArray do:[:comp | comp readOnly:true]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1608
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1609
    "Modified: 14.2.1997 / 17:36:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1610
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1611
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1612
makeVisible:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1613
    "makes the components whose id's are aSymbolOrArray visible"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1614
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1615
    self components:aSymbolOrArray do:[:comp | comp beVisible]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1616
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1617
    "Modified: 14.2.1997 / 17:32:52 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1618
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1619
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1620
makeWritable:aSymbolOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1621
    "make all components identified by aSymbolOrArray writable 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1622
     (for editText components)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1623
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1624
    self components:aSymbolOrArray do:[:comp | comp readOnly:false]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1625
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1626
    "Created: 14.2.1997 / 17:36:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1627
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1628
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1629
!ApplicationModel methodsFor:'copying'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1630
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1631
postCopy
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1632
    builder := device := nil.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1633
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1634
    "Created: / 19.4.1998 / 11:44:44 / cg"
2053
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1635
!
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1636
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1637
postDeepCopy
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1638
    builder := device := nil.
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1639
e7f68dd56f48 +postDeepCopy
Claus Gittinger <cg@exept.de>
parents: 2038
diff changeset
  1640
    "Created: / 19.4.1998 / 11:44:44 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1641
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1642
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1643
!ApplicationModel methodsFor:'drag & drop'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1644
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1645
canDropObjects:aCollectionOfDropObjects in:aComponent
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1646
    "drop manager asked if a drop is possible
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1647
     - 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
  1648
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1649
    ^ false
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1650
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1651
    "Created: / 13-10-2006 / 15:52:31 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1652
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1653
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1654
canDropObjects:aCollectionOfDropObjects in:aComponent at:position
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1655
    "drop manager asked if a drop is possible
2252
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1656
     Chould be redefined by apps which can do it, to return true"
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1657
2261
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1658
    ^ self canDropObjects:aCollectionOfDropObjects in:aComponent
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1659
25a636384201 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  1660
    "Created: / 13-10-2006 / 15:52:20 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1661
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1662
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1663
dropObjects:aCollectionOfDropObjects in:aComponent
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1664
    "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
  1665
     This is ony sent, if #canDrop: returned true.
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1666
     Must be redefine in order for drop to work."
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1667
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1668
    self subclassResponsibility
c7cf598af103 drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents: 2211
diff changeset
  1669
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1670
    "Created: / 13-10-2006 / 18:25:06 / cg"
2079
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1671
!
b19b3d341c87 drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2071
diff changeset
  1672
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1673
dropObjects:aCollectionOfDropObjects in:aComponent at:aPoint
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1674
    "drop manager wants to drop.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1675
     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
  1676
     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
  1677
2262
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1678
    self dropObjects:aCollectionOfDropObjects in:aComponent
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1679
fc7b2c2f73bd drag and drop cleanup
Claus Gittinger <cg@exept.de>
parents: 2261
diff changeset
  1680
    "Created: / 13-10-2006 / 18:25:13 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1681
! !
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
!ApplicationModel methodsFor:'easy bindings'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1684
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1685
registerInterestIn:aValueModel using:aSelectorOrArray
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1686
    "Register interest in a change in aValueModel using information in aSelectorOrArray.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1687
     aSelectorOrArray can be one of three things:  
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1688
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1689
            1) nil                  in which case no interest is registered
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1690
            2) a selector           in which case the receiver is understood to be self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1691
            3) an Array             in which case the size is two where the first element is the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1692
                                    message to be sent and the second element is the receiver."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1693
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1694
    aSelectorOrArray isNil ifTrue:[^ aValueModel].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1695
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1696
    (aSelectorOrArray isArray) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1697
        aValueModel onChangeSend:(aSelectorOrArray at:1) to:(aSelectorOrArray at:2)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1698
    ] ifFalse: [
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1699
        aValueModel onChangeSend:aSelectorOrArray to:self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1700
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1701
    ^aValueModel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1702
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1703
    "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
  1704
!
3764f680134d allow subclass to redefine subCanvas-pre/postBuilds;
Claus Gittinger <cg@exept.de>
parents: 978
diff changeset
  1705
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1706
valueHolderFor:aSelector initialValue:anObject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1707
    "Return a ValueHolder on anObject." 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1708
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1709
    ^ self valueHolderFor:aSelector initialValue:anObject changeMessage:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1710
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1711
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1712
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1713
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1714
valueHolderFor:aSelector initialValue:anObject changeMessage:aSelectorOrArrayOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1715
    "Return a ValueHolder on anObject.  aSelectorOrArrayOrNil is the change information 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1716
     for the ValueHolder.  This argument is either a Symbol or an Array of two elements.  
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1717
     If it is a Symbol, then it is the change message and the interested object is understood
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1718
     to be the reciever.  If it is an Array, then the first element is the change message and 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1719
     the second element is the interested object. " 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1720
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1721
    |holder|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1722
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1723
    (builder bindings includesKey:aSelector) ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1724
        holder := ValueHolder with:anObject.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1725
        builder aspectAt:aSelector put:holder.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1726
        aSelectorOrArrayOrNil notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1727
            ^ self registerInterestIn:holder using:aSelectorOrArrayOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1728
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1729
        ^ holder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1730
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1731
    ^ builder aspectAt:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1732
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1733
    "Modified: / 21.5.1998 / 03:31:28 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1734
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1735
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1736
!ApplicationModel methodsFor:'forced actions'!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1737
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1738
doAcceptByReturnKey
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1739
    |acceptAction|
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1740
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1741
    builder notNil ifTrue:[
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1742
        acceptAction := builder bindingAt:#doAccept.
2009
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1743
    ].
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1744
    acceptAction notNil ifTrue:[
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1745
        acceptAction value
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1746
    ] ifFalse:[
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1747
        self doAccept
cb68fe9cdb72 care for accept-binding, when closing via return key
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
  1748
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1749
!
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1750
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1751
doCancelByEscapeKey
2010
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1752
    |cancelAction|
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1753
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1754
    builder notNil ifTrue:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1755
        cancelAction := builder bindingAt:#doCancel.
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1756
    ].
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1757
    cancelAction notNil ifTrue:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1758
        cancelAction value
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1759
    ] ifFalse:[
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1760
        self doCancel
056f10fc00cd accept & cancelActions
Claus Gittinger <cg@exept.de>
parents: 2009
diff changeset
  1761
    ]
1880
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1762
! !
064c4f74b8e8 doAcceptByReturnKey and doCancelByEscapeKey pushed up from
james
parents: 1851
diff changeset
  1763
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1764
!ApplicationModel methodsFor:'help'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1765
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1766
aboutImage
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1767
    "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
  1768
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  1769
    ^ self class aboutImage
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1770
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1771
    "Modified: / 13.11.2001 / 12:32:44 / cg"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1772
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1773
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1774
aboutThisApplicationLabel
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1775
    "label for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1776
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  1777
    ^ self class aboutThisApplicationLabel
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1778
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1779
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1780
aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1781
    "text for an about box for this application."
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1782
1674
3000bc98f043 about stuff delegated to class
Claus Gittinger <cg@exept.de>
parents: 1670
diff changeset
  1783
    ^ self class aboutThisApplicationText
1526
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1784
!
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1785
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1786
openAboutThisApplication
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1787
    "opens an about box for this application.
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1788
     Can be specialized by redefining #aboutThisApplicationText
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1789
     and #aboutThisApplicationLabel"
02941e80a146 refactored aboutBox setup for easier subclassing
Claus Gittinger <cg@exept.de>
parents: 1523
diff changeset
  1790
1531
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1791
    Dialog
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1792
        about:(resources string:self aboutThisApplicationText)
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1793
        label:(resources string:self aboutThisApplicationLabel)
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1794
        icon:self aboutImage
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1795
fbd4aada038c openHelp support
Claus Gittinger <cg@exept.de>
parents: 1528
diff changeset
  1796
    "Modified: / 17.11.2001 / 23:05:52 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1797
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1798
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1799
openHelpViewOnFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1800
    "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
  1801
     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
  1802
     (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
  1803
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1804
    self withWaitCursorDo:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1805
        HTMLDocumentView openFullOnHelpFile:pathToHelpText
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1806
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1807
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1808
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1809
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1810
showActiveHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1811
    "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
  1812
     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
  1813
     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
  1814
     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
  1815
     Here, we accept the help text, and push an event into out own input
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1816
     queue, so that the help text will be displayed asyncronously by myself,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1817
     vis the #showHelp:for: method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1818
     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
  1819
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1820
    |wg mySensor|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1821
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1822
    self showingHelp ifFalse: [
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1823
        ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1824
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1825
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1826
"/    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1827
"/        (masterApplication showActiveHelp:aHelpText for:view) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1828
"/            ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1829
"/        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1830
"/    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1831
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1832
    "/ NEW: push it into the event queue, to have it displayed
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1833
    "/ syncronously with other events.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1834
    "/ (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
  1835
    "/  instead of occurring in the activeHelp context).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1836
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1837
    (wg := self windowGroup) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1838
        mySensor := wg sensor.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1839
        mySensor notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1840
            mySensor flushEventsFor:self withType:#showHelp:for:.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1841
            mySensor 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1842
                pushUserEvent:#showHelp:for: for:self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1843
                withArguments:(Array with:aHelpText with:view).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1844
            ^ true
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
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1847
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1848
    "/ mhmh - can this happen ?
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1849
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1850
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1851
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1852
    "Modified: / 21.8.1998 / 16:00:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1853
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1854
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1855
showHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1856
    "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
  1857
     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
  1858
     into some info label, or the windows title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1859
     Here, the help text is ignored."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1860
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1861
    masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1862
        masterApplication showHelp:aHelpText for:view
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1863
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1864
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1865
    "Modified: / 31.7.1998 / 19:13:59 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1866
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1867
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1868
showingHelp
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1869
    "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
  1870
     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
  1871
     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
  1872
     These should be redefined to put the help text into some info label,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1873
     or into the views title bar.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1874
     You may also redefine the showingHelp/showingHelp: methods, to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1875
     remember the flag setting."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1876
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1877
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1878
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1879
    "Modified: / 31.7.1998 / 17:55:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1880
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1881
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1882
!ApplicationModel methodsFor:'hooks'!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1883
2185
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1884
aboutToOpen:whichTopView
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1885
    "the topView is about to be opened.
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1886
     This is sent by whichTopView, right before its really open
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1887
     (i.e. finally visible)"
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1888
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1889
    self preOpenWith:builder
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1890
!
2c839e97a6e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2128
diff changeset
  1891
1991
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1892
commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1893
    "a common hook for postBuildWith: and postBuildAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1894
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1895
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1896
commonPostOpen
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1897
    "a common hook for postOpenWith: and postOpenAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1898
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1899
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1900
commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1901
    "a common hook for preBuildWith: and preBuildAsSubcanvasWith:."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1902
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1903
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1904
postApplicationProcessCreate:newProcess windowGroup:newGroup
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1905
    "this is sent whenever a new application is launched from this app, 
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1906
     which forks its own windowGroup process. Allows for process group management,
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1907
     or process-global exception handlers to be installed.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1908
     Nothing done here - to be redefined in concrete applications"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1909
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1910
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1911
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1912
postBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1913
    "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
  1914
     Can be redefined in subclasses for additional setup after
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1915
     the subcanvas view has been built, but not yet opened."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1916
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1917
    |sameApp|
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1918
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1919
    sameApp := aBuilder application == aBuilder window topView application.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1920
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1921
    "/ If I am opened as subcanvas in another application
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1922
    "/ then treat this like a regular open.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1923
    "/ otherwise ignore it.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1924
    sameApp ifFalse:[
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1925
        self postBuildWith:aBuilder.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1926
    ] ifTrue:[
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1927
        self commonPostBuild.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1928
    ].
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1929
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1930
    "Modified: / 8.7.1998 / 18:28:55 / cg"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1931
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1932
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1933
postBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1934
    "this is sent after an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1935
     Can be redefined in subclasses for additional setup after
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1936
     the view has been built, but not yet opened."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1937
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1938
    self commonPostBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1939
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1940
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1941
postOpenAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1942
    "this is sent after the applications window is opened inside another application.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1943
     Can be redefined in subclasses for actions after opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1944
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1945
    self commonPostOpen
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1946
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1947
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1948
postOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1949
    "this is sent after the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1950
     Can be redefined in subclasses for actions after opening the view."
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1951
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1952
    self commonPostOpen
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1953
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1954
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1955
preBuildAsSubcanvasWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1956
    "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
  1957
     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
  1958
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1959
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1960
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1961
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1962
preBuildWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1963
    "this is sent before an interface is built from a spec.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1964
     Can be redefined in subclasses.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1965
     mhmh - what should this do here ?"
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1966
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1967
    self commonPreBuild
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1968
!
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1969
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1970
preOpenWith:aBuilder
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1971
    "this is sent before the applications main window is opened.
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1972
     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
  1973
! !
b74357a16333 commonPostBuild and commonPostOpen.
Claus Gittinger <cg@exept.de>
parents: 1988
diff changeset
  1974
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1975
!ApplicationModel methodsFor:'initialization'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1976
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1977
addTopViewsToCurrentProject
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1978
    "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
  1979
     This allows hiding views on a per-project basis.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1980
     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
  1981
     (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
  1982
1972
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1983
    |wg|
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1984
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1985
    (wg := self windowGroup) notNil ifTrue:[
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1986
        (wg topViews ? #()) do:[:aView |
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1987
            aView addToCurrentProject
952de474cb7f *** empty log message ***
werner
parents: 1968
diff changeset
  1988
        ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1989
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1990
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1991
    "Modified: 17.1.1997 / 19:43:39 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1992
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1993
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1994
basicInitialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1995
    "initialize the application.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1996
     Since ST-80 applications seem commonly to redefine #initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1997
     without doing a super initialize, the real initialization is
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1998
     done here ..."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  1999
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2000
    self initializeDevice.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2001
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2002
    "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
  2003
     builder till later, to allow setting to another builder.
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2004
     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
  2005
     creation, which might lead to trouble.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2006
     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
  2007
     late.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2008
     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
  2009
    "
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2010
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2011
"/    builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2012
"/    builder notNil ifTrue:[builder application:self].
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2013
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2014
    self initializeResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2015
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2016
    "Modified: / 13-09-2006 / 12:39:30 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2017
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2018
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2019
initialize
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2020
    "nothing done here;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2021
     but can be redefined in concrete applications"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2022
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2023
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2024
initializeDevice
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2025
    Screen notNil ifTrue:[
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2026
        device := Screen current.
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2027
    ]
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2028
!
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2029
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2030
initializeResources
2365
4050feaebfc2 slightly refactored for subclassability
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2031
    "initialize the applications resources (NLS support)."
2211
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2032
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2033
    resources := self class classResources.
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2034
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2035
    "Created: / 13-09-2006 / 12:39:22 / cg"
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2036
!
66b7109e72e6 better resource flushing support
Claus Gittinger <cg@exept.de>
parents: 2185
diff changeset
  2037
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2038
setDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2039
    "set the device (i.e. some Screen), where the application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2040
     shall open its view(s).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2041
     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
  2042
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2043
    device := aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2044
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2045
    "Created: 5.7.1996 / 12:01:40 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2046
    "Modified: 17.1.1997 / 19:44:09 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2047
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2048
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2049
!ApplicationModel methodsFor:'misc'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2050
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2051
information:aString
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2052
    "like Objects information, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2053
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2054
1699
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2055
    |s|
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2056
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2057
    resources isNil ifTrue:[
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2058
        "/ mhmh an early warning ...
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2059
        s := aString
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2060
    ] ifFalse:[
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2061
        s := resources string:aString
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2062
    ].
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2063
    super information:s withCRs
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2064
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2065
    "Created: / 20.5.1998 / 03:48:43 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2066
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2067
1699
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2068
notify:aString
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2069
    "like Objects notify, but translates the string via the
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2070
     resourcePack, thus giving a translated string automatically"
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2071
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2072
    |s|
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2073
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2074
    resources isNil ifTrue:[
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2075
        "/ mhmh an early warning ...
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2076
        s := aString
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2077
    ] ifFalse:[
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2078
        s := resources string:aString
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2079
    ].
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2080
    super notify:s withCRs
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2081
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2082
    "Created: / 20.5.1998 / 01:14:52 / cg"
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2083
    "Modified: / 13.11.2001 / 20:10:12 / cg"
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2084
!
f196e6667c23 Add #notify (similar to #information:)
Stefan Vogel <sv@exept.de>
parents: 1674
diff changeset
  2085
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2086
restoreCursors
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2087
    "restore the original cursors in all of my views"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2088
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2089
    ^ self window windowGroup restoreCursors
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2090
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2091
    "Created: 1.6.1996 / 17:01:24 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2094
showCursor:aCursor
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2095
    "set all of my views cursor to aCursor.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2096
     It can be restored with #restoreCursor."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2097
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2098
    ^ self window windowGroup showCursor:aCursor
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2099
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2100
    "Created: 1.6.1996 / 17:01:09 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2103
warn:aString
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2104
    "like Objects warn, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2105
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2106
1527
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2107
    |s|
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2108
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2109
    resources isNil ifTrue:[
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2110
        "/ mhmh an early warning ...
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2111
        s := aString
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2112
    ] ifFalse:[
2054
7ba59d01d49e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2053
diff changeset
  2113
        s := resources stringWithCRs:aString
1527
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2114
    ].
2054
7ba59d01d49e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2053
diff changeset
  2115
    super warn:s
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2116
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2117
    "Created: / 20.5.1998 / 01:14:52 / cg"
1527
f21dbafe8c3a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  2118
    "Modified: / 13.11.2001 / 20:10:12 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2119
!
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
warn:aString with:arg
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2122
    "like Objects warn, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2123
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2124
2115
7a2635f26e59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2106
diff changeset
  2125
    super warn:(resources stringWithCRs:aString with:arg)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2126
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2127
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2128
warn:aString with:arg1 with:arg2
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2129
    "like Objects warn, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2130
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2131
2054
7ba59d01d49e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2053
diff changeset
  2132
    super warn:(resources stringWithCRs:aString with:arg1 with:arg2)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2133
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2134
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2135
warn:aString with:arg1 with:arg2 with:arg3
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2136
    "like Objects warn, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2137
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2138
2054
7ba59d01d49e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2053
diff changeset
  2139
    super warn:(resources stringWithCRs:aString with:arg1 with:arg2 with:arg3)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2140
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2141
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2142
warn:aString with:arg1 with:arg2 with:arg3 with:arg4
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2143
    "like Objects warn, but translates the string via the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2144
     resourcePack, thus giving a translated string automatically"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2145
2054
7ba59d01d49e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2053
diff changeset
  2146
    super warn:(resources stringWithCRs:aString with:arg1 with:arg2 with:arg3 with:arg4)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2147
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2148
    "Created: / 23.2.2000 / 09:43:04 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2149
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2150
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2151
withCursor:aCursor do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2152
    "evaluate aBlock, showing aCursor in my topView and all of its subviews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2153
     Return the value of aBlock."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2154
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2155
    |w ret|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2156
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2157
    w := self window.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2158
    w notNil ifTrue:[
1886
6feb96c54cd9 withCursorDo:
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  2159
        ^ w topView withCursor:aCursor do:aBlock
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2160
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2161
    aCursor showWhile:[ret := aBlock value].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2162
    ^ ret.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2163
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2164
    "Modified: / 23.9.1998 / 17:00:25 / cg"
969
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2165
!
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2166
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2167
withExecuteCursorDo:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2168
    "evaluate aBlock, showing an executeCursor in my topView and all of its subviews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2169
     Return the value of aBlock."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2170
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2171
    ^ self withCursor:(Cursor execute) do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2172
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2173
    "Created: 14.12.1995 / 20:57:03 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2174
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2175
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2176
withReadCursorDo:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2177
    "evaluate aBlock, showing a readCursor in my topView and all of its subviews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2178
     Return the value of aBlock."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2179
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2180
    ^ self withCursor:(Cursor read) do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2181
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2182
    "Created: 14.12.1995 / 20:56:47 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2183
    "Modified: 14.12.1995 / 20:57:36 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2184
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2185
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2186
withWaitCursorDo:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2187
    "evaluate aBlock, showing a waitCursor in my topView and all of its subviews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2188
     Return the value of aBlock."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2189
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2190
    ^ self withCursor:Cursor wait do:aBlock
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2191
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2192
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2193
!ApplicationModel methodsFor:'opening'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2194
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2195
open
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2196
    "open a standard interface"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2197
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2198
    ^ self openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2199
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2200
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2201
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2202
1592
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2203
openAndWaitUntilVisible
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2204
    "open a standard interface, and wait until my window is visible"
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2205
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2206
    self open.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2207
    self window waitUntilVisible.
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2208
!
dd8fc50564c0 added #openAndWaitUntilVisible
Claus Gittinger <cg@exept.de>
parents: 1590
diff changeset
  2209
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2210
openAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2211
    "open a standard interface as slave, partner, dialog etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2212
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2213
    ^ self openInterfaceAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2214
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2215
    "Modified: 3.5.1996 / 13:39:15 / cg"
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2216
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2217
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2218
openAsSlave
1726
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2219
    "open a standard interface as slave.
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2220
     Notice: there is still a need to make the current window a master
53657643e254 comment
Claus Gittinger <cg@exept.de>
parents: 1724
diff changeset
  2221
        (see code and comments in WindowBuilder >> openAt:withExtent:andType:)"
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2222
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2223
    ^ self openAs:#slave
1724
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2224
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2225
    "
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2226
     WorkspaceApplication new openAsSlave.
936df52c6c04 comment
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2227
    "
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2228
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2229
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2230
openAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2231
    "open a standard interface at some point"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2232
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2233
    ^ self openInterfaceAt:aPoint
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2234
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2235
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2236
    "Created: 14.2.1997 / 20:17:41 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2237
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2238
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2239
openDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2240
    "open the window - assumes that the builder has already setup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2241
     the interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2242
2038
b66ff6d8c24d windowType
Claus Gittinger <cg@exept.de>
parents: 2027
diff changeset
  2243
    self window beToolDialog.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2244
    ^ builder openDialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2245
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2246
    "Modified: 14.2.1997 / 20:32:52 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2247
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2248
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2249
openDialogInterface:aSelector
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2250
    "open a dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2251
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2252
    ^ self openDialogInterface:aSelector withBindings:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2253
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2254
    "Modified: 28.2.1997 / 14:08:01 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2255
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2256
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2257
openDialogInterface:aSelector withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2258
    "open a dialog, given a spec-selector"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2259
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2260
    ^ SimpleDialog new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2261
        openFor:self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2262
        interface:aSelector 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2263
        withBindings:bindings
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
    "Created: / 28.2.1997 / 14:07:45 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2266
    "Modified: / 23.1.1998 / 18:18:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2267
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2268
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2269
openDialogInterfaceSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2270
    "open a dialog, given a spec"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2271
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2272
    ^ SimpleDialog new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2273
        openFor:self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2274
        interfaceSpec:aSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2275
        withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2276
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2277
    "Created: / 28.2.1997 / 14:07:45 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2278
    "Modified: / 23.1.1998 / 18:18:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2279
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2280
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2281
openDialogSpec:aSpec withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2282
    "open a dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2283
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2284
    ^ SimpleDialog new 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2285
        openFor:self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2286
        spec:aSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2287
        withBindings:bindings
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2288
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2289
    "Modified: / 23.1.1998 / 18:18:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2290
    "Created: / 20.5.1998 / 20:27:56 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2291
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2292
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2293
openInterface
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2294
    "open a standard interface.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2295
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2296
     Subclasses which do not have an interfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2297
     should redefine this method and create & open their view(s) there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2298
     (see Launcher as an example)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2299
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2300
    ^ self openInterface:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2301
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2302
    "Modified: / 9.9.1996 / 22:39:23 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2303
    "Modified: / 23.1.1998 / 18:16:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2304
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2305
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2306
openInterface:aSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2307
    "open a specific interface. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2308
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2309
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2310
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2311
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2312
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2313
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2314
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2315
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2316
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2317
    ^ builder
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
    "Modified: 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2320
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2321
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2322
openInterface:aSymbol as:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2323
    "open a specific interface. 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2324
     The argument, aSymbol specifies which interface. 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2325
     The concrete application subclass must provide a method with that name,
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2326
     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
  2327
     Typically, applications only use one interface, returned by the #windowSpec method.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2328
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2329
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2330
    self allButOpenInterface:aSymbol.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2331
    self openWindowAs:windowType.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2332
    ^ builder
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2333
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2334
    "Modified: 14.2.1997 / 20:25:33 / cg"
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2335
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2336
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2337
openInterface:aSymbol at:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2338
    "open a specific interface. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2339
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2340
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2341
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2342
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2343
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2344
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2345
     returned by the #windowSpec method."
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
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2348
    self openWindowAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2349
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2350
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2351
    "Created: 14.2.1997 / 20:19:44 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2352
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2353
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2354
openInterfaceAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2355
    "open a standard interface.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2356
     The windowType can be any of #slave, #partner, #dialog, #popUp etc.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2357
     Subclasses which do not have an interfaceSpec 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2358
     should redefine this method and create & open their view(s) there.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2359
     (see Launcher as an example)."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2360
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2361
    ^ self openInterface:(self defaultWindowSpecName) as:windowType
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2362
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2363
    "Modified: / 9.9.1996 / 22:39:23 / stefan"
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2364
    "Modified: / 23.1.1998 / 18:16:50 / cg"
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2365
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2366
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2367
openInterfaceAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2368
    "open a standard interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2369
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2370
    ^ self openInterface:(self defaultWindowSpecName) at:aLocation
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2371
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2372
    "Created: / 14.2.1997 / 20:18:20 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2373
    "Modified: / 23.1.1998 / 18:17:13 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2374
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2375
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2376
openInterfaceModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2377
    "open a standard interface as a modal dialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2378
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2379
     Subclasses which do not have an interfaceSpec 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2380
     should redefine this method and create & open their view(s) there.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2381
     (see Launcher as an example)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2382
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2383
    ^ self openInterfaceModal:(self defaultWindowSpecName)
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2384
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2385
    "Modified: / 9.9.1996 / 22:39:23 / stefan"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2386
    "Modified: / 23.1.1998 / 18:17:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2387
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2388
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2389
openInterfaceModal:aSymbol
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2390
    "open a specific interface as a modal dialog. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2391
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2392
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2393
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2394
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2395
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2396
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2397
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2398
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2399
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2400
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2401
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2402
    "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
  2403
!
ac96df5a2f97 oops - had to undo some error-handling stuff.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
  2404
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2405
openInterfaceModal:aSymbol at:location
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2406
    "open a specific interface modal at some screen location. 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2407
     The argument, aSymbol specifies which interface. The concrete
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2408
     application subclass must provide a method with that name,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2409
     which must return an interfaceSpec. This is forwarded to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2410
     the builder to create the views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2411
     Typically, applications only use one interface, 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2412
     returned by the #windowSpec method."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2413
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2414
    self allButOpenInterface:aSymbol.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2415
    self openWindowModalAt:location.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2416
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2417
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2418
    "Modified: 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2419
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2420
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2421
openModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2422
    "open a standard interface as a modal dialog"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2423
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2424
    ^ self openInterfaceModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2425
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2426
    "Modified: 3.5.1996 / 13:39:15 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2427
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2428
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2429
openOnDevice:aDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2430
    "open a standard interface on some other device"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2431
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2432
    self setDevice:aDevice.
1444
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2433
    Screen currentScreenQuerySignal answer:aDevice
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2434
    do:[
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2435
        ^ self open
e6aa4a0dc713 openOnDevice fixed
Claus Gittinger <cg@exept.de>
parents: 1442
diff changeset
  2436
    ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2437
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2438
    "Created: 13.1.1997 / 21:24:11 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2439
    "Modified: 13.1.1997 / 21:24:30 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2440
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2441
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2442
openSpec:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2443
    "open a view as specified in anInterfaceSpec."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2444
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2445
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2446
    self openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2447
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2448
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2449
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2450
    "Created: / 20.5.1998 / 20:08:51 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2453
openSpecModal:anInterfaceSpec
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2454
    "open an interface spec modal"
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
    self allButOpenFrom:anInterfaceSpec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2457
    self openWindowModal.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2458
    ^ builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2459
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2460
    "Modified: / 14.2.1997 / 20:25:33 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2461
    "Created: / 20.5.1998 / 20:20:21 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2462
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2463
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2464
openWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2465
    "open the window - assumes that the builder has already setup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2466
     the interface."
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
    builder openWindow.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2469
2270
a7c797806d46 correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  2470
    "Created: / 14-02-1997 / 20:20:39 / cg"
a7c797806d46 correctly restore the application after building a sub-app
Claus Gittinger <cg@exept.de>
parents: 2262
diff changeset
  2471
    "Modified: / 27-10-2006 / 11:49:00 / cg"
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
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2474
openWindowAs:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2475
    "open the window - assumes that the builder has already setup the interface. 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2476
     The windowType can be any of #slave, #partner, #dialog, #popUp etc."
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2477
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2478
    builder openAt:nil withExtent:nil andType:windowType
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2479
!
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1633
diff changeset
  2480
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2481
openWindowAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2482
    "open the window - assumes that the builder has already setup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2483
     the interface."
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
    builder openWindowAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2486
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2487
    "Created: 14.2.1997 / 20:20:55 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2488
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2489
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2490
openWindowAtCenter
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2491
    "open the window centered on the screen
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2492
     - assumes that the builder has already setup the interface."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2493
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2494
    builder openWindowAt:#center
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
    "Created: 14.2.1997 / 20:20:55 / cg"
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2499
openWindowModal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2500
    "open the window - assumes that the builder has already setup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2501
     the interface."
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
"/    builder openDialog.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2504
    builder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2505
        openAt:nil 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2506
        withExtent:nil 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2507
        andType:#dialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2508
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2509
    "Created: 14.2.1997 / 20:20:39 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2510
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2511
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2512
openWindowModalAt:aLocation
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2513
    "open the window modal - assumes that the builder has already setup
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2514
     the interface."
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
    builder openDialogAt:aLocation.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2517
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2518
    "Created: 14.2.1997 / 20:20:55 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2519
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2520
1478
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2521
openWithExtent:extPoint
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2522
    "open a standard interface with given extent"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2523
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2524
    |bldr|
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2525
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2526
    bldr := self allButOpen.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2527
    bldr openWithExtent:extPoint.
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2528
    ^ bldr
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2529
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2530
    "Modified: 3.5.1996 / 13:39:15 / cg"
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2531
!
b3bc19d6369f added #openWithExtent:
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  2532
1968
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2533
opened:whichTopView
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2534
    "the topView has been opened.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2535
     This is sent by whichTopView, when its really open
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2536
     (i.e. finally visible)"
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2537
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2538
    self addTopViewsToCurrentProject.
db226632c208 preOpenWith hook
Claus Gittinger <cg@exept.de>
parents: 1965
diff changeset
  2539
    self postOpenWith:builder
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2540
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2541
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2542
!ApplicationModel methodsFor:'opening-webInterface'!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2543
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2544
defineInterface
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2545
    "define a standard interface.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2546
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2547
     Subclasses which do not have an interfaceSpec 
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2548
     should redefine this method and create their page there."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2549
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2550
    ^ self defineInterface:(self defaultPageSpecName)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2551
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2552
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2553
defineInterface:aSpecSymbol
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2554
    "define an interface."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2555
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2556
    ^ self defineInterfaceFrom:(self interfaceSpecFor:aSpecSymbol)
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2557
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2558
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2559
defineInterfaceFrom:aSpec
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2560
    "define an interface (setup a page), given a spec."
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2561
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2562
    |page|
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2563
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2564
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2565
        self createWebBuilder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2566
    ].
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2567
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2568
    self preBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2569
    builder buildPageFromSpec:aSpec.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2570
    page := builder page.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2571
    page application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2572
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2573
    self postBuildWith:builder.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2574
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2575
    "Modified: / 19.6.1998 / 03:35:31 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2576
! !
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2577
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2578
!ApplicationModel methodsFor:'private'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2579
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2580
builderClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2581
    "return the UIBuilder class for me.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2582
     This method can be redefined if (eventually) there are
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2583
     spec readers for other UI languages (motif UIL ?)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2584
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2585
    ^ UIBuilder
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2586
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2587
    "Created: / 19.6.1998 / 01:39:26 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2588
    "Modified: / 19.6.1998 / 01:45:24 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2589
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2590
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2591
createBuilder
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  2592
    "create a WindowBuilder if not already present"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  2593
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2594
    builder isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2595
        builder := self builderClass new.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2596
        builder application:self.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2597
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2598
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2599
    "Created: / 19.6.1998 / 03:32:37 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2600
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2601
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2602
createWebBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2603
    "create a Web-UIBuilder if not already present"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2604
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2605
    builder isNil ifTrue:[
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2606
        builder := self webBuilderClass new.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2607
        builder application:self.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2608
    ]
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2609
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2610
    "Created: / 19.6.1998 / 03:32:37 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2611
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2612
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2613
webBuilderClass
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2614
    "return the UIBuilder class for me.
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2615
     This method can be redefined if (eventually) there are
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2616
     spec readers for other UI languages (motif UIL ?)"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2617
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2618
    ^ WebPageBuilder
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2619
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2620
    "Created: / 19.6.1998 / 01:39:26 / cg"
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2621
    "Modified: / 19.6.1998 / 01:45:24 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2622
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2623
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2624
!ApplicationModel methodsFor:'queries'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2625
1985
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2626
defaultWindowSpecName
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2627
    ^ #windowSpec
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2628
!
3bf95590d25c defaultWindowSpec-name redefinable
martin
parents: 1977
diff changeset
  2629
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2630
defaultWindowType
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2631
    "Applications come up non-modal, by default"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2632
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2633
    ^ #normal
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2634
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2635
    "Created: 17.1.1997 / 19:57:34 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2636
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2637
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2638
graphicsDevice
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2639
    "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
  2640
     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
  2641
     active screen."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2642
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2643
    ^ device
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2644
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2645
    "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
  2646
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  2647
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2648
interfaceSpecFor:aSelectorOrSpec
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2649
    "return an interface spec.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2650
     Here, the query is forwarded to my class.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2651
     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
  2652
2373
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2653
    aSelectorOrSpec isSymbol ifFalse:[     
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2654
        (aSelectorOrSpec isKindOf:UISpecification) ifTrue:[^ aSelectorOrSpec].
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2655
    ].
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2656
    ^ self class interfaceSpecFor:aSelectorOrSpec
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2657
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2658
    "Created: / 25-01-1998 / 19:45:12 / cg"
e5084459299c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2370
diff changeset
  2659
    "Modified: / 14-01-2008 / 17:54:29 / cg"
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2660
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2661
1481
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2662
isOpen
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2663
   "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
  2664
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2665
   |win|
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2666
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2667
   ^ (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
  2668
!
e1922b505268 Define #isOpen to check wether an application has an open window.
Stefan Vogel <sv@exept.de>
parents: 1479
diff changeset
  2669
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2670
processName
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2671
    "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
  2672
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2673
    self class == ApplicationModel ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2674
        ^ 'Application'
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2675
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2676
    ^ self class nameWithoutPrefix
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2677
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2678
    "Modified: / 4.12.1997 / 12:39:14 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2679
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2680
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2681
resolveClassNamed:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2682
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  2683
     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
  2684
     current namespace and finally in Smalltalk
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2685
    "
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2686
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2687
    ^ Smalltalk resolveName:something inClass:aClass.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2688
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2689
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2690
resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2691
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  2692
     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
  2693
     current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2694
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2695
    ^ self resolveName:something inClass:self class
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2696
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2697
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2698
resolveName:something inClass:aClass
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2699
    "return the class from something, a class, symbol, string or nil.
1548
3fde64e5dc4d comments (english)
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
  2700
     first we are looking in the namespace of the application, 
2099
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2701
     then in the current namespace and finally in Smalltalk"
306e2edb75bf code cleanup & refactoring
Claus Gittinger <cg@exept.de>
parents: 2095
diff changeset
  2702
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2703
    |cls|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2704
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2705
    aClass notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2706
        (cls := Smalltalk resolveName:something inClass:aClass) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2707
            ^ cls
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2708
        ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2709
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2710
        masterApplication notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2711
            ^ masterApplication resolveName:something
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2712
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2713
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2714
    ^ nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2715
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2716
2380
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2717
selfResponsibleFor:aKey
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2718
    "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
  2719
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2720
    ^ (aKey isNil or:[masterApplication isNil or:[self respondsTo:aKey]])
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2721
!
26b812badb1e some webstuff moved to here
Claus Gittinger <cg@exept.de>
parents: 2373
diff changeset
  2722
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2723
topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2724
    "return the top-master application"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2725
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2726
    masterApplication isNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2727
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2728
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2729
    ^ masterApplication topApplication
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2730
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2731
    "Created: / 6.6.1998 / 19:40:42 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2732
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2733
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1750
diff changeset
  2734
!ApplicationModel methodsFor:'startup & release'!
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2735
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2736
applicationWindowClass
1431
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  2737
    "return the class used for my (top-) windows"
3a37c00e9c21 comments added
Claus Gittinger <cg@exept.de>
parents: 1427
diff changeset
  2738
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2739
    ^ ApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2740
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2741
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2742
close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2743
    "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
  2744
     by the program (not by the windowManager).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2745
     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
  2746
     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
  2747
     Could be redefined in subclasses."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2748
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2749
    self closeDownViews
1132
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  2750
!
b801d744051b kludge & hook to allow modeless appModels to
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
  2751
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2752
closeDownViews
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2753
    "close down the applications view(s)"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2754
1700
9046f3e96a4f Remove unused method vars
Stefan Vogel <sv@exept.de>
parents: 1699
diff changeset
  2755
    |wg wgProcess|
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2756
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2757
    self release.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2758
    ActiveHelp stopFor:self.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2759
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2760
    (wg := self windowGroup) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2761
        wgProcess := wg process.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2762
        (Processor activeProcess ~~ wgProcess
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2763
        and:[wgProcess notNil]) ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2764
            wgProcess terminate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2765
        ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2766
            wg closeDownViews.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2767
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2768
    ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2769
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2770
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2771
closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2772
    "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
  2773
     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
  2774
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2775
    |sav window|
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2776
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2777
    window := self window.
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2778
    window isNil ifTrue:[
1461
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2779
        'ApplicationModel [warning]: oops - closeRequest for non-view application arrived' infoPrintCR.
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2780
        ^ self
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2781
    ].
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2782
1831
766f0b3cd453 not ifTrue -> ifFalse
Claus Gittinger <cg@exept.de>
parents: 1828
diff changeset
  2783
    window isTopView ifFalse:[
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2784
        window topView isModal ifTrue:[
1461
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2785
            WindowGroup leaveSignal raise.
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2786
        ].
f3ad0001d240 fixed: raise leaveSignal in closeRequest for a modal opened view
tm
parents: 1454
diff changeset
  2787
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2788
        'ApplicationModel [warning]: oops - closeRequest for non-TopView arrived' infoPrintCR.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2789
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2790
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2791
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2792
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2793
    "/ (but not if I am a modal reincarnation)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2794
    (masterApplication notNil 
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2795
    and:[window isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2796
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2797
        "/ temporary clear my masterApplication to prevent
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2798
        "/ endless recursion, in case the master sends me
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2799
        "/ a closeRequest (although, it is supposed to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2800
        "/ send me a closeDownViews ...)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2801
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2802
        sav := masterApplication.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2803
        masterApplication := nil.
1528
a41738a52186 *** empty log message ***
penk
parents: 1527
diff changeset
  2804
        sav closeRequestFor:window.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2805
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2806
        "/ restore - in case master did not want me to close ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2807
        masterApplication := sav.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2808
    ] ifFalse:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2809
        "/ ST/X does close-check by redefining this message without
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2810
        "/ a supersend;
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2811
        "/ VW does it by returning false from requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2812
        "/ sigh.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2813
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2814
        self requestForWindowClose ifTrue:[
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2815
            window isSlave ifTrue:[
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2816
                window destroy
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2817
            ] ifFalse:[
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2818
                self closeDownViews
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2819
            ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2820
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2821
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2822
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2823
    "Modified: / 19.6.1998 / 01:37:17 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2824
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2825
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2826
closeRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2827
    "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
  2828
     windowmanager. For backward compatibility with single-view applications,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2829
     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
  2830
     effectively closing all of my views.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2831
     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
  2832
     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
  2833
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2834
    |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
  2835
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2836
    myWindow := self window.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2837
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2838
    "/ In multiView apps, tell my master.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2839
    "/ (but not if I am a modal reincarnation)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2840
    (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
  2841
    and:[myWindow topView isModal not]) ifTrue:[
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2842
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2843
        "/ temporary clear my masterApplication to prevent
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2844
        "/ endless recursion, in case the master sends me
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2845
        "/ a closeRequest (although, it is supposed to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2846
        "/ send me a closeDownViews ...)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2847
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2848
        savedMaster := masterApplication.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2849
        masterApplication := nil.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2850
        aTopView isSlave ifTrue:[
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2851
            savedMaster closeRequestFor:aTopView.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2852
        ] ifFalse:[
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2853
            savedMaster closeRequestFor:myWindow.
1565
ea35a676f0b1 do not shutDown the whole app, if a slave is closing down.
Claus Gittinger <cg@exept.de>
parents: 1556
diff changeset
  2854
        ].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2855
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2856
        "/ restore - in case master did not want me to close ...
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2857
        masterApplication := savedMaster.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2858
        ^ self
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2859
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2860
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2861
    (aTopView == myWindow) ifTrue:[
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2862
        self closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2863
        ^ self
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2864
    ].
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2865
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2866
    (aTopView isPartner or:[aTopView isMaster]) ifTrue:[
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2867
        aTopView application closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2868
        self closeRequest.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2869
        ^ self.
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  2870
    ].
1924
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  2871
    aTopView isSlave ifTrue:[
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  2872
        aTopView closeRequest 
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  2873
    ] ifFalse:[
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  2874
        aTopView application closeRequest.
3c4b1baaf4a0 closeRequest for slaveViews
Claus Gittinger <cg@exept.de>
parents: 1886
diff changeset
  2875
    ]
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2876
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2877
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2878
doAccept
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2879
    "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
  2880
     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
  2881
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2882
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2883
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2884
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2885
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2886
    "/ 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
  2887
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2888
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2889
    "/ to remember the accept vs. cancel case.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2890
    "/
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2891
    self window isModal ifTrue:[
2128
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2892
        masterApplication notNil ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2893
            masterApplication window topView == self window topView ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2894
                masterApplication window isModal ifTrue:[
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2895
                    masterApplication doAccept.
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2896
                    ^ self.
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2897
                ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2898
            ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2899
        ].
4e5c9e1c12e5 doAccept in a subCanvas of a modal view
Claus Gittinger <cg@exept.de>
parents: 2115
diff changeset
  2900
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2901
        "/ mhmh - is this a good idea ?
1792
156a3d4e3b25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1781
diff changeset
  2902
        self perform:#accept ifNotUnderstood:[self closeRequest].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2903
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2904
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2905
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2906
    ^ self      "/ nothing done here ...
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2907
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2908
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2909
doCancel
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2910
    "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
  2911
     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
  2912
     opened modal (i.e. as a dialog)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2913
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2914
    "/ the following is a bad kludge -
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2915
    "/ actually, modal apps should inherit from SimpleDialog
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2916
    "/ (then, things would be clean)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2917
    "/ 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
  2918
    "/ modeless) as a modal one as well.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2919
    "/ In that, case, we have no acceptHolder (see SimpleDialog),
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2920
    "/ to remember the accept vs. cancel case.
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
  2921
    "/
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2922
    self window isModal ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2923
        "/ mhmh - is this a good idea ?
1792
156a3d4e3b25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1781
diff changeset
  2924
        self perform:#cancel ifNotUnderstood:[self closeRequest].
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2925
        ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2926
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2927
    ^ self      "/ nothing done here ...
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2930
releaseAsSubCanvas
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2931
    "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
  2932
     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
  2933
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2934
    "/ used to self release here,
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2935
    "/ but that is incompatible to VW (RefactoryBrowser).
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2936
    "/ Therefore, if you need it, you MUST now redefine
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2937
    "/ this method.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2938
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2939
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2940
restarted
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2941
    "sent by my topWindow, when restarted from an image.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2942
     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
  2943
     required to reset the application after an image-restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2944
     (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
  2945
      subprocesses etc.)."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2946
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2947
    "Modified: 1.6.1996 / 16:55:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2948
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2949
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2950
saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2951
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2952
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2953
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2954
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2955
    self closeRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2956
!
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
saveAndTerminateRequestFor:aTopView
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2959
    "some windowManagers send this to shut down an application
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2960
     and have it save its state for restart.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2961
     Can be redefined in subclasses"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2962
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2963
    self saveAndTerminateRequest
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2964
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2965
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2966
!ApplicationModel methodsFor:'window events'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2967
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2968
dispatchEvent:event
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2969
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2970
     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
  2971
     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
  2972
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2973
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2974
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2975
        withFocusOn:nil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2976
        delegate:true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2977
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2978
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2979
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2980
dispatchEvent:evType arguments:evArgs withFocusOn:focusView delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2981
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2982
     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
  2983
     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
  2984
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2985
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2986
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2987
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2988
    "Modified: / 20.6.1998 / 16:44:05 / cg"
1290
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  2989
!
e41570e2a01c always use the new #dispatchEvent methods
ca
parents: 1286
diff changeset
  2990
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2991
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
  2992
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2993
     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
  2994
     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
  2995
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2996
    self perform:evType withArguments:evArgs
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2997
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2998
    "Created: / 20.6.1998 / 16:36:54 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  2999
    "Modified: / 20.6.1998 / 16:44:05 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3000
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3001
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3002
dispatchEvent:event withFocusOn:focusViewOrNil 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3003
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3004
     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
  3005
     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
  3006
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3007
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3008
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3009
        withFocusOn:focusViewOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3010
        delegate:true
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
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3013
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3014
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3015
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3016
    "dispatch a user-pushed event.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3017
     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
  3018
     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
  3019
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3020
    ^ self 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3021
        dispatchEvent:event 
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3022
        type:event type
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3023
        arguments:(event arguments)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3024
        withFocusOn:focusViewOrNil
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3025
        delegate:doDelegate
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3026
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3027
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3028
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3029
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3030
noticeOfWindowClose:aWindow
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3031
    "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
  3032
     Can be redefined in subclasses for cleanup."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3033
1432
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3034
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3035
    self windowEvent:(#close -> aWindow) from:aWindow.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3036
    ^ self
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3037
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3038
    "Created: / 18.6.1998 / 18:56:31 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3039
    "Modified: / 18.6.1998 / 19:14:16 / cg"
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3040
!
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3041
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3042
noticeOfWindowOpen:aWindow
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3043
    "sent when a topView or applicationSubView has been opened.
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3044
     Can be redefined in subclasses."
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3045
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3046
    "/ ST-80 compatibility
6dc94e38fa8e postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents: 1431
diff changeset
  3047
    self windowEvent:(#open -> aWindow) from:aWindow.
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3048
    ^ self
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
    "Created: / 18.6.1998 / 18:56:31 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3051
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3052
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3053
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3054
requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3055
    "the applicationWindow wants to know, if a close
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3056
     is ok. Return false if not."
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3057
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3058
    |w k|
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3059
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3060
    builder notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3061
        (w := builder window) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3062
            (k := w keyboardProcessor) notNil ifTrue:[
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3063
                ^ k requestForWindowClose
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3064
            ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3065
        ]
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3066
    ].
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3067
    ^ true
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3068
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3069
    "Modified: / 18.6.1998 / 19:14:16 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3070
    "Created: / 19.6.1998 / 01:34:58 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3071
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3072
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3073
showActivity:someMessage
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3074
    "some activityNotification shalt be communicated to
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3075
     the user. Forwarded from the topView and ignored here.
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3076
     Can be redefined in concrete applications to show the
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3077
     message either in some infoView (infoLabel as in Windows)
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3078
     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
  3079
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3080
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3081
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3082
    "Created: 16.12.1995 / 18:41:04 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3083
    "Modified: 24.4.1996 / 09:34:22 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3084
!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3085
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3086
windowEvent:anEvent from:anApplicationWindow
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3087
    "dummy: windowEvent forwarding is not yet implemented"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3088
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3089
    ^ self
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3090
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3091
    "Modified: 24.4.1996 / 09:32:50 / cg"
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3092
! !
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3093
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3094
!ApplicationModel class methodsFor:'documentation'!
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3095
1417
810fdd94d742 Reading the header of a MP3 file.
martin
parents: 1414
diff changeset
  3096
version
2387
ef4a9559c9e6 Changes from Zürich: support symbolic colors in UISpecifications
Stefan Vogel <sv@exept.de>
parents: 2382
diff changeset
  3097
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.244 2008-02-25 10:21:55 stefan Exp $'
85
claus
parents: 83
diff changeset
  3098
! !
1633
07765ef65021 fix (kludge) for slaveApp, which have a masterApp,
Claus Gittinger <cg@exept.de>
parents: 1622
diff changeset
  3099
1419
3733848df42c back to 1.144 (martin !)
Claus Gittinger <cg@exept.de>
parents: 1418
diff changeset
  3100
ApplicationModel initialize!