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