UIBuilder.st
author Claus Gittinger <cg@exept.de>
Wed, 17 Sep 1997 20:11:14 +0200
changeset 698 f7e53b928204
parent 667 fe63e8ecb0d3
child 721 1889d708a951
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
88
claus
parents: 86
diff changeset
     1
"
claus
parents: 86
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
100
claus
parents: 96
diff changeset
     3
	      All Rights Reserved
88
claus
parents: 86
diff changeset
     4
claus
parents: 86
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 86
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 86
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 86
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 86
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 86
diff changeset
    10
 hereby transferred.
claus
parents: 86
diff changeset
    11
"
claus
parents: 86
diff changeset
    12
100
claus
parents: 96
diff changeset
    13
WindowBuilder subclass:#UIBuilder
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    14
	instanceVariableNames:'view currentMenuSelector menuAspect spec specStack composite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    15
		lastComponent compositeView'
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    16
	classVariableNames:'Verbose'
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    17
	poolDictionaries:''
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    18
	category:'Interface-Support-UI'
66
claus
parents:
diff changeset
    19
!
claus
parents:
diff changeset
    20
claus
parents:
diff changeset
    21
!UIBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    22
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    23
copyright
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    24
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    26
	      All Rights Reserved
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    27
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    28
 This software is furnished under a license and may be used
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    29
 only in accordance with the terms of that license and with the
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    31
 be provided or otherwise made available to, or used by, any
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    32
 other person.  No title to or ownership of the software is
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    33
 hereby transferred.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    34
"
88
claus
parents: 86
diff changeset
    35
!
claus
parents: 86
diff changeset
    36
66
claus
parents:
diff changeset
    37
documentation
claus
parents:
diff changeset
    38
"
claus
parents:
diff changeset
    39
    this class will (eventually) allow parsing windowSpecs as
claus
parents:
diff changeset
    40
    created by ST-80's UIPainter, and thereby allow to run applications
claus
parents:
diff changeset
    41
    built with this tool.
claus
parents:
diff changeset
    42
    It was created to allow execution of PD applications which were
claus
parents:
diff changeset
    43
    written using that tool (and more and more are appearing ...).
claus
parents:
diff changeset
    44
claus
parents:
diff changeset
    45
    The class is not completed yet and certainly not bug free.
claus
parents:
diff changeset
    46
    Also, it is not quaranteed that all winSpecs are understood.
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    47
373
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    48
    Notice: 
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    49
        this class was implemented using protocol information
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    50
        from alpha testers, literature and by read public domain code
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    51
        - it may not be complete or compatible to
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    52
        the corresponding ST-80 class. 
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    53
        If you encounter any incompatibilities, please forward a note 
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    54
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
66283cb455bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
    55
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    56
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    57
        Claus Gittinger
66
claus
parents:
diff changeset
    58
"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    59
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    60
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    61
examples
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    62
"
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    63
    examples to be added.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    64
"
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    65
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    66
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    67
history
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    68
    "Created: 3.3.1997 / 19:33:13 / cg"
66
claus
parents:
diff changeset
    69
! !
claus
parents:
diff changeset
    70
claus
parents:
diff changeset
    71
!UIBuilder class methodsFor:'initialization'!
claus
parents:
diff changeset
    72
claus
parents:
diff changeset
    73
initialize
claus
parents:
diff changeset
    74
    Verbose := false    "/ debugging flag
claus
parents:
diff changeset
    75
! !
claus
parents:
diff changeset
    76
86
claus
parents: 80
diff changeset
    77
!UIBuilder methodsFor:'accessing'!
claus
parents: 80
diff changeset
    78
claus
parents: 80
diff changeset
    79
menuAspect
claus
parents: 80
diff changeset
    80
    ^ menuAspect
claus
parents: 80
diff changeset
    81
! !
claus
parents: 80
diff changeset
    82
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    83
!UIBuilder methodsFor:'building'!
66
claus
parents:
diff changeset
    84
367
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
    85
add:aSpec
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    86
    |collectedComponents|
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    87
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    88
    composite notNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    89
        (collectedComponents := composite collection) isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    90
            composite collection:(collectedComponents := OrderedCollection new).
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    91
        ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    92
        collectedComponents add:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    93
        view := aSpec buildViewWithLayoutFor:self in:compositeView.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    94
    ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    95
        spec isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    96
            spec := FullSpec new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    97
        ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    98
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
    99
        (aSpec isMemberOf:WindowSpec) ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   100
            spec window:aSpec
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   101
        ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   102
            ((aSpec isMemberOf:ComponentSpec)
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   103
            or:[(aSpec isMemberOf:SpecCollection)]) ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   104
                spec component:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   105
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   106
                window isNil ifTrue:[
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   107
                    window := windowView := View new.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   108
                ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   109
                aSpec buildViewWithLayoutFor:self in:window.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   110
"/ builder window displayBox
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   111
                composite := aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   112
                compositeView := window.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   113
            ] ifFalse:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   114
                spec component isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   115
                    spec component:SpecCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   116
                    spec component collection:OrderedCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   117
                    composite := spec component.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   118
                    window isNil ifTrue:[
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   119
                        window := windowView := View new.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   120
                    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   121
                    compositeView := window.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   122
                ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   123
                spec component collection add:aSpec.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   124
                view := aSpec buildViewWithLayoutFor:self in:compositeView.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   125
            ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   126
        ]
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   127
    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   128
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   129
    lastComponent := view.
367
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   130
    ^ view
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   131
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   132
    "Modified: 3.3.1997 / 22:03:02 / cg"
367
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   133
!
7316abe03075 made obsolete stuff ignored
Claus Gittinger <cg@exept.de>
parents: 363
diff changeset
   134
474
c337e7ad2220 buildin user defined window
ca
parents: 373
diff changeset
   135
buildFromSpec:aSpecOrSpecArray
100
claus
parents: 96
diff changeset
   136
    |m spec|
claus
parents: 96
diff changeset
   137
474
c337e7ad2220 buildin user defined window
ca
parents: 373
diff changeset
   138
    window notNil ifTrue:[
c337e7ad2220 buildin user defined window
ca
parents: 373
diff changeset
   139
        ^ self buildFromSpec:aSpecOrSpecArray in:window
c337e7ad2220 buildin user defined window
ca
parents: 373
diff changeset
   140
    ].
100
claus
parents: 96
diff changeset
   141
474
c337e7ad2220 buildin user defined window
ca
parents: 373
diff changeset
   142
    spec := UISpecification from:aSpecOrSpecArray.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   143
    window := spec buildViewFor:self.
100
claus
parents: 96
diff changeset
   144
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   145
"/    menuAspect notNil ifTrue:[
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   146
"/        m := self componentAt:menuAspect.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   147
"/        m notNil ifTrue:[
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   148
"/            m := m value.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   149
"/            m notNil ifTrue:[
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   150
"/                m receiver:application.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   151
"/                window add:m.
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   152
"/                view topInset:(m heightIncludingBorder).
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   153
"/            ]
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   154
"/        ]
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   155
"/    ].
86
claus
parents: 80
diff changeset
   156
372
6d7718f3d298 more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   157
    ^ window
66
claus
parents:
diff changeset
   158
100
claus
parents: 96
diff changeset
   159
    "Modified: 5.9.1995 / 21:43:29 / claus"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   160
    "Modified: 3.3.1997 / 18:43:50 / cg"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   161
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   162
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   163
buildFromSpec:aSpecArray in:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   164
    |m spec|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   165
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   166
    spec := UISpecification from:aSpecArray.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   167
    ^ spec buildViewFor:self in:aView.
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   168
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   169
    "Modified: 3.3.1997 / 18:44:02 / cg"
363
c7a26a5ebaba doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   170
!
c7a26a5ebaba doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   171
c7a26a5ebaba doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   172
doFinalHookup
c7a26a5ebaba doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   173
c7a26a5ebaba doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 344
diff changeset
   174
    "Created: 14.2.1997 / 14:52:27 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   175
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   176
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   177
endComposite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   178
    |entry|
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   179
497
6544ec670fe0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 479
diff changeset
   180
    (specStack notNil and:[specStack notEmpty]) ifTrue:[
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   181
        entry := specStack removeLast.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   182
        composite := entry key.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   183
        compositeView := entry value.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   184
    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   185
    ^ composite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   186
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   187
    "Created: 3.3.1997 / 17:17:43 / cg"
497
6544ec670fe0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 479
diff changeset
   188
    "Modified: 6.3.1997 / 16:18:05 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   189
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   190
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   191
endCompositeLayout:layout
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   192
    composite compositeSpec:(CompositeSpec new layout:layout).
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   193
    compositeView layout:layout.
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   194
    self endComposite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   195
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   196
    "Modified: 3.3.1997 / 20:54:35 / cg"
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   197
!
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   198
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   199
endCompositeLayout:layout properties:props
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   200
    self endCompositeLayout:layout
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   201
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   202
    "Created: 3.3.1997 / 22:15:17 / cg"
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   203
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   204
585
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   205
menuAt:aKey
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   206
    "Find a binding for the menu named aKey, either in the bindings 
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   207
     cache, or from the source 
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   208
    "
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   209
    | menu |
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   210
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   211
    menu := self bindingAt:aKey.
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   212
    menu isNil ifTrue:[
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   213
        menu := self safelyPerform:#menuFor: with:aKey.
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   214
        menu isNil ifTrue:[
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   215
            menu := self safelyPerform:aKey
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   216
        ].
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   217
        menu := menu value.
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   218
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   219
        (application notNil and:[menu notNil]) ifTrue:[
667
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   220
            menu isArray ifTrue:[
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   221
                menu := Menu new fromLiteralArrayEncoding:menu.
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   222
                menu receiver:application.
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   223
              ^ menu
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   224
            ].
585
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   225
            menu findGuiResourcesIn:application
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   226
        ]
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   227
    ].
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   228
  ^ menu
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   229
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   230
!
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   231
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   232
menuAt:aSymbol put:aModel
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   233
    "Install value as the binding for the menu named aKey in the
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   234
     bindings cache
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   235
    "
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   236
  ^ self aspectAt:aSymbol put:aModel
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   237
!
458fc4cd1437 creation of
ca
parents: 503
diff changeset
   238
478
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   239
newComposite
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   240
    |newComposite|
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   241
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   242
    specStack isNil ifTrue:[
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   243
        specStack := OrderedCollection new
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   244
    ].
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   245
    specStack addLast:(composite->compositeView).
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   246
    newComposite := CompositeSpecCollection new.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   247
    newComposite compositeSpec:(CompositeSpec new).
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   248
    compositeView := self add:newComposite.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   249
    composite := newComposite.
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   250
    ^ compositeView
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   251
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   252
    "Created: 3.3.1997 / 17:15:36 / cg"
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   253
    "Modified: 3.3.1997 / 18:55:13 / cg"
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   254
!
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   255
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   256
wrapper
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   257
    ^ view
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   258
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   259
    "Created: 3.3.1997 / 18:28:31 / cg"
ae8c1aaac281 more ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 474
diff changeset
   260
    "Modified: 3.3.1997 / 18:44:12 / cg"
100
claus
parents: 96
diff changeset
   261
! !
86
claus
parents: 80
diff changeset
   262
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   263
!UIBuilder methodsFor:'initialization'!
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   264
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   265
setupWindowFor:aView
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   266
    |ext|
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   267
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   268
    window notNil ifTrue:[
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   269
        ext := window extent.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   270
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   271
        ((window isMemberOf:View)
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   272
        or:[window isMemberOf:SimpleView]) ifTrue:[
607
054b3195f908 added message to debugHalt
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   273
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   274
windowView ~~ window ifTrue:[
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   275
    windowView isNil ifTrue:[
607
054b3195f908 added message to debugHalt
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   276
        self halt:'debug halt - should not happen'
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   277
    ]
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   278
].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   279
            aView addSubView:window.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   280
        ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   281
    ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   282
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   283
    window := aView.
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   284
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   285
    aView container isNil ifTrue:[
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   286
        spec notNil ifTrue:[
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   287
            spec window setupView:window for:self
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   288
        ]
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   289
    ].
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   290
607
054b3195f908 added message to debugHalt
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   291
    "Modified: 17.6.1997 / 18:03:54 / cg"
479
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   292
! !
8058c8296148 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 478
diff changeset
   293
503
23faf6064747 implementing:
ca
parents: 497
diff changeset
   294
!UIBuilder methodsFor:'misc'!
23faf6064747 implementing:
ca
parents: 497
diff changeset
   295
23faf6064747 implementing:
ca
parents: 497
diff changeset
   296
newSubBuilder
23faf6064747 implementing:
ca
parents: 497
diff changeset
   297
    |builder|
23faf6064747 implementing:
ca
parents: 497
diff changeset
   298
23faf6064747 implementing:
ca
parents: 497
diff changeset
   299
    builder := UIBuilder new.
23faf6064747 implementing:
ca
parents: 497
diff changeset
   300
    builder bindings:(self bindings).
23faf6064747 implementing:
ca
parents: 497
diff changeset
   301
    builder application:(self application).
23faf6064747 implementing:
ca
parents: 497
diff changeset
   302
    ^ builder
23faf6064747 implementing:
ca
parents: 497
diff changeset
   303
! !
23faf6064747 implementing:
ca
parents: 497
diff changeset
   304
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   305
!UIBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   306
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   307
version
667
fe63e8ecb0d3 menuAt:aKey
ca
parents: 607
diff changeset
   308
    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.27 1997-07-17 10:09:13 ca Exp $'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   309
! !
100
claus
parents: 96
diff changeset
   310
UIBuilder initialize!