WindowBuilder.st
author Claus Gittinger <cg@exept.de>
Thu, 22 Dec 2005 17:55:14 +0100
changeset 2074 043bdbb49ef4
parent 2015 395f58bb269d
child 2077 33117b22f7e8
permissions -rw-r--r--
*** empty log message ***
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
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    13
"{ Package: 'stx:libview2' }"
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
    14
100
claus
parents: 99
diff changeset
    15
Object subclass:#WindowBuilder
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    16
	instanceVariableNames:'window application bindings visuals labels focusSequence
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    17
		namedComponents helpKeys componentCreationHook applicationClass
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
    18
		keyboardProcessor subCanvasSpecs'
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
    19
	classVariableNames:'StopOnError Verbose'
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
    20
	poolDictionaries:''
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
    21
	category:'Interface-Support-UI'
66
claus
parents:
diff changeset
    22
!
claus
parents:
diff changeset
    23
claus
parents:
diff changeset
    24
!WindowBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    25
89
claus
parents: 86
diff changeset
    26
copyright
claus
parents: 86
diff changeset
    27
"
claus
parents: 86
diff changeset
    28
 COPYRIGHT (c) 1995 by Claus Gittinger
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
    29
              All Rights Reserved
89
claus
parents: 86
diff changeset
    30
claus
parents: 86
diff changeset
    31
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
    32
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
    34
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
    35
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    36
 hereby transferred.
claus
parents: 86
diff changeset
    37
"
claus
parents: 86
diff changeset
    38
!
claus
parents: 86
diff changeset
    39
66
claus
parents:
diff changeset
    40
documentation
claus
parents:
diff changeset
    41
"
69
claus
parents: 66
diff changeset
    42
    a no-op class, for systems which do not use the UIBuilder.
66
claus
parents:
diff changeset
    43
    Concrete subclasses know how to create a view (with components) from
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    44
    some interface spec.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    45
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    46
    The order of the lookup sequence to access an aspect is defined:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    47
        application
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    48
        application class
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    49
        additional  class (applicationClass).
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    50
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    51
    Methods to access any aspect are located in the category
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    52
    'spec creation aspect fetch'.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
    53
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
    54
    Currently, an experimantal version of UIBuilder exists,
66
claus
parents:
diff changeset
    55
    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
    56
    specs - thinking of motifs UIL specs, Windows DialogSpecs etc.).
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
    57
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    58
    [instance variables:]
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    59
        window          <View>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    60
                                the topView into which the components
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    61
                                are (have been) created from the specification
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    62
                                
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    63
        application     <ApplicationModel>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    64
                                the application object (typically an instance
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    65
                                of a subclass of ApplicationModel).
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    66
                                That one is usually supposed to provide
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    67
                                valueHolders for aspects, action methods
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    68
                                menuSpecs and possibly more windowSpecs.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    69
                                Usually means, that most of those can also be
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    70
                                provided to the builder via a set of bindings,
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    71
                                which overrides those.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    72
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    73
        bindings        <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    74
                                can be set (or filled) with bindings for
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    75
                                aspects to be used when setting up the models
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    76
                                for components. Useful either to overwrite
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    77
                                corresponding appModel aspects or if the appModel
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    78
                                does not want to procide those.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    79
                                (for example, to open a dialog and provide the
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    80
                                 bindings in a dictionary - as opposed to
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    81
                                 providing them via aspect methods)
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
        visuals                 not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    84
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    85
        focusSequence   <Collection>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    86
                                maintained during the build process;
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    87
                                contains tabable components.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    88
                                This will be replaced by a more intelligent
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    89
                                mechanism in the near future.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    90
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    91
        namedComponents <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    92
                                contains name->component associations for
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    93
                                all components which have a non-nil component
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    94
                                name. Created during the build process.
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
        helpKeys                not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    97
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    98
        componentCreationHook <BlockOrNil>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
    99
                                can be set before the components are built
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   100
                                from the spec, to provide an arbitrary
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   101
                                callBacks-hook which will be invoked after
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   102
                                a component has been created from a spec. 
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   103
                                The UIPainter uses this to maintain its
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   104
                                component<->spec assiciations.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   105
                                Can be set by the app, to catch creation of
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   106
                                components and fiddle around during the
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   107
                                creation process (change extents, colors or whatever)
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   108
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   109
        applicationClass <ClassOrNil>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   110
                                can be set to provide an additional class which
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   111
                                is asked for aspects during the build process.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   112
                                If not set, the app is asked, which itself asks
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   113
                                its class.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   114
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   115
        keyboardProcessor       not yet used - for compatibility
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   116
                                Will eventually takeover the functionality
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   117
                                of the focusSequence, shortcuts & provide a hook
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   118
                                for the app.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   119
        
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   120
        subCanvasSpecs <Dictionary>
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   121
                                can be set by the app to provide subcanvas
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   122
                                specs (much like the bindings dictionary)
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   123
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   124
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
   125
        Claus Gittinger
66
claus
parents:
diff changeset
   126
"
claus
parents:
diff changeset
   127
! !
claus
parents:
diff changeset
   128
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   129
!WindowBuilder class methodsFor:'debugging'!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   130
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   131
stopOnError:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   132
    "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
   133
     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
   134
     The default is off."
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
    StopOnError := aBoolean
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
    "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
   139
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   140
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   141
verbose:aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   142
    "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
   143
     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
   144
     The default is off."
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
    Verbose := aBoolean
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   147
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   148
    "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
   149
    "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
   150
! !
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   151
1763
fabe0b506e33 method category rename
Claus Gittinger <cg@exept.de>
parents: 1727
diff changeset
   152
!WindowBuilder methodsFor:'Compatibility-VW'!
974
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   153
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   154
source
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   155
    "same as #application, for ST-80 compatibility"
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
    ^ application
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
    "Created: 17.1.1997 / 19:03:51 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   160
!
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   161
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   162
source:anApplicationModel
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   163
    "same as #application:, for ST-80 compatibility"
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
    application := anApplicationModel
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
    "Modified: 17.1.1997 / 19:03:57 / cg"
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   168
! !
4b045b9affb3 category change
Claus Gittinger <cg@exept.de>
parents: 970
diff changeset
   169
66
claus
parents:
diff changeset
   170
!WindowBuilder methodsFor:'accessing'!
claus
parents:
diff changeset
   171
463
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   172
addBindings:moreBindings
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   173
    "used with subDialogs, which provide local bindings.
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   174
     All bindings from moreBindings overwrite any local bindings."
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   175
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   176
    moreBindings notNil ifTrue:[
1564
7647fb7ddd61 lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents: 1563
diff changeset
   177
        bindings isNil ifTrue:[
7647fb7ddd61 lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents: 1563
diff changeset
   178
            bindings := IdentityDictionary new
7647fb7ddd61 lazy init of bindings (in addBindings:)
Claus Gittinger <cg@exept.de>
parents: 1563
diff changeset
   179
        ].
2001
9b80263fc0f1 Use #addAll: instead of #declareAllFrom:, since #declareAllFrom:
Stefan Vogel <sv@exept.de>
parents: 1995
diff changeset
   180
        bindings addAll:moreBindings
463
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
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   183
    "Created: 28.2.1997 / 14:14:33 / cg"
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   184
!
75a8e06ef324 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 450
diff changeset
   185
100
claus
parents: 99
diff changeset
   186
application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   187
    "return the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   188
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   189
     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
   190
100
claus
parents: 99
diff changeset
   191
    ^ application
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   192
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   193
    "Modified: 17.1.1997 / 19:04:40 / cg"
66
claus
parents:
diff changeset
   194
!
claus
parents:
diff changeset
   195
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   196
application:anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   197
    "set the application (an ApplicationModel),
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   198
     for which the view is built.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   199
     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
   200
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   201
    application := anApplicationModel
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   202
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   203
    "Modified: 17.1.1997 / 19:04:47 / cg"
66
claus
parents:
diff changeset
   204
!
claus
parents:
diff changeset
   205
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   206
applicationClass
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   207
    "return the value of the instance variable 'applicationClass' (automatically generated).
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   208
     WARNING:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   209
        This is a private interface for the UIPainter to pass down the app-class
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   210
        to the specs when editing."
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   211
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   212
    ^ applicationClass 
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   213
!
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   214
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   215
applicationClass:something
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   216
    "set the value of the instance variable 'applicationClass' (automatically generated).
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   217
     WARNING:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   218
         This is a private interface for the UIPainter to pass down the app-class
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   219
         to the specs when editing."
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   220
1155
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   221
    applicationClass := something.
e4408835f51b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1139
diff changeset
   222
!
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   223
66
claus
parents:
diff changeset
   224
aspectAt:aSymbol
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   225
    "return the aspect for a symbol or nil."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   226
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   227
    ^ self 
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   228
        aspectAt:aSymbol 
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   229
        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
   230
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   231
    "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
   232
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   233
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   234
aspectAt:aSymbol ifAbsent:exceptionBlock
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   235
    "return the aspect for a symbol or the value from exceptionBlock."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   236
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   237
    |b|
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   238
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   239
    aSymbol notNil ifTrue:[
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   240
        bindings notNil ifTrue:[
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   241
            b := bindings at:aSymbol ifAbsent:nil.
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   242
            b notNil ifTrue:[^ b].
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   243
        ].
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   244
473
9ef922391c70 nil aspect
ca
parents: 467
diff changeset
   245
        application notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   246
            MessageNotUnderstood 
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   247
                ignoreNotUnderstoodOf:aSymbol
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   248
                in:[
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   249
                    ^ application aspectFor:aSymbol
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   250
                ].
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   251
            MessageNotUnderstood 
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   252
                ignoreNotUnderstoodOf:aSymbol
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   253
                in:[
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   254
                    ^ application class aspectFor:aSymbol
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   255
                ].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   256
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   257
            ^ exceptionBlock value.
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   258
        ]
433
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   259
    ].
31b52cc4451a *** empty log message ***
ca
parents: 428
diff changeset
   260
    ^ nil
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   261
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   262
    "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
   263
    "Modified: / 4.8.1998 / 19:37:02 / cg"
66
claus
parents:
diff changeset
   264
!
claus
parents:
diff changeset
   265
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   266
aspectAt:aSymbol put:aModel
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   267
    "store an aspect identified by its symbol and its value"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   268
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   269
    bindings isNil ifTrue:[
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   270
        bindings := IdentityDictionary new
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   271
    ].
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   272
    ^ bindings at:aSymbol put:aModel
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   273
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   274
    "Modified: 17.1.1997 / 19:28:37 / cg"
100
claus
parents: 99
diff changeset
   275
!
claus
parents: 99
diff changeset
   276
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   277
bindingAt:aSymbol
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   278
    "return the binding for a symbol or nil if there is none"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   279
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   280
    bindings notNil ifTrue:[
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   281
        ^ bindings at:aSymbol ifAbsent:nil.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   282
    ].
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   283
    ^ nil
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   284
!
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   285
100
claus
parents: 99
diff changeset
   286
bindings
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   287
    "return my bindings"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   288
100
claus
parents: 99
diff changeset
   289
    ^ bindings
claus
parents: 99
diff changeset
   290
!
claus
parents: 99
diff changeset
   291
claus
parents: 99
diff changeset
   292
bindings:aDictionary
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   293
    "set bindings to a dictionary"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   294
100
claus
parents: 99
diff changeset
   295
    bindings := aDictionary
claus
parents: 99
diff changeset
   296
!
claus
parents: 99
diff changeset
   297
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   298
componentAt:name
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   299
    "return a component identified by its name"
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   300
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   301
    |widget|
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   302
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   303
    namedComponents notNil ifTrue:[
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   304
        widget := namedComponents at:name asSymbol ifAbsent:nil.
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   305
        widget notNil ifTrue:[^ widget].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   306
    ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   307
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   308
    "/ cg the following code looks in any application-
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   309
    "/ or master applications builder for the component.
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   310
    "/ This has an effect, if a subcanvases builder is asked for
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   311
    "/ a component, which is actually held by the real-apps builder
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   312
    "/ (in case they have different builders).
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   313
    "/ For now, this code is disabled, since I dont know what effect this
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   314
    "/ has to existing code ...
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   315
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   316
"/    application notNil ifTrue:[
1673
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   317
"/        |appBuilder masterApplication masterBuilder|
de7dabc35768 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1672
diff changeset
   318
"/
1208
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   319
"/        (appBuilder := application builder) notNil ifTrue:[
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   320
"/            appBuilder ~~ self ifTrue:[    
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   321
"/                ^ appBuilder componentAt:name
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   322
"/            ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   323
"/        ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   324
"/
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   325
"/        (masterApplication := application masterApplication) notNil ifTrue:[
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   326
"/            (masterBuilder := masterApplication builder) notNil ifTrue:[
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   327
"/                masterBuilder ~~ self ifTrue:[    
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   328
"/                    ^ masterBuilder componentAt:name
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   329
"/                ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   330
"/            ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   331
"/        ]
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   332
"/    ].
c9904a2499ea comment
Claus Gittinger <cg@exept.de>
parents: 1198
diff changeset
   333
    ^ nil
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   334
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   335
100
claus
parents: 99
diff changeset
   336
componentAt:name put:aComponent
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   337
    "store a component identified by its name."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   338
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   339
    namedComponents isNil ifTrue:[
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   340
        namedComponents := IdentityDictionary new.
100
claus
parents: 99
diff changeset
   341
    ].
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   342
    namedComponents at:name asSymbol put:aComponent
100
claus
parents: 99
diff changeset
   343
!
claus
parents: 99
diff changeset
   344
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   345
componentCreationHook:something
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   346
    "set the value of the instance variable 'componentCreationHook' (automatically generated)"
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   347
1447
879dc0a647c2 checkin from browser
ps
parents: 1395
diff changeset
   348
    componentCreationHook := something.
879dc0a647c2 checkin from browser
ps
parents: 1395
diff changeset
   349
!
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
   350
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   351
findComponentAt:name
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   352
    "recursively search for a component identified by its name in myself
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   353
     and all of my subApplications."
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   354
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   355
    ^ self 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   356
        findComponentAt:name 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   357
        forWhichViewConformsTo:[:v | true]
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   358
        ignoringViews:(IdentitySet new).
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   359
!
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   360
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   361
findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   362
    "recursively search for a visible component identified by its name in myself
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   363
     and all of my subApplications.
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   364
     As a builders applications view might be different from the builders view,
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   365
     we must be careful to avoid endless recursion if a subview refers to the topviews builder,
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   366
     (sigh)"
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   367
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   368
    |comp "window" app b|
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   369
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   370
    (comp := self componentAt:name) notNil ifTrue:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   371
        ^ comp
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   372
    ].
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   373
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   374
    window isNil ifTrue:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   375
        ^ self
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   376
    ].
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   377
    "/ window := self application window.
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   378
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   379
    (triedViews includes:window) ifTrue:[^ nil].
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   380
    triedViews add:window.
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   381
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   382
    window allSubViewsDo:[:v |
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   383
        (triedViews includes:v) ifFalse:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   384
            triedViews add:v.
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   385
            (viewCheck value:v) ifTrue:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   386
                ((app := v application) notNil 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   387
                and:[(b := app builder) notNil 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   388
                and:[b ~~ self]])
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   389
                ifTrue:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   390
                    comp := b findComponentAt:name forWhichViewConformsTo:viewCheck ignoringViews:triedViews.
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   391
                    comp notNil ifTrue:[
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   392
                        ^ comp
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   393
                    ]
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   394
                ]
1563
166f840701bf avoid endless recursion in #findComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1533
diff changeset
   395
            ]
1357
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   396
        ]
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   397
    ].
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   398
    ^ nil
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   399
!
facab5c393b9 added #findComponentAt: - recursive search for a named component
Claus Gittinger <cg@exept.de>
parents: 1351
diff changeset
   400
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   401
findVisibleComponentAt:name
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   402
    "recursively search for a visible component identified by its name in myself
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   403
     and all of my subApplications.
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   404
     Be careful: this also searches for components in unmapped canvases."
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   405
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   406
    ^ self 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   407
        findComponentAt:name 
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   408
        forWhichViewConformsTo:[:v | v shown]
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   409
        ignoringViews:(IdentitySet new).
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   410
!
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
   411
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   412
focusSequence 
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   413
    "return my focus sequence"
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   414
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   415
    focusSequence isNil ifTrue:[
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   416
        focusSequence := OrderedCollection new
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   417
    ].
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   418
    ^ focusSequence
1139
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   419
ab56c6dc429e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1123
diff changeset
   420
    "Modified: / 12.3.1999 / 00:02:04 / cg"
66
claus
parents:
diff changeset
   421
!
claus
parents:
diff changeset
   422
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   423
helpKeyFor:aComponent
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   424
    "return the helpkey for a component or nil"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   425
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   426
    |v key|
885bd39df8df access help key
ca
parents: 598
diff changeset
   427
885bd39df8df access help key
ca
parents: 598
diff changeset
   428
    helpKeys isNil ifTrue:[^ nil].
885bd39df8df access help key
ca
parents: 598
diff changeset
   429
    v := aComponent.
885bd39df8df access help key
ca
parents: 598
diff changeset
   430
    [v notNil] whileTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   431
        (key := helpKeys at:v ifAbsent:nil) notNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   432
            ^ key
885bd39df8df access help key
ca
parents: 598
diff changeset
   433
        ].
885bd39df8df access help key
ca
parents: 598
diff changeset
   434
        v := v superView
885bd39df8df access help key
ca
parents: 598
diff changeset
   435
    ].
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   436
    ^ nil
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   437
!
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   438
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   439
helpKeyFor:aComponent put:aKey
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   440
    "assign a key for a component which is used to access the help text
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   441
     from the application."
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   442
600
885bd39df8df access help key
ca
parents: 598
diff changeset
   443
    aKey isNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   444
        helpKeys isNil ifFalse:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   445
            helpKeys removeKey:aComponent ifAbsent:nil
885bd39df8df access help key
ca
parents: 598
diff changeset
   446
        ]
885bd39df8df access help key
ca
parents: 598
diff changeset
   447
    ] ifFalse:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   448
        helpKeys isNil ifTrue:[
885bd39df8df access help key
ca
parents: 598
diff changeset
   449
            helpKeys := IdentityDictionary new
885bd39df8df access help key
ca
parents: 598
diff changeset
   450
        ].
885bd39df8df access help key
ca
parents: 598
diff changeset
   451
        helpKeys at:aComponent put:aKey
885bd39df8df access help key
ca
parents: 598
diff changeset
   452
    ]
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   453
!
15d80dd3d974 help text
ca
parents: 587
diff changeset
   454
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   455
keyboardProcessor
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   456
    "return my keyboard processor"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   457
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   458
    keyboardProcessor isNil ifTrue:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   459
        keyboardProcessor := KeyboardProcessor new    
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   460
    ].
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   461
    ^ keyboardProcessor
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   462
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   463
    "Created: 3.3.1997 / 18:31:37 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   464
    "Modified: 3.3.1997 / 18:32:27 / cg"
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   465
!
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
   466
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   467
keyboardProcessor:aKeyboardProcessor
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   468
    "set my keyboard processor"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   469
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   470
    keyboardProcessor := aKeyboardProcessor
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   471
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   472
    "Created: / 18.6.1998 / 19:59:38 / cg"
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   473
!
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   474
855
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   475
labelAt:name
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   476
    labels isNil ifTrue:[^ nil].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   477
    ^ labels at:name asSymbol ifAbsent:nil
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   478
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   479
    "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
   480
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   481
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   482
labelAt:name put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   483
    labels isNil ifTrue:[
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   484
        labels := IdentityDictionary new.
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   485
    ].
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   486
    labels at:name asSymbol put:aLabelString
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   487
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   488
    "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
   489
!
baf65c4e2bed added #labelAt: / labelAt:put: for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 848
diff changeset
   490
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   491
menuAt:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   492
    "Find a binding for the menu named aKey, either in the bindings 
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   493
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   494
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   495
    ^ self menuFor:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   496
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   497
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   498
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   499
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   500
menuAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   501
    "add someMenuOrHolder as the binding for the menu named aSymbol to the bindings"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   502
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   503
    ^ self aspectAt:aSymbol put:someMenuOrHolder
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   504
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   505
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   506
86
claus
parents: 80
diff changeset
   507
namedComponents
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   508
    "return a list of named components"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   509
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   510
    ^ namedComponents
86
claus
parents: 80
diff changeset
   511
!
claus
parents: 80
diff changeset
   512
1971
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   513
namedComponentsDo: aBlock
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   514
    namedComponents notNil ifTrue:[
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   515
        namedComponents do:[:aView|
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   516
            aBlock value: aView
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   517
        ]
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   518
    ]
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   519
!
bc5eb01b6d04 changes for werner (access to view instvar)
werner
parents: 1879
diff changeset
   520
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   521
resources
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   522
    application notNil ifTrue:[
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   523
        ^ application resources
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   524
    ].
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   525
    ^ Dialog classResources.
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   526
!
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   527
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   528
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
   529
    "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
   530
     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
   531
     which can be filled via #specificationAt:at:put: messages.
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   532
     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
   533
     #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
   534
     message to the class named as majorKey.
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   535
     Notice, that the class named majorKey is first searched in the
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   536
     application classes namespace - allowing private classes as majorKey."
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   537
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   538
    |spec cls dict dkey|
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   539
1351
42d9de8818bf care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   540
    minorKey isNil ifTrue:[^ nil].
42d9de8818bf care for nil minorKey in #subCanvasAt:at:
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
   541
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   542
    subCanvasSpecs notNil ifTrue:[
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   543
        dkey := majorKey ? #NoMajorKey.
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   544
        dict := subCanvasSpecs at:dkey ifAbsent:nil.
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   545
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   546
        dict notNil ifTrue:[
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   547
            spec := dict at:minorKey ifAbsent:nil.
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   548
            spec notNil ifTrue:[^ spec].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   549
        ].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   550
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   551
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   552
    majorKey isNil ifTrue:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   553
        ^ self specificationFor:minorKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   554
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   555
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   556
    application notNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   557
        "/ look for class in applications namespace ...
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   558
        cls := application resolveName:majorKey.
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   559
    ] ifFalse:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   560
        "/ fallBack - use that global, if it exists
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   561
        cls := Smalltalk at:majorKey.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   562
        cls isNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   563
            Transcript showCR:('WindowBuilder[warning]: missing application when fetching majorKey:' , majorKey).
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   564
        ].
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   565
    ].
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   566
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   567
    cls notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   568
        MessageNotUnderstood catch:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   569
            ^ cls specificationFor:minorKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   570
        ].
1586
4dd7b087fab8 bug fix in: #subCanvasAt:at:
ca
parents: 1585
diff changeset
   571
        MessageNotUnderstood catch:[
4dd7b087fab8 bug fix in: #subCanvasAt:at:
ca
parents: 1585
diff changeset
   572
            ^ cls perform:minorKey.
4dd7b087fab8 bug fix in: #subCanvasAt:at:
ca
parents: 1585
diff changeset
   573
        ]
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   574
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   575
    ^ nil
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   576
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   577
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   578
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
   579
    "deposit an interfaceSpecification for major and minor key
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   580
     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
   581
     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
   582
     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
   583
     (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
   584
     See #subCanvasAt:at:."
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   585
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   586
    |dict key|
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   587
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   588
    subCanvasSpecs isNil ifTrue:[
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   589
        "/ lazyly initialize
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   590
        subCanvasSpecs := IdentityDictionary new
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   591
    ].
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   592
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   593
    key := majorKey ? #NoMajorKey.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   594
    dict := subCanvasSpecs at:key ifAbsent:nil.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   595
    dict isNil ifTrue:[
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   596
        dict := IdentityDictionary new.
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   597
        subCanvasSpecs at:key put:dict
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   598
    ].
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   599
    dict at:minorKey put:aSpec
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   600
774
fb8810086f95 removed unused instVar windowView;
Claus Gittinger <cg@exept.de>
parents: 735
diff changeset
   601
    "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
   602
    "Modified: / 5.2.1998 / 12:05:32 / stefan"
502
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   603
!
43ca81bcde49 supporting SubCanvas-Spec
ca
parents: 480
diff changeset
   604
475
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   605
visualAt:name
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   606
    visuals isNil ifTrue:[^ nil].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   607
    ^ visuals at:name asSymbol ifAbsent:nil
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   608
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   609
    "Created: 3.3.1997 / 16:24:17 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   610
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   611
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   612
visualAt:name put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   613
    visuals isNil ifTrue:[
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   614
        visuals := IdentityDictionary new.
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   615
    ].
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   616
    visuals at:name asSymbol put:aVisual
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   617
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   618
    "Created: 3.3.1997 / 16:24:41 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   619
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   620
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   621
visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   622
    ^ visuals
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   623
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   624
    "Created: 3.3.1997 / 16:24:00 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   625
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   626
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   627
visuals:aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   628
    visuals := aDictionary
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   629
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   630
    "Created: 3.3.1997 / 16:24:06 / cg"
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   631
!
fd94f2bc8b9e added #visuals, #visualAt: and #visualAt:put:
Claus Gittinger <cg@exept.de>
parents: 473
diff changeset
   632
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   633
window
1995
6b94d8ebe2c6 *** empty log message ***
ca
parents: 1993
diff changeset
   634
    "return the top window (view), for which an interface is (being) built"
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   635
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   636
    ^ window
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   637
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   638
    "Modified: 17.1.1997 / 19:30:00 / cg"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   639
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   640
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   641
window:aView
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   642
    "set the top window (view), for which an interface
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   643
     is (being) built"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   644
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   645
    window := aView
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   646
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   647
    "Modified: 17.1.1997 / 19:30:22 / cg"
66
claus
parents:
diff changeset
   648
!
claus
parents:
diff changeset
   649
claus
parents:
diff changeset
   650
windowGroup
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   651
    ^ window windowGroup
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   652
608
1cd72d2d7e3b removed debugHalt
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   653
    "Modified: 17.6.1997 / 18:04:01 / cg"
66
claus
parents:
diff changeset
   654
! !
claus
parents:
diff changeset
   655
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   656
!WindowBuilder methodsFor:'aspect access support'!
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   657
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   658
booleanValueAspectFor:aKey
674
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   659
    "helper (common code) to generate a boolean aspect if required.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   660
     If no binding exists for aKey, a valueHolder holding false is
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   661
     created and added to the bindings.
a48904783fba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
   662
     Otherwise, the existing binding is returned."
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   663
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   664
    ^ self valueAspectFor:aKey initialValue:false
673
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   665
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   666
    "Modified: 28.7.1997 / 12:53:57 / cg"
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   667
!
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   668
1198
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   669
listAspectFor:aKey
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   670
    "helper (common code) to generate a list model aspect if required.
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   671
     If no binding exists for aKey, a new List is
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   672
     created and added to the bindings.
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   673
     Otherwise, the existing binding is returned."
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   674
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   675
    |list|
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   676
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   677
    (list := self bindingAt:aKey) isNil ifTrue:[
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   678
        self aspectAt:aKey put:(list := List new).
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   679
    ].
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   680
    ^ list
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   681
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   682
    "Created: 28.7.1997 / 12:53:45 / cg"
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   683
    "Modified: 28.7.1997 / 12:54:13 / cg"
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   684
!
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   685
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   686
nilValueAspectFor:aKey
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   687
    "helper (common code) to generate a valueHolder aspect if required.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   688
     If no binding exists for aKey, a valueHolder holding nil is
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   689
     created and added to the bindings.
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   690
     Otherwise, the existing binding is returned."
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   691
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   692
    ^ self valueAspectFor:aKey initialValue:nil
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   693
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   694
    "Modified: 28.7.1997 / 12:54:06 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   695
!
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   696
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   697
valueAspectFor:aKey initialValue:initialValue
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   698
    "helper (common code) to generate a valueHolder aspect if required.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   699
     If no binding exists for aKey, a valueHolder holding initialValue is
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   700
     created and added to the bindings.
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   701
     Otherwise, the existing binding is returned."
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   702
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   703
    |holder|
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   704
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   705
    (holder := self bindingAt:aKey) isNil ifTrue:[
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   706
        self aspectAt:aKey put:(holder :=  initialValue asValue).
675
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   707
    ].
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   708
    ^ holder
655134e5e064 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
   709
676
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   710
    "Created: 28.7.1997 / 12:53:45 / cg"
40945340dc59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
   711
    "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
   712
! !
5e342b1ebe45 added #booleanAspectFor: as a code-saver
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
   713
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   714
!WindowBuilder methodsFor:'building'!
66
claus
parents:
diff changeset
   715
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   716
buildFromSpec:aSpec
176
3890e2b312e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   717
    ^ self subclassResponsibility
408
93582137e1c7 tabable
ca
parents: 374
diff changeset
   718
!
93582137e1c7 tabable
ca
parents: 374
diff changeset
   719
93582137e1c7 tabable
ca
parents: 374
diff changeset
   720
makeTabable:aComponent
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   721
    "add a component to the list of tabable components"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   722
1315
f2402458bf27 change makeTabable:
ca
parents: 1307
diff changeset
   723
    aComponent canTab:true
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
   724
1123
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   725
!
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   726
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   727
setupWindowFor:aWindow
8785a3f23e4b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1118
diff changeset
   728
    self subclassResponsibility
66
claus
parents:
diff changeset
   729
! !
100
claus
parents: 99
diff changeset
   730
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   731
!WindowBuilder methodsFor:'error handling'!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   732
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   733
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
   734
    "show error message on transcript (if Verbose is true)
1825
19ccea76d6b3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1774
diff changeset
   735
     and/or stop (if StopOnError) is true"
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   736
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   737
    Verbose == true ifTrue:[
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
   738
        Transcript showCR:('WindowBuilder: %1 aspect: <%2>' bindWith:aString with:anAspect storeString).
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   739
        application notNil ifTrue:[
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
   740
             Transcript showCR:('WindowBuilder: (while building for %1)' bindWith:application class name).
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   741
        ].
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   742
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   743
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   744
    StopOnError == true ifTrue:[
1825
19ccea76d6b3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1774
diff changeset
   745
        self halt:'aspect not found'        "/ set StopOnError to true to debug end-user apps
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   746
    ].
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   747
    ^ nil
1028
4f3401b606bd better warning when no aspect is found.
Claus Gittinger <cg@exept.de>
parents: 1010
diff changeset
   748
1395
38ccb9731d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1359
diff changeset
   749
    "Modified: / 18.8.2000 / 14:10:59 / cg"
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   750
! !
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   751
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   752
!WindowBuilder methodsFor:'message sending'!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   753
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   754
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
   755
    "send the message aSelector to the application;
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   756
     the result returned from the send or nil is returned
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   757
    "
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   758
    |cls handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   759
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   760
    aSelector notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   761
        handlerBlock := [:ex|
2011
9e7fd350205f Use MessageNotUnderstood>>#selector
Stefan Vogel <sv@exept.de>
parents: 2005
diff changeset
   762
                            (ex selector ~~ aSelector) ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   763
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   764
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   765
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   766
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   767
        application notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   768
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   769
                ^ application perform:aSelector
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   770
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   771
            cls := application class.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   772
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   773
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   774
                ^ cls perform:aSelector
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   775
            ]
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   776
        ].
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   777
        "
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   778
         WARNING:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   779
            This is a private interface for the UIPainter to pass down the app-class
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   780
        "
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   781
        applicationClass notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   782
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   783
                ^ 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
   784
            ]
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   785
        ]
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   786
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   787
  ^ aBlock value
981
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   788
6a9c975543ad also reject non-selector errors in #safelyPerform: without arg.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   789
    "Modified: / 20.6.1998 / 11:52:19 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   790
!
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   791
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   792
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
   793
    "send the one-arg-message aSelector to the application;
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   794
     the result returned from the send or nil is returned"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   795
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   796
    |handlerBlock|
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   797
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   798
    aSelector notNil ifTrue:[
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   799
        handlerBlock := [:ex| |badSel|
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   800
                            badSel := ex selector.
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   801
                            (badSel ~~ aSelector and:[badSel ~~ anArgument]) ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   802
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   803
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   804
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   805
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   806
        application notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   807
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   808
                ^ application perform:aSelector with:anArgument
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   809
            ].
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   810
            MessageNotUnderstood handle:handlerBlock do:[
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   811
                ^ application class perform:aSelector with:anArgument
595
15d80dd3d974 help text
ca
parents: 587
diff changeset
   812
            ]
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   813
        ].
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   814
        "
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   815
         WARNING:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   816
            This is a private interface for the UIPainter to pass down the app-class
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   817
        "
829
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   818
        applicationClass notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   819
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   820
                ^ applicationClass perform:aSelector with:anArgument
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   821
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   822
        ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   823
    ].
1587
9acf4f670187 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 1586
diff changeset
   824
    ^ aBlock value
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   825
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   826
    "Modified: / 4.8.1998 / 19:33:52 / cg"
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   827
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   828
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   829
safelyPerform:aSelector with:arg1 with:arg2 ifNone:aBlock
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   830
    "send the two-arg-message aSelector to the application;
2005
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   831
     the result returned from the send or nil is returned"
e75677d13d3b code cleanup
Claus Gittinger <cg@exept.de>
parents: 2001
diff changeset
   832
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   833
    |cls handlerBlock|
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   834
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   835
    aSelector notNil ifTrue:[
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   836
        handlerBlock := [:ex|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   837
                            |badSel|
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   838
2011
9e7fd350205f Use MessageNotUnderstood>>#selector
Stefan Vogel <sv@exept.de>
parents: 2005
diff changeset
   839
                            badSel := ex selector.
1096
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   840
                            (badSel ~~ aSelector and:[badSel ~~ arg1]) ifTrue:[
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   841
                                ex reject
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   842
                            ]
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   843
                        ].
14a4fdeecd02 avoid generation of multiple handlerBlocks in savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   844
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   845
        application notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   846
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   847
                ^ application perform:aSelector with:arg1 with:arg2
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   848
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   849
            cls := application class.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   850
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   851
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   852
                ^ 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
   853
            ]
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
   854
        ].
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   855
        "
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   856
         WARNING:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   857
            This is a private interface for the UIPainter to pass down the app-class
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   858
        "
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   859
        applicationClass notNil ifTrue:[
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
   860
            MessageNotUnderstood handle:handlerBlock do:[
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   861
                ^ applicationClass perform:aSelector with:arg1 with:arg2
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   862
            ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   863
        ]
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   864
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   865
  ^ aBlock value
970
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   866
d8920428eb28 undid some exception handling stuff;
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   867
    "Modified: / 18.6.1998 / 21:40:13 / cg"
586
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   868
! !
8889c3e9a226 creation of
ca
parents: 577
diff changeset
   869
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   870
!WindowBuilder methodsFor:'spec creation aspect fetch'!
100
claus
parents: 99
diff changeset
   871
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   872
actionFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   873
    "return an action for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   874
     (by the builder) to ask for an ActionButtons actionBlock.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   875
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   876
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   877
     The returned object is typically a block."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   878
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   879
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   880
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   881
    bindings notNil ifTrue:[
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   882
        b := bindings at:aKey ifAbsent:nil.
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   883
        b notNil ifTrue:[^ b].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   884
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   885
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   886
    ^ self safelyPerform:#actionFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   887
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   888
                  ifNone:[ self aspectNotFound:aKey error:'no action for:'. [] ]
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   889
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   890
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   891
actionFor:aKey withValue:aValue
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   892
    "return an action for aKey/value combonation. 
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   893
     This is invoked during window building
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   894
     (by the builder) to ask for an ActionButtons actionBlock if that button
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   895
     specified an action with an argument value.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   896
     Here, first the local bindings are searched, then the application and
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   897
     finally the applications class is asked for a corresponding action.
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   898
     The returned object is typically a block."
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   899
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   900
    |b|
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   901
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   902
    bindings notNil ifTrue:[
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   903
        b := bindings at:aKey ifAbsent:nil.
1198
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   904
        b notNil ifTrue:[
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   905
            (b isBlock and:[b numArgs == 1]) ifTrue:[
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   906
                ^ [:arg | b value:arg]
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   907
            ].
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   908
            ^ b
b10129322a0c another convenient method: #listAspectFor:
Claus Gittinger <cg@exept.de>
parents: 1155
diff changeset
   909
        ].
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   910
    ].
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   911
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   912
    ^ self safelyPerform:#actionFor:withValue:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   913
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   914
                    with:aValue
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   915
                  ifNone:[ self aspectNotFound:aKey error:'no action for:'. [:dummy |] ]
716
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   916
!
a23d48401446 actionFor:aKey withValue:aValue
ca
parents: 707
diff changeset
   917
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   918
aspectFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   919
    "return a model for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   920
     (by the builder) to ask for an Editfields, a Toggles etc. model.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   921
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   922
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   923
     The returned object is typically a valueHolder."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   924
434
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   925
    |b|
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   926
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   927
    bindings notNil ifTrue:[
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   928
        b := bindings at:aKey ifAbsent:nil.
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   929
        b notNil ifTrue:[^ b].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   930
    ].
eeb7ba6aede3 *** empty log message ***
ca
parents: 433
diff changeset
   931
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   932
    ^ self safelyPerform:#aspectFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   933
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   934
                  ifNone:[ self aspectAt:aKey ]
374
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   935
!
5be095a54715 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   936
1031
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   937
aspectFor:aKey ifAbsent:exceptionBlock
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   938
    "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
   939
     (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
   940
     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
   941
     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
   942
     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
   943
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   944
    |b|
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   945
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   946
    bindings notNil ifTrue:[
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   947
        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
   948
        b notNil ifTrue:[^ b].
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   949
    ].
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   950
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   951
    ^ self safelyPerform:#aspectFor:
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   952
                    with:aKey
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   953
                  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
   954
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   955
    "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
   956
!
0f80a655cf09 allow suppress of warnings if spec thinks the aspect is
Claus Gittinger <cg@exept.de>
parents: 1028
diff changeset
   957
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   958
componentFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   959
    "return a component for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   960
     (by the builder) to ask for an ArbitraryComponents view.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   961
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   962
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   963
     The returned object is typically a view."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   964
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   965
    ^ self safelyPerform:#componentFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   966
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   967
                  ifNone:[ self aspectAt:aKey ]
423
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   968
!
64c2d739caf1 *** empty log message ***
ca
parents: 422
diff changeset
   969
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   970
labelFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   971
    "return a label for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   972
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   973
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   974
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   975
     The returned object is typically a string."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   976
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   977
    ^ self safelyPerform:#labelFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   978
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   979
                  ifNone:[ self aspectAt:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   980
!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   981
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
   982
listFor:aKey
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   983
    "return a list for aKey. This is invoked during window building
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   984
     (by the builder) to ask for a ???'s label.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   985
     Here, first the local bindings are searched, then the application and
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   986
     finally the applications class is asked for a corresponding action.
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   987
     The returned object is typically a list."
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
   988
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   989
    ^ self safelyPerform:#listFor:
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   990
                    with:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   991
                  ifNone:[ self aspectAt:aKey ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   992
!
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   993
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   994
menuFor:aKey
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   995
    "Find a binding for the menu named aKey, either in the bindings 
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   996
     or from the source"
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   997
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   998
    |menu|
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
   999
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1000
    aKey isNil ifTrue:[^ nil].
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1001
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1002
    (menu := self bindingAt:aKey) notNil ifTrue:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1003
        ^ menu
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1004
    ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1005
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1006
    menu := self safelyPerform:#menuFor: with:aKey ifNone:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1007
                    self safelyPerform:aKey ifNone:[
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1008
                        self aspectNotFound:aKey error:'no menu for:'.
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1009
                        nil
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1010
                    ]
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1011
                 ].
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1012
862
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
  1013
    menu isBlock ifFalse:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
  1014
        ((menu := menu value) notNil and:[application notNil]) ifTrue:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
  1015
            menu isArray ifTrue:[
812e53d6c482 bug fix:
ca
parents: 855
diff changeset
  1016
                menu := Menu new fromLiteralArrayEncoding:menu.
1533
b6b2f8ab4e4a findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents: 1520
diff changeset
  1017
                "/ menu receiver:application. -- now done in findGuiResources ...
924
4680e2fe4728 must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents: 862
diff changeset
  1018
            ].
4680e2fe4728 must care for resource-label translation of a menu
Claus Gittinger <cg@exept.de>
parents: 862
diff changeset
  1019
            menu findGuiResourcesIn:application
450
2a6e2eb653f0 so far ...
ca
parents: 436
diff changeset
  1020
        ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1021
    ].
848
c0fab03dd225 access mechanism for aspects
ca
parents: 835
diff changeset
  1022
    ^ menu
717
b89142a61d05 #aspectAt: must also ask class.
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
  1023
961
babdad518c1d in #savelyPerform:
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1024
    "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
  1025
!
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1026
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1027
specificationFor:aKey
d4cd3635d64e Fix #subcanvasAt:at to be consistent with other binding access methods.
Stefan Vogel <sv@exept.de>
parents: 824
diff changeset
  1028
    "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
  1029
     (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
  1030
     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
  1031
     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
  1032
     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
  1033
1585
0b9acf055c3c resources
ca
parents: 1564
diff changeset
  1034
    ^ self 
0b9acf055c3c resources
ca
parents: 1564
diff changeset
  1035
        safelyPerform:#specificationFor:
0b9acf055c3c resources
ca
parents: 1564
diff changeset
  1036
        with:aKey
0b9acf055c3c resources
ca
parents: 1564
diff changeset
  1037
        ifNone:[ self aspectFor:aKey ]
422
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1038
! !
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1039
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1040
!WindowBuilder methodsFor:'spec creation callbacks'!
ccffe7647895 changed binding access
ca
parents: 420
diff changeset
  1041
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1042
createdComponent:aView forSpec:spec named:name
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1043
    "callback from the UISpec after a view has been
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1044
     created for a spec.
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1045
     If it has a name, add it to the namedComponents dictionary;
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1046
     if I have a creationHook (application callBack), evaluate it."
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1047
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1048
    name notNil ifTrue:[
1993
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1049
"/        "/ debugging ...
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1050
"/        (namedComponents notNil and:[namedComponents includesKey:name asSymbol]) ifTrue:[
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1051
"/            Transcript showCR:'WARNING multiple UI-build of: ',name asSymbol
765d49601916 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1992
diff changeset
  1052
"/        ].
1992
d405474ca0c7 +findVisibleComponentAt:
Claus Gittinger <cg@exept.de>
parents: 1971
diff changeset
  1053
        self componentAt:name put:aView.
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1054
    ].
410
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
  1055
    componentCreationHook notNil ifTrue:[
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
  1056
        componentCreationHook value:aView value:spec value:self
2d21748e0d9c checkin from browser
ca
parents: 408
diff changeset
  1057
    ]
100
claus
parents: 99
diff changeset
  1058
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1059
    "Modified: / 5.9.1995 / 21:42:54 / claus"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1060
    "Created: / 31.10.1997 / 18:47:01 / cg"
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1061
    "Modified: / 31.10.1997 / 18:51:22 / cg"
100
claus
parents: 99
diff changeset
  1062
! !
claus
parents: 99
diff changeset
  1063
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1064
!WindowBuilder methodsFor:'startup'!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1065
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1066
closeRequest
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1067
    window destroy
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1068
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1069
    "Modified: 17.1.1997 / 19:30:32 / cg"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1070
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1071
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1072
open
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1073
    "open my topView, as previously created"
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1074
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1075
    |type|
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1076
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1077
    application isNil ifTrue:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1078
        type := #normal
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1079
    ] ifFalse:[
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1080
        type := application defaultWindowType
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1081
    ].
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1082
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1083
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1084
        withExtent:nil
477
4473bdcb24cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 475
diff changeset
  1085
        andType:type
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1086
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1087
!
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1088
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1089
openAt:aPoint
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1090
    "open my topView at some location"
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1091
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1092
    ^ self 
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
  1093
        openAt:aPoint 
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
  1094
        withExtent:nil  
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1095
        andType:(application defaultWindowType)
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1096
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1097
    "Created: 14.2.1997 / 20:21:57 / cg"
467
8fb5fa11956c better dialog opening
Claus Gittinger <cg@exept.de>
parents: 463
diff changeset
  1098
    "Modified: 28.2.1997 / 22:50:29 / cg"
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1099
!
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1100
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1101
openDialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1102
    "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
  1103
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1104
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1105
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1106
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1107
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1108
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1109
!
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
openDialogAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1112
    "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
  1113
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1114
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1115
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1116
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1117
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1118
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1119
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1120
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1121
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1122
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1123
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1124
openDialogAt:aPoint withExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1125
    "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
  1126
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1127
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1128
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1129
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1130
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1131
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1132
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1133
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1134
    "Created: 14.2.1997 / 20:24:19 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1135
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1136
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1137
openDialogWithExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1138
    "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
  1139
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1140
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1141
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1142
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1143
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1144
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1145
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1146
    "Modified: 17.1.1997 / 19:59:36 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1147
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1148
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1149
openModal
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1150
    "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
  1151
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1152
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1153
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1154
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1155
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1156
        andType:#dialog
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1157
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1158
    "Modified: 3.3.1997 / 19:43:57 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1159
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1160
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1161
openPopUpAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1162
    "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
  1163
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1164
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1165
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1166
        openAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1167
        withExtent:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1168
        andType:#popUp
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1169
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1170
    "Modified: 17.1.1997 / 19:59:29 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1171
    "Created: 14.2.1997 / 20:24:38 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1172
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1173
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1174
openPopUpIn:aRectangle
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1175
    "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
  1176
     blocking interaction to the currently active view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1177
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1178
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1179
        openAt:aRectangle origin
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1180
        withExtent:aRectangle extent 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1181
        andType:#popUp
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1182
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1183
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1184
openWindow
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1185
    "open my topView"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1186
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1187
    ^ self
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1188
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1189
        withExtent:nil  
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1190
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1191
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1192
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1193
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1194
openWindowAt:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1195
    "open my topView at some location"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1196
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1197
    ^ self
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1198
        openAt:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1199
        withExtent:nil  
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1200
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1201
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1202
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1203
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1204
openWindowAt:origin withExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1205
    "open my window, as previously created, optionally defining the
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1206
     windows origin and/or extent. 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1207
     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
  1208
     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
  1209
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1210
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1211
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1212
        openAt:origin 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1213
        withExtent:ext
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1214
        andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1215
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1216
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1217
openWindowCenter
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1218
    "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
  1219
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1220
    ^ self
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1221
        openAt:#center 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1222
        withExtent:nil  
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1223
        andType:(application defaultWindowType)
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1224
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1225
!
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1226
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1227
openWithExtent:aPoint
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1228
    "open my topView, as previously created, but override
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1229
     the extent."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1230
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1231
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1232
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1233
        withExtent:aPoint 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1234
        andType:(application defaultWindowType)
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1235
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1236
    "Modified: 17.1.1997 / 19:58:48 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1237
!
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1238
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1239
openWithExtent:ext andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1240
    "open my window, as previously created. The type argument
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1241
     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
  1242
     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
  1243
     active view, or as a normal view."
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1244
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1245
    ^ self 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1246
        openAt:nil 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1247
        withExtent:ext 
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1248
        andType:type
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1249
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1250
    "Modified: 14.2.1997 / 20:22:47 / cg"
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1251
! !
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1252
1766
7e15dd50e11a method category rename
Claus Gittinger <cg@exept.de>
parents: 1763
diff changeset
  1253
!WindowBuilder methodsFor:'startup-basic'!
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1254
436
b5e56e1f367f checkin from browser
ca
parents: 434
diff changeset
  1255
openAt:origin withExtent:ext andType:type
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1256
    "open my window, as previously created, optionally defining the
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1257
     windows origin and/or extent. 
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1258
     The type argument may be #dialog, #popup or #normal, 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1259
     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
  1260
        modal view (blocking interaction to the currently active view), 
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1261
        as popUp (also blocking)
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1262
        or as a normal view."
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1263
1774
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1264
    |appWinClass device wg mainWin|
1359
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1265
1672
84088ccd59a3 code rewrite
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1266
    device := window device.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1267
    origin notNil ifTrue:[
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1268
        "/ kludge
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1269
        origin ~~ #center ifTrue:[
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1270
            window origin:origin
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1271
        ]
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1272
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1273
    ext notNil ifTrue:[
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1274
        window extent:ext.
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1275
    ] ifFalse:[
2015
395f58bb269d *** empty log message ***
ca
parents: 2011
diff changeset
  1276
        ((type == #dialog) or:[type == #toolDialog]) ifTrue:[
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1277
            window fixSize
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1278
        ]
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1279
    ].
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1280
2015
395f58bb269d *** empty log message ***
ca
parents: 2011
diff changeset
  1281
    ((type == #dialog) or:[type == #toolDialog]) ifTrue:[
1520
6ee198fcb0e0 honor forceModalToCenter
Claus Gittinger <cg@exept.de>
parents: 1505
diff changeset
  1282
        ((origin isNil and:[window class forceModalBoxesToOpenAtCenter])
1879
0c9ba6cc5a9a Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents: 1825
diff changeset
  1283
         or:[origin == #center]) ifTrue:[
0c9ba6cc5a9a Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents: 1825
diff changeset
  1284
            window origin:((device center - (window extent // 2)) max:0@0)
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1285
        ] ifFalse:[
1774
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1286
            wg := WindowGroup activeGroup.
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1287
            wg notNil ifTrue:[ 
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1288
                wg := wg mainGroup.
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1289
                mainWin := wg topViews firstIfEmpty:nil.
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1290
            ].
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1291
            mainWin notNil ifTrue:[
1879
0c9ba6cc5a9a Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents: 1825
diff changeset
  1292
                window origin:((mainWin center - (window extent // 2)) max:0@0)
1774
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1293
            ] ifFalse:[
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1294
                window fixPosition:(device pointerPosition - window positionOffset).
28b516fbd3e9 open modal dialogs centered in their owning views
Claus Gittinger <cg@exept.de>
parents: 1766
diff changeset
  1295
            ]
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1296
        ].
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1297
        ^ window openModal.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1298
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1299
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1300
    (type == #normal or:[type = #slave or:[type = #partner]]) ifTrue:[
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1301
        window isNil ifTrue:[
1359
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1302
            application notNil ifTrue:[
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1303
                appWinClass := application applicationWindowClass
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1304
            ] ifFalse:[
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1305
                appWinClass := ApplicationWindow
f40bfb94f862 allow for application to decide what type of
Claus Gittinger <cg@exept.de>
parents: 1357
diff changeset
  1306
            ].
1879
0c9ba6cc5a9a Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents: 1825
diff changeset
  1307
            self setupWindowFor:appWinClass new.
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1308
        ].
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1309
        origin == #center ifTrue:[
1879
0c9ba6cc5a9a Keep the title bar of a modal window in the visible area
Stefan Vogel <sv@exept.de>
parents: 1825
diff changeset
  1310
            window origin:((device center - (window extent // 2)) max:0@0)
1118
67eb0839e703 added hooks to allow openAtCenter.
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1311
        ].
480
40218790e4ba *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
  1312
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1313
        "/ the following code creates a master-slave relationship, if
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1314
        "/ the masterApplication is not nil.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1315
        "/ Disabled, because: the masterApplication is used to fulfill missing aspects,
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1316
        "/ which has nothing to do with a window master-slave relationship.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1317
        
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1318
"/        application masterApplication notNil ifTrue:[ 
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1319
"/            masterWindow := application masterApplication window.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1320
"/            (masterWindow isMaster or:[masterWindow isSlave or:[masterWindow isPartner]])
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1321
"/            ifFalse:[
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1322
"/                "/ master is neutral - make him a master
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1323
"/                masterWindow beMaster
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1324
"/            ].
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1325
"/            window beSlave.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1326
"/        ].
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1327
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1328
        "/ must be done explicit, by passing an appropriate windowType
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1329
1634
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1330
        type = #slave ifTrue:[
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1331
            window beSlave.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1332
        ].
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1333
        type = #partner ifTrue:[
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1334
            window bePartner.
64f2605c5b51 added openAsSlave
Claus Gittinger <cg@exept.de>
parents: 1587
diff changeset
  1335
        ].
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1336
1725
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1337
        ((type = #slave or:[type = #partner]) 
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1338
        and:[ window windowGroup isNil ])
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1339
        ifTrue:[
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1340
            window openInGroup:(WindowGroup activeGroup).
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1341
        ] ifFalse:[
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1342
            window open.
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1343
        ].
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1344
a9945722dab2 openAsSlave makes view a slave, but NOT the current view a master
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
  1345
"/ the following automatism is probably too cryptic and has too much of a side effect.
1722
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1346
"/ I prefer to leave things as they are: i.e. enforce the programmer to
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1347
"/ do thinks explicit.
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1348
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1349
"/        type = #slave ifTrue:[
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1350
"/            window windowGroup topViews first beMaster
7d37db741aa4 comment
Claus Gittinger <cg@exept.de>
parents: 1673
diff changeset
  1351
"/        ].
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1352
        ^ self
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1353
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1354
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1355
    type == #popUp ifTrue:[
1672
84088ccd59a3 code rewrite
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1356
        window fixPosition:(device pointerPosition).
1092
20104ea94915 cleaned up all #openWindow* methods
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
  1357
        ^ window openAsPopUp.
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1358
    ].
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1359
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1360
    "
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1361
     if ST-80 supports more types - these may be added later
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1362
    "
1825
19ccea76d6b3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1774
diff changeset
  1363
    self shouldImplement
428
25f3b4964f14 more startup variations
Claus Gittinger <cg@exept.de>
parents: 424
diff changeset
  1364
735
4b66677877e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1365
    "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
  1366
    "Modified: / 18.6.1998 / 19:10:07 / cg"
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1367
! !
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
  1368
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1369
!WindowBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1370
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1371
version
2015
395f58bb269d *** empty log message ***
ca
parents: 2011
diff changeset
  1372
    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.120 2004-09-20 08:44:31 ca Exp $'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1373
! !