WindowBuilder.st
author manfred
Mon, 29 Mar 1999 09:27:34 +0200
changeset 1151 c13863335d01
parent 1139 ab56c6dc429e
child 1155 e4408835f51b
permissions -rw-r--r--
- Fixes to avoid using '-' rules to ignore an exit status: -rm ... -> rm -f ... -mkdir ... -> test -d ... || mkdir ... ...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
89
claus
parents: 86
diff changeset
     1
"
claus
parents: 86
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
     3
              All Rights Reserved
89
claus
parents: 86
diff changeset
     4
claus
parents: 86
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    10
 hereby transferred.
claus
parents: 86
diff changeset
    11
"
claus
parents: 86
diff changeset
    12
100
claus
parents: 99
diff changeset
    13
Object subclass:#WindowBuilder
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    14
	instanceVariableNames:'window application bindings visuals labels focusSequence
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    15
		namedComponents helpKeys componentCreationHook applicationClass
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    16
		keyboardProcessor subCanvasSpecs'
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
    17
	classVariableNames:'StopOnError Verbose'
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
    18
	poolDictionaries:''
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
    19
	category:'Interface-Support-UI'
66
claus
parents:
diff changeset
    20
!
claus
parents:
diff changeset
    21
claus
parents:
diff changeset
    22
!WindowBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    23
89
claus
parents: 86
diff changeset
    24
copyright
claus
parents: 86
diff changeset
    25
"
claus
parents: 86
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
    27
              All Rights Reserved
89
claus
parents: 86
diff changeset
    28
claus
parents: 86
diff changeset
    29
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
    30
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
    32
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
    33
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    34
 hereby transferred.
claus
parents: 86
diff changeset
    35
"
claus
parents: 86
diff changeset
    36
!
claus
parents: 86
diff changeset
    37
66
claus
parents:
diff changeset
    38
documentation
claus
parents:
diff changeset
    39
"
69
claus
parents: 66
diff changeset
    40
    a no-op class, for systems which do not use the UIBuilder.
66
claus
parents:
diff changeset
    41
    Concrete subclasses know how to create a view (with components) from
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    42
    some interface spec.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    43
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    44
    The order of the lookup sequence to access an aspect is defined:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    45
        application
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    46
        application class
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    47
        additional  class (applicationClass).
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    48
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    49
    Methods to access any aspect are located in the category
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    50
    'spec creation aspect fetch'.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    51
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
    52
    Currently, an experimantal version of UIBuilder exists,
66
claus
parents:
diff changeset
    53
    and more may be added in the future (for example, to parse different UI
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
    54
    specs - thinking of motifs UIL specs, Windows DialogSpecs etc.).
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    55
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    56
    [instance variables:]
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    57
        window          <View>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    58
                                the topView into which the components
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    59
                                are (have been) created from the specification
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    60
                                
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    61
        application     <ApplicationModel>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    62
                                the application object (typically an instance
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    63
                                of a subclass of ApplicationModel).
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    64
                                That one is usually supposed to provide
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    65
                                valueHolders for aspects, action methods
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    66
                                menuSpecs and possibly more windowSpecs.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    67
                                Usually means, that most of those can also be
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    68
                                provided to the builder via a set of bindings,
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    69
                                which overrides those.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    70
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    71
        bindings        <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    72
                                can be set (or filled) with bindings for
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    73
                                aspects to be used when setting up the models
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    74
                                for components. Useful either to overwrite
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    75
                                corresponding appModel aspects or if the appModel
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    76
                                does not want to procide those.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    77
                                (for example, to open a dialog and provide the
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    78
                                 bindings in a dictionary - as opposed to
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    79
                                 providing them via aspect methods)
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    80
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    81
        visuals                 not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    82
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    83
        focusSequence   <Collection>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    84
                                maintained during the build process;
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    85
                                contains tabable components.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    86
                                This will be replaced by a more intelligent
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    87
                                mechanism in the near future.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    88
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    89
        namedComponents <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    90
                                contains name->component associations for
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    91
                                all components which have a non-nil component
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    92
                                name. Created during the build process.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    93
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    94
        helpKeys                not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    95
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    96
        componentCreationHook <BlockOrNil>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    97
                                can be set before the components are built
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    98
                                from the spec, to provide an arbitrary
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    99
                                callBacks-hook which will be invoked after
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   100
                                a component has been created from a spec. 
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   101
                                The UIPainter uses this to maintain its
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   102
                                component<->spec assiciations.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   103
                                Can be set by the app, to catch creation of
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   104
                                components and fiddle around during the
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   105
                                creation process (change extents, colors or whatever)
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   106
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   107
        applicationClass <ClassOrNil>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   108
                                can be set to provide an additional class which
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   109
                                is asked for aspects during the build process.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   110
                                If not set, the app is asked, which itself asks
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   111
                                its class.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   112
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   113
        keyboardProcessor       not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   114
                                Will eventually takeover the functionality
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   115
                                of the focusSequence, shortcuts & provide a hook
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   116
                                for the app.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   117
        
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   118
        subCanvasSpecs <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   119
                                can be set by the app to provide subcanvas
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   120
                                specs (much like the bindings dictionary)
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   121
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   122
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   123
        Claus Gittinger
66
claus
parents:
diff changeset
   124
"
claus
parents:
diff changeset
   125
! !
claus
parents:
diff changeset
   126
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   127
!WindowBuilder class methodsFor:'debugging'!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   128
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   129
stopOnError:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   130
    "enable/disable debug halt when aspects are missing.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   131
     Useful during development, to detect missing aspects.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   132
     The default is off."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   133
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   134
    StopOnError := aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   135
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   136
    "Modified: / 4.8.1998 / 19:40:09 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   137
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   138
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   139
verbose:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   140
    "enable/disable debug messages on the Transcript.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   141
     Useful during development, to detect missing aspects.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   142
     The default is off."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   143
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   144
    Verbose := aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   145
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   146
    "Created: / 4.8.1998 / 19:39:37 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   147
    "Modified: / 4.8.1998 / 19:40:14 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   148
! !
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   149
974
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   150
!WindowBuilder methodsFor:'ST-80 compatibility'!
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   151
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   152
source
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   153
    "same as #application, for ST-80 compatibility"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   154
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   155
    ^ application
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   156
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   157
    "Created: 17.1.1997 / 19:03:51 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   158
!
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   159
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   160
source:anApplicationModel
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   161
    "same as #application:, for ST-80 compatibility"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   162
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   163
    application := anApplicationModel
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   164
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   165
    "Modified: 17.1.1997 / 19:03:57 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   166
! !
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   167
66
claus
parents:
diff changeset
   168
!WindowBuilder methodsFor:'accessing'!
claus
parents:
diff changeset
   169
463
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   170
addBindings:moreBindings
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   171
    "used with subDialogs, which provide local bindings.
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   172
     All bindings from moreBindings overwrite any local bindings."
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   173
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   174
    moreBindings notNil ifTrue:[
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   175
        moreBindings keysAndValuesDo:[:aKey :aValue |
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   176
            bindings at:aKey put:aValue
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   177
        ]
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   178
    ]
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   179
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   180
    "Created: 28.2.1997 / 14:14:33 / cg"
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   181
!
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   182
100
claus
parents: 99
diff changeset
   183
application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   184
    "return the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   185
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   186
     This one is supposed to provide the aspects, menus etc."
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   187
100
claus
parents: 99
diff changeset
   188
    ^ application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   189
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   190
    "Modified: 17.1.1997 / 19:04:40 / cg"
66
claus
parents:
diff changeset
   191
!
claus
parents:
diff changeset
   192
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   193
application:anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   194
    "set the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   195
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   196
     This one is supposed to provide the aspects, menus etc."
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   197
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   198
    application := anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   199
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   200
    "Modified: 17.1.1997 / 19:04:47 / cg"
66
claus
parents:
diff changeset
   201
!
claus
parents:
diff changeset
   202
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   203
applicationClass:something
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   204
    "set the value of the instance variable 'applicationClass' (automatically generated)"
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   205
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   206
    applicationClass := something.!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   207
66
claus
parents:
diff changeset
   208
aspectAt:aSymbol
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   209
    "return the aspect for a symbol or nil.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   210
    "
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   211
    ^ self 
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   212
        aspectAt:aSymbol 
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   213
        ifAbsent:[self aspectNotFound:aSymbol error:'no aspect for:']
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   214
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   215
    "Modified: / 4.8.1998 / 19:29:36 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   216
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   217
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   218
aspectAt:aSymbol ifAbsent:exceptionBlock
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   219
    "return the aspect for a symbol or the value from exceptionBlock.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   220
    "
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   221
    |b|
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   222
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   223
    aSymbol notNil ifTrue:[
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   224
        bindings notNil ifTrue:[
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   225
            b := bindings at:aSymbol ifAbsent:nil.
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   226
            b notNil ifTrue:[^ b].
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   227
        ].
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   228
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   229
        application notNil ifTrue:[
577
818d08c9aef1 add trace messages:
ca
parents: 502
diff changeset
   230
            Object messageNotUnderstoodSignal handle:[:ex |
727
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   231
                ex parameter selector == aSymbol ifFalse:[
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   232
                    ex reject
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   233
                ]
577
818d08c9aef1 add trace messages:
ca
parents: 502
diff changeset
   234
            ] do:[
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   235
                ^ application aspectFor:aSymbol
717
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   236
            ].
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   237
            Object messageNotUnderstoodSignal handle:[:ex |
727
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   238
                ex parameter selector == aSymbol ifFalse:[
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   239
                    ex reject
74603345637d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 717
diff changeset
   240
                ]
717
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   241
            ] do:[
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   242
                ^ application class aspectFor:aSymbol
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   243
            ].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   244
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   245
            ^ exceptionBlock value.
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   246
        ]
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   247
    ].
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   248
    ^ nil
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   249
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   250
    "Created: / 4.8.1998 / 19:28:30 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   251
    "Modified: / 4.8.1998 / 19:37:02 / cg"
66
claus
parents:
diff changeset
   252
!
claus
parents:
diff changeset
   253
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   254
aspectAt:aSymbol put:aModel
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   255
    "store an aspect identified by its symbol and its value
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   256
    "
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   257
    bindings isNil ifTrue:[
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   258
        bindings := IdentityDictionary new
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   259
    ].
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   260
    ^ bindings at:aSymbol put:aModel
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   261
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   262
    "Modified: 17.1.1997 / 19:28:37 / cg"
100
claus
parents: 99
diff changeset
   263
!
claus
parents: 99
diff changeset
   264
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   265
bindingAt:aSymbol
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   266
    "return the binding for a symbol or nil
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   267
    "
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   268
    bindings notNil ifTrue:[
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   269
        ^ bindings at:aSymbol ifAbsent:nil.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   270
    ].
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   271
    ^ nil
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   272
!
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   273
100
claus
parents: 99
diff changeset
   274
bindings
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   275
    "return my bindings
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   276
    "
100
claus
parents: 99
diff changeset
   277
    ^ bindings
claus
parents: 99
diff changeset
   278
!
claus
parents: 99
diff changeset
   279
claus
parents: 99
diff changeset
   280
bindings:aDictionary
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   281
    "set bindings to a dictionary
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   282
    "
100
claus
parents: 99
diff changeset
   283
    bindings := aDictionary
claus
parents: 99
diff changeset
   284
!
claus
parents: 99
diff changeset
   285
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   286
componentAt:name
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   287
    "return a component identified by its name.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   288
    "
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   289
    namedComponents isNil ifTrue:[^ nil].
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   290
    ^ namedComponents at:name asSymbol ifAbsent:nil
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   291
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   292
100
claus
parents: 99
diff changeset
   293
componentAt:name put:aComponent
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   294
    "store a component identified by its name.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   295
    "
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   296
    namedComponents isNil ifTrue:[
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   297
        namedComponents := IdentityDictionary new.
100
claus
parents: 99
diff changeset
   298
    ].
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   299
    namedComponents at:name asSymbol put:aComponent
100
claus
parents: 99
diff changeset
   300
!
claus
parents: 99
diff changeset
   301
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   302
componentCreationHook:something
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   303
    "set the value of the instance variable 'componentCreationHook' (automatically generated)"
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   304
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   305
    componentCreationHook := something.!
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   306
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   307
focusSequence 
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   308
    "return my focus sequence
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   309
    "
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   310
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   311
    focusSequence isNil ifTrue:[
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   312
        focusSequence := OrderedCollection new
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   313
    ].
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   314
    ^ focusSequence
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   315
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   316
    "Modified: / 12.3.1999 / 00:02:04 / cg"
66
claus
parents:
diff changeset
   317
!
claus
parents:
diff changeset
   318
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   319
helpKeyFor:aComponent
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   320
    "return the helpkey for a component or nil
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   321
    "
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   322
    |v key|
885bd39df8df access help key
ca
parents: 598
diff changeset
   323
885bd39df8df access help key
ca
parents: 598
diff changeset
   324
    helpKeys isNil ifTrue:[^ nil].
885bd39df8df access help key
ca
parents: 598
diff changeset
   325
    v := aComponent.
885bd39df8df access help key
ca
parents: 598
diff changeset
   326
    [v notNil] whileTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   327
        (key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   328
            ^ key
885bd39df8df access help key
ca
parents: 598
diff changeset
   329
        ].
885bd39df8df access help key
ca
parents: 598
diff changeset
   330
        v := v superView
885bd39df8df access help key
ca
parents: 598
diff changeset
   331
    ].
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   332
    ^ nil
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   333
!
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   334
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   335
helpKeyFor:aComponent put:aKey
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   336
    "assign a key for a component which is used to access the help text
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   337
     from the application.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   338
    "
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   339
    aKey isNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   340
        helpKeys isNil ifFalse:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   341
            helpKeys removeKey:aComponent ifAbsent:nil
885bd39df8df access help key
ca
parents: 598
diff changeset
   342
        ]
885bd39df8df access help key
ca
parents: 598
diff changeset
   343
    ] ifFalse:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   344
        helpKeys isNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   345
            helpKeys := IdentityDictionary new
885bd39df8df access help key
ca
parents: 598
diff changeset
   346
        ].
885bd39df8df access help key
ca
parents: 598
diff changeset
   347
        helpKeys at:aComponent put:aKey
885bd39df8df access help key
ca
parents: 598
diff changeset
   348
    ]
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   349
15d80dd3d974 help text
ca
parents: 587
diff changeset
   350
!
15d80dd3d974 help text
ca
parents: 587
diff changeset
   351
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   352
keyboardProcessor
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   353
    "return my keyboard processor
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   354
    "
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   355
    keyboardProcessor isNil ifTrue:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   356
        keyboardProcessor := KeyboardProcessor new    
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   357
    ].
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   358
    ^ keyboardProcessor
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   359
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   360
    "Created: 3.3.1997 / 18:31:37 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   361
    "Modified: 3.3.1997 / 18:32:27 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   362
!
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   363
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   364
keyboardProcessor:aKeyboardProcessor
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   365
    "set my keyboard processor
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   366
    "
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   367
    keyboardProcessor := aKeyboardProcessor
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   368
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   369
    "Created: / 18.6.1998 / 19:59:38 / cg"
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   370
!
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   371
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   372
labelAt:name
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   373
    labels isNil ifTrue:[^ nil].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   374
    ^ labels at:name asSymbol ifAbsent:nil
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   375
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   376
    "Created: / 27.2.1998 / 13:52:28 / cg"
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   377
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   378
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   379
labelAt:name put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   380
    labels isNil ifTrue:[
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   381
        labels := IdentityDictionary new.
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   382
    ].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   383
    labels at:name asSymbol put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   384
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   385
    "Created: / 27.2.1998 / 02:30:54 / cg"
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   386
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   387
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   388
menuAt:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   389
    "Find a binding for the menu named aKey, either in the bindings 
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   390
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   391
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   392
    ^ self menuFor:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   393
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   394
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   395
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   396
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   397
menuAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   398
    "add someMenuOrHolder as the binding for the menu named aSymbol to the bindings"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   399
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   400
    ^ self aspectAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   401
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   402
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   403
86
claus
parents: 80
diff changeset
   404
namedComponents
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   405
    "return list of named components
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   406
    "
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   407
    ^ namedComponents
86
claus
parents: 80
diff changeset
   408
!
claus
parents: 80
diff changeset
   409
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   410
subCanvasAt:majorKey at:minorKey
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   411
    "get the subCanvas or subSpec specification from major and minor key.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   412
     Here, we first look for a spec in the private subCanvasSpecs dictionary,
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   413
     which can be filled via #specificationAt:at:put: messages.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   414
     If not present, or none is found there, we bounce back trying
824
06de83e3fdee Fix comment.
Stefan Vogel <sv@exept.de>
parents: 774
diff changeset
   415
     #specificationFor: (if majorKey is nil) or by sending the minorKey
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   416
     message to the class named as majorKey.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   417
     Notice, that the class named majorKey is first searched in the
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   418
     application classes namespace - allowing private classes as majorKey.
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   419
    "
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   420
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   421
    |spec cls dict dkey|
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   422
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   423
    subCanvasSpecs notNil ifTrue:[
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   424
        dkey := majorKey ? #NoMajorKey.
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   425
        dict := subCanvasSpecs at:dkey ifAbsent:nil.
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   426
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   427
        dict notNil ifTrue:[
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   428
            spec := dict at:minorKey ifAbsent:nil.
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   429
            spec notNil ifTrue:[^ spec].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   430
        ].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   431
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   432
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   433
    majorKey isNil ifTrue:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   434
        ^ self specificationFor:minorKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   435
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   436
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   437
    application notNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   438
        "/ look for class in applications namespace ...
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   439
        cls := application resolveName:majorKey.
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   440
    ] ifFalse:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   441
        "/ fallBack - use that global, if it exists
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   442
        cls := Smalltalk at:majorKey.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   443
        cls isNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   444
            Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey).
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   445
        ].
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   446
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   447
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   448
    cls notNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   449
        Object messageNotUnderstoodSignal handle:[:ex|] do:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   450
            ^ cls specificationFor:minorKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   451
        ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   452
        Object messageNotUnderstoodSignal handle:[:ex|] do:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   453
            ^ cls perform:minorKey.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   454
        ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   455
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   456
    ^ nil
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   457
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   458
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   459
subCanvasAt:majorKey at:minorKey put:aSpec
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   460
    "deposit an interfaceSpecification for major and minor key
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   461
     in my private subCanvasSpecs dictionary.
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   462
     This will be used later, when building, 
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   463
     to provide an interfaceSpec for a subcanvas or subSpecification
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   464
     (or possibly override an application provided interfaceSpec).
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   465
     See #subCanvasAt:at:."
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   466
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   467
    |dict key|
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   468
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   469
    subCanvasSpecs isNil ifTrue:[
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   470
        "/ lazyly initialize
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   471
        subCanvasSpecs := IdentityDictionary new
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   472
    ].
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   473
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   474
    key := majorKey ? #NoMajorKey.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   475
    dict := subCanvasSpecs at:key ifAbsent:nil.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   476
    dict isNil ifTrue:[
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   477
        dict := IdentityDictionary new.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   478
        subCanvasSpecs at:key put:dict
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   479
    ].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   480
    dict at:minorKey put:aSpec
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   481
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   482
    "Modified: / 27.1.1998 / 12:21:27 / cg"
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   483
    "Modified: / 5.2.1998 / 12:05:32 / stefan"
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   484
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   485
475
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   486
visualAt:name
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   487
    visuals isNil ifTrue:[^ nil].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   488
    ^ visuals at:name asSymbol ifAbsent:nil
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   489
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   490
    "Created: 3.3.1997 / 16:24:17 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   491
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   492
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   493
visualAt:name put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   494
    visuals isNil ifTrue:[
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   495
        visuals := IdentityDictionary new.
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   496
    ].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   497
    visuals at:name asSymbol put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   498
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   499
    "Created: 3.3.1997 / 16:24:41 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   500
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   501
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   502
visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   503
    ^ visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   504
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   505
    "Created: 3.3.1997 / 16:24:00 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   506
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   507
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   508
visuals:aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   509
    visuals := aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   510
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   511
    "Created: 3.3.1997 / 16:24:06 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   512
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   513
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   514
window
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   515
    "return the top window (view), for which an interface
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   516
     is (being) built"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   517
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   518
    ^ window
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   519
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   520
    "Modified: 17.1.1997 / 19:30:00 / cg"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   521
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   522
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   523
window:aView
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   524
    "set the top window (view), for which an interface
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   525
     is (being) built"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   526
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   527
    window := aView
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   528
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   529
    "Modified: 17.1.1997 / 19:30:22 / cg"
66
claus
parents:
diff changeset
   530
!
claus
parents:
diff changeset
   531
claus
parents:
diff changeset
   532
windowGroup
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   533
    ^ window windowGroup
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   534
608
1cd72d2d7e3b removed debugHalt
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   535
    "Modified: 17.6.1997 / 18:04:01 / cg"
66
claus
parents:
diff changeset
   536
! !
claus
parents:
diff changeset
   537
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   538
!WindowBuilder methodsFor:'aspect access support'!
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   539
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   540
booleanValueAspectFor:aKey
674
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   541
    "helper (common code) to generate a boolean aspect if required.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   542
     If no binding exists for aKey, a valueHolder holding false is
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   543
     created and added to the bindings.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   544
     Otherwise, the existing binding is returned."
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   545
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   546
    ^ self valueAspectFor:aKey initialValue:false
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   547
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   548
    "Modified: 28.7.1997 / 12:53:57 / cg"
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   549
!
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   550
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   551
nilValueAspectFor:aKey
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   552
    "helper (common code) to generate a valueHolder aspect if required.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   553
     If no binding exists for aKey, a valueHolder holding nil is
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   554
     created and added to the bindings.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   555
     Otherwise, the existing binding is returned."
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   556
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   557
    ^ self valueAspectFor:aKey initialValue:nil
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   558
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   559
    "Modified: 28.7.1997 / 12:54:06 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   560
!
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   561
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   562
valueAspectFor:aKey initialValue:initialValue
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   563
    "helper (common code) to generate a valueHolder aspect if required.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   564
     If no binding exists for aKey, a valueHolder holding initialValue is
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   565
     created and added to the bindings.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   566
     Otherwise, the existing binding is returned."
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   567
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   568
    |holder|
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   569
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   570
    (holder := self bindingAt:aKey) isNil ifTrue:[
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   571
        self aspectAt:aKey put:(holder :=  initialValue asValue).
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   572
    ].
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   573
    ^ holder
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   574
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   575
    "Created: 28.7.1997 / 12:53:45 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   576
    "Modified: 28.7.1997 / 12:54:13 / cg"
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   577
! !
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   578
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   579
!WindowBuilder methodsFor:'building'!
66
claus
parents:
diff changeset
   580
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   581
buildFromSpec:aSpec
176
3890e2b312e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   582
    ^ self subclassResponsibility
408
93582137e1c7 tabable
ca
parents: 374
diff changeset
   583
!
93582137e1c7 tabable
ca
parents: 374
diff changeset
   584
93582137e1c7 tabable
ca
parents: 374
diff changeset
   585
makeTabable:aComponent
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   586
    "add a component to the list of tabable components"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   587
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   588
    self focusSequence add:aComponent
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   589
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   590
    "Modified: / 12.3.1999 / 00:02:24 / cg"
1123
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   591
!
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   592
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   593
setupWindowFor:aWindow
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   594
    self subclassResponsibility
66
claus
parents:
diff changeset
   595
! !
100
claus
parents: 99
diff changeset
   596
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   597
!WindowBuilder methodsFor:'error handling'!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   598
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   599
aspectNotFound:anAspect error:aString
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   600
    "show error message on transcript (if Verbose is true)
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   601
     and/or stop (if StopOnError) is true.
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   602
    "
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   603
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   604
    Verbose == true ifTrue:[
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   605
        Transcript showCR:'WindowBuilder: '
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   606
                         , aString
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   607
                         , ' aspect: <'
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   608
                         , anAspect storeString
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   609
                         , '>'.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   610
        application notNil ifTrue:[
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   611
             Transcript showCR:'WindowBuilder: (while building for ' 
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   612
                               , application class name
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   613
                               , ')'.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   614
        ].
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   615
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   616
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   617
    StopOnError == true ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   618
        self halt                       "/ avoids debugger in end-user apps
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   619
    ].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   620
    ^ nil
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   621
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   622
    "Modified: / 4.8.1998 / 19:38:56 / cg"
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   623
! !
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   624
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   625
!WindowBuilder methodsFor:'message sending'!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   626
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   627
safelyPerform:aSelector ifNone:aBlock
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   628
    "send the message aSelector to the application;
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   629
     the result returned from the send or nil is returned
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   630
    "
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   631
    |cls handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   632
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   633
    aSelector notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   634
        handlerBlock := [:ex|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   635
                            (ex parameter selector ~~ aSelector) ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   636
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   637
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   638
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   639
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   640
        application notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   641
            application messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   642
                ^ application perform:aSelector
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   643
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   644
            cls := application class.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   645
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   646
            cls messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   647
                ^ cls perform:aSelector
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   648
            ]
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   649
        ].
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   650
        applicationClass notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   651
            applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   652
                ^ applicationClass perform:aSelector
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   653
            ]
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   654
        ]
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   655
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   656
  ^ aBlock value
981
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   657
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   658
    "Modified: / 20.6.1998 / 11:52:19 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   659
!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   660
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   661
safelyPerform:aSelector with:anArgument ifNone:aBlock
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   662
    "send the one-arg-message aSelector to the application;
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   663
     the result returned from the send or nil is returned
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   664
    "
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   665
    |cls handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   666
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   667
    aSelector notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   668
        handlerBlock := [:ex|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   669
                            |badSel|
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   670
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   671
                            badSel := ex parameter selector.
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   672
                            (badSel ~~ aSelector and:[badSel ~~ anArgument]) ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   673
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   674
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   675
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   676
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   677
        application notNil ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   678
            application messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   679
                ^ application perform:aSelector with:anArgument
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   680
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   681
            cls := application class.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   682
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   683
            cls messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   684
                ^ cls perform:aSelector with:anArgument
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   685
            ]
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   686
        ].
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   687
        applicationClass notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   688
            applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   689
                ^ applicationClass perform:aSelector with:anArgument
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   690
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   691
        ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   692
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   693
  ^ aBlock value
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   694
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   695
    "Modified: / 4.8.1998 / 19:33:52 / cg"
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   696
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   697
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   698
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   699
    "send the two-arg-message aSelector to the application;
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   700
     the result returned from the send or nil is returned
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   701
    "
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   702
    |cls handlerBlock|
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   703
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   704
    aSelector notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   705
        handlerBlock := [:ex|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   706
                            |badSel|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   707
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   708
                            badSel := ex parameter selector.
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   709
                            (badSel ~~ aSelector and:[badSel ~~ arg1]) ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   710
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   711
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   712
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   713
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   714
        application notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   715
            application messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   716
                ^ application perform:aSelector with:arg1 with:arg2
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   717
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   718
            cls := application class.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   719
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   720
            cls messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   721
                ^ cls perform:aSelector with:arg1 with:arg2
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   722
            ]
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   723
        ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   724
        applicationClass notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   725
            applicationClass messageNotUnderstoodSignal handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   726
                ^ applicationClass perform:aSelector with:arg1 with:arg2
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   727
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   728
        ]
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   729
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   730
  ^ aBlock value
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   731
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   732
    "Modified: / 18.6.1998 / 21:40:13 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   733
! !
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   734
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   735
!WindowBuilder methodsFor:'spec creation aspect fetch'!
100
claus
parents: 99
diff changeset
   736
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   737
actionFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   738
    "return an action for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   739
     (by the builder) to ask for an ActionButtons actionBlock.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   740
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   741
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   742
     The returned object is typically a block."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   743
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   744
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   745
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   746
    bindings notNil ifTrue:[
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   747
        b := bindings at:aKey ifAbsent:nil.
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   748
        b notNil ifTrue:[^ b].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   749
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   750
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   751
    ^ self safelyPerform:#actionFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   752
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   753
                  ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ]
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   754
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   755
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   756
actionFor:aKey withValue:aValue
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   757
    "return an action for aKey/value combonation. 
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   758
     This is invoked during window building
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   759
     (by the builder) to ask for an ActionButtons actionBlock if that button
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   760
     specified an action with an argument value.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   761
     Here, first the local bindings are searched, then the application and
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   762
     finally the applications class is asked for a corresponding action.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   763
     The returned object is typically a block."
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   764
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   765
    |b|
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   766
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   767
    bindings notNil ifTrue:[
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   768
        b := bindings at:aKey ifAbsent:nil.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   769
        b notNil ifTrue:[^ b].
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   770
    ].
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   771
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   772
    ^ self safelyPerform:#actionFor:withValue:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   773
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   774
                    with:aValue
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   775
                  ifNone:[ self aspectNotFound:aKey error:'no action for:'. [:dummy |] ]
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   776
!
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   777
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   778
aspectFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   779
    "return a model for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   780
     (by the builder) to ask for an Editfields, a Toggles etc. model.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   781
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   782
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   783
     The returned object is typically a valueHolder."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   784
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   785
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   786
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   787
    bindings notNil ifTrue:[
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   788
        b := bindings at:aKey ifAbsent:nil.
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   789
        b notNil ifTrue:[^ b].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   790
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   791
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   792
    ^ self safelyPerform:#aspectFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   793
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   794
                  ifNone:[ self aspectAt:aKey ]
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   795
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   796
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   797
aspectFor:aKey ifAbsent:exceptionBlock
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   798
    "return a model for aKey. This is invoked during window building
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   799
     (by the builder) to ask for an Editfields, a Toggles etc. model.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   800
     Here, first the local bindings are searched, then the application and
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   801
     finally the applications class is asked for a corresponding action.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   802
     The returned object is typically a valueHolder."
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   803
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   804
    |b|
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   805
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   806
    bindings notNil ifTrue:[
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   807
        b := bindings at:aKey ifAbsent:nil.
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   808
        b notNil ifTrue:[^ b].
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   809
    ].
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   810
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   811
    ^ self safelyPerform:#aspectFor:
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   812
                    with:aKey
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   813
                  ifNone:[self aspectAt:aKey ifAbsent:exceptionBlock]
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   814
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   815
    "Created: / 4.8.1998 / 19:36:39 / cg"
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   816
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   817
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   818
componentFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   819
    "return a component for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   820
     (by the builder) to ask for an ArbitraryComponents view.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   821
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   822
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   823
     The returned object is typically a view."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   824
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   825
    ^ self safelyPerform:#componentFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   826
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   827
                  ifNone:[ self aspectAt:aKey ]
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   828
!
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   829
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   830
labelFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   831
    "return a label for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   832
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   833
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   834
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   835
     The returned object is typically a string."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   836
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   837
    ^ self safelyPerform:#labelFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   838
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   839
                  ifNone:[ self aspectAt:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   840
!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   841
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   842
listFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   843
    "return a list for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   844
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   845
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   846
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   847
     The returned object is typically a list."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   848
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   849
    ^ self safelyPerform:#listFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   850
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   851
                  ifNone:[ self aspectAt:aKey ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   852
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   853
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   854
menuFor:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   855
    "Find a binding for the menu named aKey, either in the bindings 
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   856
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   857
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   858
    |menu|
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   859
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   860
    aKey isNil ifTrue:[^ nil].
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   861
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   862
    (menu := self bindingAt:aKey) notNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   863
        ^ menu
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   864
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   865
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   866
    menu := self safelyPerform:#menuFor: with:aKey ifNone:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   867
                    self safelyPerform:aKey ifNone:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   868
                        self aspectNotFound:aKey error:'no menu for:'.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   869
                        nil
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   870
                    ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   871
                 ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   872
862
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
   873
    menu isBlock ifFalse:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
   874
        ((menu := menu value) notNil and:[application notNil]) ifTrue:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
   875
            menu isArray ifTrue:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
   876
                menu := Menu new fromLiteralArrayEncoding:menu.
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
   877
                menu receiver:application.
924
4680e2fe4728 must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents: 862
diff changeset
   878
            ].
4680e2fe4728 must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents: 862
diff changeset
   879
            menu findGuiResourcesIn:application
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   880
        ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   881
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   882
    ^ menu
717
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
   883
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   884
    "Modified: / 18.6.1998 / 16:30:31 / cg"
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   885
!
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   886
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   887
specificationFor:aKey
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   888
    "return a specification for aKey. This is invoked during window building
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   889
     (by the builder) to ask for the interfaceSpec for a subCanvas or subSpecification.
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   890
     Here, first the local bindings are searched, then the application and
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   891
     finally the applications class is asked for a corresponding interfaceSPec.
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   892
     The returned object is typically an interfaceSpec array."
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   893
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   894
    ^ self safelyPerform:#specificationFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   895
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   896
                  ifNone:[ self aspectFor:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   897
! !
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   898
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   899
!WindowBuilder methodsFor:'spec creation callbacks'!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   900
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   901
createdComponent:aView forSpec:spec named:name
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   902
    "callback from the UISpec after a view has been
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   903
     created for a spec.
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   904
     If it has a name, add it to the namedComponents dictionary;
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   905
     if I have a creationHook (application callBack), evaluate it."
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   906
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   907
    name notNil ifTrue:[
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   908
        "/ self componentAt:name put:aView.
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   909
        namedComponents isNil ifTrue:[
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   910
            namedComponents := IdentityDictionary new.
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   911
        ].
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   912
        namedComponents at:name asSymbol put:aView
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   913
    ].
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   914
    componentCreationHook notNil ifTrue:[
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   915
        componentCreationHook value:aView value:spec value:self
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   916
    ]
100
claus
parents: 99
diff changeset
   917
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   918
    "Modified: / 5.9.1995 / 21:42:54 / claus"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   919
    "Created: / 31.10.1997 / 18:47:01 / cg"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   920
    "Modified: / 31.10.1997 / 18:51:22 / cg"
100
claus
parents: 99
diff changeset
   921
! !
claus
parents: 99
diff changeset
   922
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   923
!WindowBuilder methodsFor:'startup'!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   924
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   925
closeRequest
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   926
    window destroy
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   927
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   928
    "Modified: 17.1.1997 / 19:30:32 / cg"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   929
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   930
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   931
open
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   932
    "open my topView, as previously created"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   933
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   934
    |type|
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   935
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   936
    application isNil ifTrue:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   937
        type := #normal
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   938
    ] ifFalse:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   939
        type := application defaultWindowType
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   940
    ].
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   941
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   942
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   943
        withExtent:nil
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   944
        andType:type
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   945
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   946
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   947
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   948
openAt:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   949
    "open my topView at some location"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   950
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   951
    ^ self 
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
   952
        openAt:aPoint 
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
   953
        withExtent:nil  
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   954
        andType:(application defaultWindowType)
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   955
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   956
    "Created: 14.2.1997 / 20:21:57 / cg"
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
   957
    "Modified: 28.2.1997 / 22:50:29 / cg"
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   958
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
   959
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   960
openDialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   961
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   962
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   963
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   964
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   965
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   966
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   967
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   968
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   969
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   970
openDialogAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   971
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   972
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   973
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   974
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   975
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   976
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   977
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   978
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   979
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   980
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   981
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   982
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   983
openDialogAt:aPoint withExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   984
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   985
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   986
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   987
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   988
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   989
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   990
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   991
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   992
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   993
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   994
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   995
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   996
openDialogWithExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   997
    "open my topView, as previously created as a modal view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   998
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   999
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1000
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1001
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1002
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1003
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1004
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1005
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1006
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1007
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1008
openModal
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1009
    "open my topView as a modal dialog, as previously created,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1010
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1011
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1012
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1013
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1014
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1015
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1016
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1017
    "Modified: 3.3.1997 / 19:43:57 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1018
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1019
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1020
openPopUpAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1021
    "open my topView, as previously created as a popUp view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1022
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1023
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1024
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1025
        openAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1026
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1027
        andType:#popUp
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1028
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1029
    "Modified: 17.1.1997 / 19:59:29 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1030
    "Created: 14.2.1997 / 20:24:38 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1031
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1032
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1033
openPopUpIn:aRectangle
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1034
    "open my topView, as previously created as a popUp view,
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1035
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1036
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1037
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1038
        openAt:aRectangle origin
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1039
        withExtent:aRectangle extent 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1040
        andType:#popUp
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1041
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1042
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1043
openWindow
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1044
    "open my topView"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1045
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1046
    ^ self
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1047
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1048
        withExtent:nil  
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1049
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1050
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1051
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1052
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1053
openWindowAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1054
    "open my topView at some location"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1055
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1056
    ^ self
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1057
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1058
        withExtent:nil  
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1059
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1060
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1061
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1062
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1063
openWindowAt:origin withExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1064
    "open my window, as previously created, optionally defining the
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1065
     windows origin and/or extent. 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1066
     The type argument may be #dialog or #normal, and specifies if the view 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1067
     should be opened as a modal view, blocking interaction to the currently 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1068
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1069
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1070
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1071
        openAt:origin 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1072
        withExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1073
        andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1074
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1075
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1076
openWindowCenter
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1077
    "open my topView centered on the screen (dialog & normal only)"
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1078
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1079
    ^ self
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1080
        openAt:#center 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1081
        withExtent:nil  
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1082
        andType:(application defaultWindowType)
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1083
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1084
!
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1085
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1086
openWithExtent:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1087
    "open my topView, as previously created, but override
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1088
     the extent."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1089
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1090
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1091
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1092
        withExtent:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1093
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1094
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1095
    "Modified: 17.1.1997 / 19:58:48 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1096
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1097
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1098
openWithExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1099
    "open my window, as previously created. The type argument
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1100
     may be #dialog or #normal, and specifies if the view should
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1101
     be opened as a modal view, blocking interaction to the currently 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1102
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1103
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1104
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1105
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1106
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1107
        andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1108
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1109
    "Modified: 14.2.1997 / 20:22:47 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1110
! !
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1111
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1112
!WindowBuilder methodsFor:'startup - basic'!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1113
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
  1114
openAt:origin withExtent:ext andType:type
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1115
    "open my window, as previously created, optionally defining the
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1116
     windows origin and/or extent. 
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1117
     The type argument may be #dialog, #popup or #normal, 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1118
     and specifies if the view should be opened as a 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1119
        modal view (blocking interaction to the currently active view), 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1120
        as popUp (also blocking)
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1121
        or as a normal view."
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1122
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1123
    origin notNil ifTrue:[
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1124
        "/ kludge
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1125
        origin ~~ #center ifTrue:[
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1126
            window origin:origin
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1127
        ]
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1128
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1129
    ext notNil ifTrue:[
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1130
        window extent:ext.
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1131
    ] ifFalse:[
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1132
        type == #dialog ifTrue:[
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1133
            window fixSize
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1134
        ]
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1135
    ].
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1136
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1137
    type == #dialog ifTrue:[
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1138
        origin == #center ifTrue:[
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1139
            window origin:(window device center - (window extent // 2))
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1140
        ] ifFalse:[
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1141
            window fixPosition:(window device pointerPosition - window positionOffset).
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1142
        ].
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1143
        ^ window openModal.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1144
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1145
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1146
    type == #normal ifTrue:[
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1147
        window isNil ifTrue:[
965
04cadbd21aac use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
  1148
            self setupWindowFor:(ApplicationWindow new).
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1149
        ].
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1150
        origin == #center ifTrue:[
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1151
            window origin:(window device center - window extent // 2)
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1152
        ].
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1153
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1154
        window open.
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1155
        ^ self
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1156
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1157
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1158
    type == #popUp ifTrue:[
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
  1159
        window fixPosition:(window device pointerPosition).
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1160
        ^ window openAsPopUp.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1161
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1162
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1163
    "
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1164
     if ST-80 supports more types - these may be added later
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1165
    "
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1166
    self halt:'unimplemented'
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1167
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1168
    "Created: / 14.2.1997 / 20:22:24 / cg"
965
04cadbd21aac use new ApplicationWindow (instead of StandardSystemView)
Claus Gittinger <cg@exept.de>
parents: 961
diff changeset
  1169
    "Modified: / 18.6.1998 / 19:10:07 / cg"
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1170
! !
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1171
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1172
!WindowBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1173
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1174
version
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
  1175
    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.76 1999-03-12 09:56:23 cg Exp $'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1176
! !