UIBuilder.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:43:54 +0200
changeset 223 b65dc250db8d
parent 139 779ae6adb925
child 270 229eb729da57
permissions -rw-r--r--
documentation
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
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    14
	instanceVariableNames:'view currentMenuSelector menuAspect spec'
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    15
	classVariableNames:'Verbose'
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    16
	poolDictionaries:''
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    17
	category:'Interface-Support-UI'
66
claus
parents:
diff changeset
    18
!
claus
parents:
diff changeset
    19
claus
parents:
diff changeset
    20
!UIBuilder class methodsFor:'documentation'!
claus
parents:
diff changeset
    21
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    22
copyright
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    23
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    25
	      All Rights Reserved
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    26
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    27
 This software is furnished under a license and may be used
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    28
 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
    29
 inclusion of the above copyright notice.   This software may not
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    30
 be provided or otherwise made available to, or used by, any
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    31
 other person.  No title to or ownership of the software is
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    32
 hereby transferred.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    33
"
88
claus
parents: 86
diff changeset
    34
!
claus
parents: 86
diff changeset
    35
66
claus
parents:
diff changeset
    36
documentation
claus
parents:
diff changeset
    37
"
claus
parents:
diff changeset
    38
    this class will (eventually) allow parsing windowSpecs as
claus
parents:
diff changeset
    39
    created by ST-80's UIPainter, and thereby allow to run applications
claus
parents:
diff changeset
    40
    built with this tool.
claus
parents:
diff changeset
    41
    It was created to allow execution of PD applications which were
claus
parents:
diff changeset
    42
    written using that tool (and more and more are appearing ...).
claus
parents:
diff changeset
    43
claus
parents:
diff changeset
    44
    The class is not completed yet and certainly not bug free.
claus
parents:
diff changeset
    45
    Also, it is not quaranteed that all winSpecs are understood.
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    46
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    47
    [author:]
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
    48
        Claus Gittinger
66
claus
parents:
diff changeset
    49
"
claus
parents:
diff changeset
    50
! !
claus
parents:
diff changeset
    51
claus
parents:
diff changeset
    52
!UIBuilder class methodsFor:'initialization'!
claus
parents:
diff changeset
    53
claus
parents:
diff changeset
    54
initialize
claus
parents:
diff changeset
    55
    Verbose := false    "/ debugging flag
claus
parents:
diff changeset
    56
! !
claus
parents:
diff changeset
    57
86
claus
parents: 80
diff changeset
    58
!UIBuilder methodsFor:'accessing'!
claus
parents: 80
diff changeset
    59
claus
parents: 80
diff changeset
    60
menuAspect
claus
parents: 80
diff changeset
    61
    ^ menuAspect
claus
parents: 80
diff changeset
    62
! !
claus
parents: 80
diff changeset
    63
66
claus
parents:
diff changeset
    64
!UIBuilder methodsFor:'operation'!
claus
parents:
diff changeset
    65
100
claus
parents: 96
diff changeset
    66
buildFromSpec:aSpecArray
claus
parents: 96
diff changeset
    67
    |m spec|
claus
parents: 96
diff changeset
    68
claus
parents: 96
diff changeset
    69
"/ old:
claus
parents: 96
diff changeset
    70
"/    self readSpec:aSpecArray.
claus
parents: 96
diff changeset
    71
claus
parents: 96
diff changeset
    72
    spec := UISpecification from:aSpecArray.
claus
parents: 96
diff changeset
    73
    topView := view := spec buildViewFor:self.
claus
parents: 96
diff changeset
    74
claus
parents: 96
diff changeset
    75
    menuAspect notNil ifTrue:[
114
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    76
	m := self componentAt:menuAspect.
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    77
	m notNil ifTrue:[
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    78
	    m := m value.
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    79
	    m notNil ifTrue:[
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    80
		m receiver:application.
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    81
		topView add:m.
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    82
		view topInset:(m heightIncludingBorder).
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    83
	    ]
e577a2f332d0 uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
    84
	]
86
claus
parents: 80
diff changeset
    85
    ].
claus
parents: 80
diff changeset
    86
100
claus
parents: 96
diff changeset
    87
    ^ topView
66
claus
parents:
diff changeset
    88
100
claus
parents: 96
diff changeset
    89
    "Modified: 5.9.1995 / 21:43:29 / claus"
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    90
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    91
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    92
buildFromSpec:aSpecArray in:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    93
    |m spec|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    94
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    95
    spec := UISpecification from:aSpecArray.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    96
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    97
    view := spec buildViewFor:self in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    98
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    99
    menuAspect notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   100
	m := self componentAt:menuAspect.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   101
	m notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   102
	    m := m value.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   103
	    m notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   104
		m receiver:application.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   105
		topView add:m.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   106
		view topInset:(m heightIncludingBorder).
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   107
	    ]
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   108
	]
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   109
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   110
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   111
    ^ topView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   112
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   113
    "Modified: 5.9.1995 / 21:48:09 / claus"
100
claus
parents: 96
diff changeset
   114
! !
86
claus
parents: 80
diff changeset
   115
100
claus
parents: 96
diff changeset
   116
!UIBuilder methodsFor:'private arg parsing'!
66
claus
parents:
diff changeset
   117
100
claus
parents: 96
diff changeset
   118
getAlignmentOrigin:spec
claus
parents: 96
diff changeset
   119
    "called for #(AlignmentOrigin ?x ?relX ?x ?y ?relY ?y)"
66
claus
parents:
diff changeset
   120
100
claus
parents: 96
diff changeset
   121
    ^ AlignmentOrigin new fromLiteralArrayEncoding:spec.
claus
parents: 96
diff changeset
   122
"/    ^ Array with:#alignmentOrigin
claus
parents: 96
diff changeset
   123
"/            with:((spec at:2) @ (spec at:5))     "/ ?
claus
parents: 96
diff changeset
   124
"/            with:((spec at:3) @ (spec at:6))     "/ rels ?
claus
parents: 96
diff changeset
   125
"/            with:((spec at:4) @ (spec at:7))     "/ insets ?
66
claus
parents:
diff changeset
   126
!
claus
parents:
diff changeset
   127
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   128
getArg:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   129
    "take something like #(Point 50 100) and return the value"
66
claus
parents:
diff changeset
   130
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   131
    |what|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   132
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
    what := spec at:1.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
    ^ self perform:('get' , what , ':') asSymbol with:spec
66
claus
parents:
diff changeset
   135
!
claus
parents:
diff changeset
   136
100
claus
parents: 96
diff changeset
   137
getColorValue:spec
claus
parents: 96
diff changeset
   138
    "called for #(ColorValue #sym)
claus
parents: 96
diff changeset
   139
	     or #(ColorValue red green blue)"
66
claus
parents:
diff changeset
   140
100
claus
parents: 96
diff changeset
   141
    |clr arg|
66
claus
parents:
diff changeset
   142
100
claus
parents: 96
diff changeset
   143
    (arg := spec at:2) isSymbol ifTrue:[
claus
parents: 96
diff changeset
   144
	(Color respondsTo:arg) ifTrue:[
claus
parents: 96
diff changeset
   145
	    ^ Color perform:arg
claus
parents: 96
diff changeset
   146
	].
claus
parents: 96
diff changeset
   147
	^ Color name:arg asString ifIllegal:[Color black]
claus
parents: 96
diff changeset
   148
    ].
claus
parents: 96
diff changeset
   149
    arg isInteger ifTrue:[
claus
parents: 96
diff changeset
   150
	^ ColorValue scaledRed:arg
claus
parents: 96
diff changeset
   151
		     scaledGreen:(spec at:3)
claus
parents: 96
diff changeset
   152
		     scaledBlue:(spec at:4)
claus
parents: 96
diff changeset
   153
    ].
claus
parents: 96
diff changeset
   154
    ^ ColorValue red:arg
claus
parents: 96
diff changeset
   155
		 green:(spec at:3)
claus
parents: 96
diff changeset
   156
		 blue:(spec at:4)
66
claus
parents:
diff changeset
   157
claus
parents:
diff changeset
   158
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   159
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   160
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   161
getCompositeSpec:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   162
    "called for #(CompositeSpec layout: #(orgx orgy cornx corny)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   163
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   164
    |layout|
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 at:2) == #layout: ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   167
	layout := spec at:3.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   168
	(layout at:1) == #Rectangle ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   169
	    ^ Rectangle
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   170
		    origin:(layout at:2) @ (layout at:3)
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   171
		    corner:(layout at:4) @ (layout at:5)
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   172
	].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   173
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   174
    self halt:'unimplemented'.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   177
getLayoutFrame:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
    "called for #(LayoutFrame absOrgX relOrgX absOrgY relOrgY absCornX relCornX absCornY relCornY)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
    "             1           2       3       4        5      6        7        8        9"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   181
    ^ LayoutFrame new fromLiteralArrayEncoding:spec.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   183
"/    ^ Array with:#layoutFrame
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
"/            with:((spec at:2) @ (spec at:4))     "/ org inset
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
"/            with:((spec at:6) @ (spec at:8))     "/ corner inset
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   186
"/            with:((spec at:3) @ (spec at:5))     "/ rel org
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   187
"/            with:((spec at:7) @ (spec at:9))     "/ rel corn 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   188
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   189
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   190
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   191
getLayoutOrigin:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   192
    "called for #(LayoutOrigin xInset relX yInset relY)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   193
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   194
    ^ LayoutOrigin new fromLiteralArrayEncoding:spec.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   195
"/    ^ Array with:#layoutOrigin
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   196
"/            with:((spec at:3) @ (spec at:5))     "/ rels
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   197
"/            with:((spec at:2) @ (spec at:4))     "/ insets
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   198
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   199
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   200
getLookPreferences:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   201
    "called for #(LookPreferences setForegroundColor: (...) setBackgroundColor: (...) ...)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   202
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   203
    |coll|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   204
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   205
    coll := OrderedCollection new.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   206
    2 to:spec size by:2 do:[:index |
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   207
	coll add: 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   208
	    (Array with:(spec at:index)
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   209
		  with:(self getArg:(spec at:index+1)))
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   210
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   211
    ^ coll.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   212
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   213
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   214
getPoint:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   215
    "called for #(Point x y)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   216
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   217
    ^ Array with:#point 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   218
	    with:((spec at:2) @ (spec at:3))
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   219
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   220
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   221
getRectangle:spec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   222
    "called for #(Rectangle x y)"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   223
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   224
    ^ Array with:#rectangle
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   225
	    with:(((spec at:2) @ (spec at:3)) corner:((spec at:4) @ (spec at:5)))
66
claus
parents:
diff changeset
   226
! !
claus
parents:
diff changeset
   227
claus
parents:
diff changeset
   228
!UIBuilder methodsFor:'private spec attribute parsing'!
claus
parents:
diff changeset
   229
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   230
XXyMultipleSelections:args view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   231
    aView multipleSelectOk:args
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   232
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   233
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   234
doesNotUnderstand:aMessage
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   235
    |rest sel|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   236
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   237
    ((sel := aMessage selector) startsWith:'y') ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   238
	rest := sel copyFrom:2 to:(sel indexOf:$:).
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   239
	rest at:1 put:(rest at:1) asLowercase.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   240
	rest := rest asSymbolIfInterned.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   241
	rest notNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   242
	    (aMessage arguments at:2) perform:rest with:(aMessage arguments at:1).
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   243
	    ^ self.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   244
	]
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   245
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   246
    super doesNotUnderstand:aMessage
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   247
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   248
    "Modified: 5.9.1995 / 21:13:16 / claus"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   249
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   250
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   251
yBounds:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   252
    |value r|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   253
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   254
    value := self getArg:args.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   255
    (value at:1) == #rectangle ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   256
	r := value at:2.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   257
	aView origin:r origin corner:r corner.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   258
	^ self
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   259
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   260
    self halt:'unimplemented'.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   261
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   262
66
claus
parents:
diff changeset
   263
yCollection:args view:aView frame:frameView
claus
parents:
diff changeset
   264
    args do:[:aSpec |
claus
parents:
diff changeset
   265
	self readSpec:aSpec view:aView frame:frameView.
claus
parents:
diff changeset
   266
    ].
claus
parents:
diff changeset
   267
!
claus
parents:
diff changeset
   268
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   269
yColors:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   270
    |value|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   271
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   272
    value := self getArg:args.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   273
    self halt:'unimplemented'.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   274
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   275
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   276
yComponent:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   277
    |v|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   278
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   279
    args isSymbol ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   280
	v := application perform:args.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   281
	v origin:0.0@0.0 corner:1.0@1.0.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   282
	aView addSubView:v
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   283
    ] ifFalse:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   284
"/        v := View origin:0.0@0.0 corner:1.0@1.0 in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   285
"/        self readSpec:args view:v frame:frameView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   286
	self readSpec:args view:aView frame:frameView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   287
    ]
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   288
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   289
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   290
yCompositeSpec:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   291
    |value r|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   292
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   293
    self doSpec:args for:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   294
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   295
    value := self getArg:args.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   296
    (value at:1) == #rectangle ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   297
	r := value at:2.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   298
	aView origin:r origin corner:r corner.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   299
	^ self
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   300
    ].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   301
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   302
self halt.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   303
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   304
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   305
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   306
yDefaultable:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   307
    'defaultable ignored' printNL
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   308
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   309
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   310
yFlags:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   311
    'flags: ' print. args print. ' for ' print. aView print. ' ignored' printNL
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   312
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   313
32 : initially disabled
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   314
16 : initially invisible
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   315
 8 : border
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   316
 4 : menuBar
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   317
 2 : hScroll
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   318
 1 : vScroll
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   319
"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   320
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   321
    "Modified: 2.9.1995 / 15:44:15 / claus"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   322
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   323
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   324
yIsDefault:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   325
    aView isReturnButton:args
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   326
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   327
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   328
yIsOpaque:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   329
    'isOpaque ignored' printNL.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   330
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   331
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   332
yIsReadOnly:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   333
    args ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   334
	aView readOnly
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   335
    ]
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
66
claus
parents:
diff changeset
   338
yLayout:args view:aView frame:frameView
claus
parents:
diff changeset
   339
    |value r org corn orgInset cornInset what|
claus
parents:
diff changeset
   340
claus
parents:
diff changeset
   341
    value := self getArg:args.
100
claus
parents: 96
diff changeset
   342
    value isLayout ifTrue:[
claus
parents: 96
diff changeset
   343
	frameView geometryLayout:value.
claus
parents: 96
diff changeset
   344
	^ self
claus
parents: 96
diff changeset
   345
    ].
66
claus
parents:
diff changeset
   346
claus
parents:
diff changeset
   347
    what := value at:1.
claus
parents:
diff changeset
   348
    what == #point ifTrue:[
claus
parents:
diff changeset
   349
	Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. (value at:2) printNL].
claus
parents:
diff changeset
   350
	frameView origin:(value at:2).
claus
parents:
diff changeset
   351
	^ self
claus
parents:
diff changeset
   352
    ].
claus
parents:
diff changeset
   353
    what == #rectangle ifTrue:[
claus
parents:
diff changeset
   354
	r := value at:2.
claus
parents:
diff changeset
   355
	Verbose ifTrue:[
claus
parents:
diff changeset
   356
	    frameView print. ' ' print. 'origin: ' print. r origin print.
claus
parents:
diff changeset
   357
			     ' corner: ' print. r corner printNL.
claus
parents:
diff changeset
   358
	].
claus
parents:
diff changeset
   359
	frameView origin:r origin corner:r corner.
claus
parents:
diff changeset
   360
	^ self
claus
parents:
diff changeset
   361
    ].
claus
parents:
diff changeset
   362
    what == #layoutOrigin ifTrue:[
claus
parents:
diff changeset
   363
	"/ #layoutOrigin relOrg orgInset
claus
parents:
diff changeset
   364
	org := value at:2.       "/ relative origin
claus
parents:
diff changeset
   365
	org := org x asFloat @ org y asFloat.
claus
parents:
diff changeset
   366
	orgInset := self fixExtentFor:(value at:3).
claus
parents:
diff changeset
   367
	Verbose ifTrue:[
claus
parents:
diff changeset
   368
	    frameView print. ' ' print. 'origin: ' print. org printNL
claus
parents:
diff changeset
   369
	].
claus
parents:
diff changeset
   370
	frameView origin:org.
claus
parents:
diff changeset
   371
	frameView 
claus
parents:
diff changeset
   372
	      leftInset:orgInset x;
claus
parents:
diff changeset
   373
	      topInset:orgInset y.
claus
parents:
diff changeset
   374
	^ self
claus
parents:
diff changeset
   375
    ].
claus
parents:
diff changeset
   376
    what == #layoutFrame ifTrue:[
claus
parents:
diff changeset
   377
	"/ #layoutFrame orgInset cornInset relOrg relCorner
claus
parents:
diff changeset
   378
claus
parents:
diff changeset
   379
	org := value at:4.       "/ relative origin
claus
parents:
diff changeset
   380
	orgInset := self fixExtentFor:(value at:2).
claus
parents:
diff changeset
   381
claus
parents:
diff changeset
   382
	org := org x asFloat @ org y asFloat.
claus
parents:
diff changeset
   383
"/        org = (0@0) ifTrue:[
claus
parents:
diff changeset
   384
"/            org := value at:2    "/ absolute origin
claus
parents:
diff changeset
   385
"/        ].
claus
parents:
diff changeset
   386
claus
parents:
diff changeset
   387
	corn := value at:5.      "/ relative corner
claus
parents:
diff changeset
   388
	cornInset := self fixExtentFor:(value at:3).
claus
parents:
diff changeset
   389
	corn := corn x asFloat @ corn y asFloat.
claus
parents:
diff changeset
   390
"/        corn = (0@0) ifTrue:[
claus
parents:
diff changeset
   391
"/            corn := value at:3   "/ absolute corner
claus
parents:
diff changeset
   392
"/        ].
claus
parents:
diff changeset
   393
	Verbose ifTrue:[
claus
parents:
diff changeset
   394
	    frameView print. ' ' print. 'origin: ' print. org print.
claus
parents:
diff changeset
   395
			     ' corner: ' print. corn printNL.
claus
parents:
diff changeset
   396
	].
claus
parents:
diff changeset
   397
	frameView origin:org corner:corn.
claus
parents:
diff changeset
   398
	frameView leftInset:orgInset x;
claus
parents:
diff changeset
   399
	      topInset:orgInset y;
claus
parents:
diff changeset
   400
	      rightInset:cornInset x negated;
claus
parents:
diff changeset
   401
	      bottomInset:cornInset y negated.
claus
parents:
diff changeset
   402
	frameView sizeFixed:true.
claus
parents:
diff changeset
   403
	^ self
claus
parents:
diff changeset
   404
    ].
claus
parents:
diff changeset
   405
    what == #alignmentOrigin ifTrue:[
claus
parents:
diff changeset
   406
	org := value at:3.       "/ relative origin
claus
parents:
diff changeset
   407
	org = (0@0) ifTrue:[
claus
parents:
diff changeset
   408
	    org := value at:2    "/ absolute origin
claus
parents:
diff changeset
   409
	].
claus
parents:
diff changeset
   410
	Verbose ifTrue:[frameView print. ' ' print. 'origin: ' print. org printNL].
claus
parents:
diff changeset
   411
	frameView origin:org.
claus
parents:
diff changeset
   412
	^ self
claus
parents:
diff changeset
   413
    ].
claus
parents:
diff changeset
   414
claus
parents:
diff changeset
   415
    self halt:'unimplemented'.
claus
parents:
diff changeset
   416
!
claus
parents:
diff changeset
   417
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   418
yMax:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   419
    |value|
100
claus
parents: 96
diff changeset
   420
claus
parents: 96
diff changeset
   421
    value := self getArg:args.
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   422
    (value at:1) == #point ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   423
	aView maxExtent:(value at:2).
100
claus
parents: 96
diff changeset
   424
	^ self
claus
parents: 96
diff changeset
   425
    ].
claus
parents: 96
diff changeset
   426
    self halt:'unimplemented'.
claus
parents: 96
diff changeset
   427
!
claus
parents: 96
diff changeset
   428
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   429
yMenu:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   430
    menuAspect := args
66
claus
parents:
diff changeset
   431
!
claus
parents:
diff changeset
   432
claus
parents:
diff changeset
   433
yMin:args view:aView frame:frameView
claus
parents:
diff changeset
   434
    |value|
claus
parents:
diff changeset
   435
claus
parents:
diff changeset
   436
    value := self getArg:args.
claus
parents:
diff changeset
   437
    (value at:1) == #point ifTrue:[
claus
parents:
diff changeset
   438
	aView minExtent:(value at:2).
claus
parents:
diff changeset
   439
	^ self
claus
parents:
diff changeset
   440
    ].
claus
parents:
diff changeset
   441
    self halt:'unimplemented'.
claus
parents:
diff changeset
   442
!
claus
parents:
diff changeset
   443
claus
parents:
diff changeset
   444
yModel:args view:aView frame:frameView
claus
parents:
diff changeset
   445
    |model|
claus
parents:
diff changeset
   446
claus
parents:
diff changeset
   447
    (aspects notNil and:[aspects includesKey:args]) ifTrue:[
claus
parents:
diff changeset
   448
	model := aspects at:args
claus
parents:
diff changeset
   449
    ] ifFalse:[
86
claus
parents: 80
diff changeset
   450
	(aView isMemberOf:Button) ifTrue:[
claus
parents: 80
diff changeset
   451
	    model := application.
claus
parents: 80
diff changeset
   452
	    aView aspect:nil.
claus
parents: 80
diff changeset
   453
	    aView changeMessage:args.
claus
parents: 80
diff changeset
   454
	] ifFalse:[
claus
parents: 80
diff changeset
   455
	    model := application perform:args.
claus
parents: 80
diff changeset
   456
	].
66
claus
parents:
diff changeset
   457
    ].
claus
parents:
diff changeset
   458
    aView model:model.
claus
parents:
diff changeset
   459
!
claus
parents:
diff changeset
   460
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   461
yMultipleSelections:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   462
    args == true ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   463
	aView multipleSelectOk:true
66
claus
parents:
diff changeset
   464
    ]
claus
parents:
diff changeset
   465
!
claus
parents:
diff changeset
   466
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   467
yName:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   468
    self componentAt:args put:aView
66
claus
parents:
diff changeset
   469
!
claus
parents:
diff changeset
   470
claus
parents:
diff changeset
   471
yOrientation:args view:aView frame:frameView
claus
parents:
diff changeset
   472
    'orientation ignored' printNL.
claus
parents:
diff changeset
   473
!
claus
parents:
diff changeset
   474
claus
parents:
diff changeset
   475
ySelectionStyle:args view:aView frame:frameView
claus
parents:
diff changeset
   476
    'selectionStyle ignored' printNL.
claus
parents:
diff changeset
   477
claus
parents:
diff changeset
   478
!
claus
parents:
diff changeset
   479
claus
parents:
diff changeset
   480
yStart:args view:aView frame:frameView
86
claus
parents: 80
diff changeset
   481
    (aView isKindOf:Scroller) ifTrue:[
claus
parents: 80
diff changeset
   482
	aView start:args.
claus
parents: 80
diff changeset
   483
	^ self
claus
parents: 80
diff changeset
   484
    ].
66
claus
parents:
diff changeset
   485
    'start ignored' printNL.
claus
parents:
diff changeset
   486
!
claus
parents:
diff changeset
   487
claus
parents:
diff changeset
   488
yStep:args view:aView frame:frameView
claus
parents:
diff changeset
   489
    'step ignored' printNL.
claus
parents:
diff changeset
   490
claus
parents:
diff changeset
   491
!
claus
parents:
diff changeset
   492
86
claus
parents: 80
diff changeset
   493
yStop:args view:aView frame:frameView
claus
parents: 80
diff changeset
   494
    (aView isKindOf:Scroller) ifTrue:[
claus
parents: 80
diff changeset
   495
	aView stop:args.
claus
parents: 80
diff changeset
   496
	^ self
claus
parents: 80
diff changeset
   497
    ].
claus
parents: 80
diff changeset
   498
    'stop ignored' printNL.
66
claus
parents:
diff changeset
   499
!
claus
parents:
diff changeset
   500
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   501
yStyle:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   502
    'name ignored' printNL.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   503
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   504
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   505
86
claus
parents: 80
diff changeset
   506
ySubmenu:aSpec view:menu frame:frameView
claus
parents: 80
diff changeset
   507
    |items lines selectors labels|
claus
parents: 80
diff changeset
   508
claus
parents: 80
diff changeset
   509
    aSpec first ~~ #Menu ifTrue:[
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   510
        self halt:'unexpected'.
86
claus
parents: 80
diff changeset
   511
    ].
claus
parents: 80
diff changeset
   512
    items := (aSpec at:2).
claus
parents: 80
diff changeset
   513
    lines := aSpec at:3.
claus
parents: 80
diff changeset
   514
    selectors := aSpec at:4.
66
claus
parents:
diff changeset
   515
86
claus
parents: 80
diff changeset
   516
    "collect labels & selectors"
claus
parents: 80
diff changeset
   517
    labels := OrderedCollection new.
claus
parents: 80
diff changeset
   518
    items do:[:item |
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   519
        item first ~~ #MenuItem ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   520
            self halt:'unexpected'
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   521
        ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   522
        (item at:2) ~~ #'label:' ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   523
            self halt:'unexpected'
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   524
        ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   525
        labels add:(item at:3).
86
claus
parents: 80
diff changeset
   526
    ].
claus
parents: 80
diff changeset
   527
claus
parents: 80
diff changeset
   528
    menu at:currentMenuSelector
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   529
        putLabels:labels
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   530
        selectors:selectors
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   531
        receiver:nil.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   532
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   533
    "Created: 9.12.1995 / 23:06:39 / cg"
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   534
    "Modified: 9.12.1995 / 23:08:15 / cg"
86
claus
parents: 80
diff changeset
   535
!
claus
parents: 80
diff changeset
   536
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   537
yTabable:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   538
    args == true ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   539
	focusSequence isNil ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   540
	    focusSequence := OrderedCollection new.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   541
	].
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   542
	focusSequence add:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   543
	'tabable element added' printNL.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   544
    ]
66
claus
parents:
diff changeset
   545
!
claus
parents:
diff changeset
   546
claus
parents:
diff changeset
   547
yType:args view:aView frame:frameView
86
claus
parents: 80
diff changeset
   548
    (aView isMemberOf:EditField) ifTrue:[
claus
parents: 80
diff changeset
   549
	args == #number ifTrue:[
claus
parents: 80
diff changeset
   550
	    aView converter:(PrintConverter new initForNumber).
claus
parents: 80
diff changeset
   551
	    ^ self
claus
parents: 80
diff changeset
   552
	]
claus
parents: 80
diff changeset
   553
    ].
claus
parents: 80
diff changeset
   554
66
claus
parents:
diff changeset
   555
    'type ignored' printNL.
100
claus
parents: 96
diff changeset
   556
!
claus
parents: 96
diff changeset
   557
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   558
yWindow:args view:aView frame:frameView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   559
    self readSpec:args view:aView frame:frameView.
66
claus
parents:
diff changeset
   560
! !
claus
parents:
diff changeset
   561
100
claus
parents: 96
diff changeset
   562
!UIBuilder methodsFor:'private spec component parsing'!
66
claus
parents:
diff changeset
   563
100
claus
parents: 96
diff changeset
   564
xActionButtonSpec:aSpec view:aView
claus
parents: 96
diff changeset
   565
    |b|
claus
parents: 96
diff changeset
   566
claus
parents: 96
diff changeset
   567
    b := Button in:aView.
claus
parents: 96
diff changeset
   568
    self fixFontFor:b.
claus
parents: 96
diff changeset
   569
    self doSpec:aSpec for:b 
66
claus
parents:
diff changeset
   570
!
claus
parents:
diff changeset
   571
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   572
xArbitraryComponentSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   573
    |v|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   574
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   575
    v := View in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   576
"/    v := Label label:'ArbitraryView' in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   577
    v origin:0.0@0.0 corner:1.0@1.0.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   578
    v level:-1.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   579
    self doSpec:aSpec for:v
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   580
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   581
    "Modified: 2.9.1995 / 15:26:03 / claus"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   582
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   583
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   584
xCheckBoxSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   585
    |b|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   586
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   587
    b := CheckBox in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   588
    self fixFontFor:b.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   589
    self doSpec:aSpec for:b 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   590
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   591
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   592
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   593
xCompositeSpecCollection:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   594
    |v|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   595
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   596
"/ 'compositeSpecCollection ignored' printNL.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   597
"/ ^ self.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   598
    v := View in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   599
    self doSpec:aSpec for:v 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   600
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   601
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   602
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   603
xDividerSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   604
    |l|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   605
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   606
    l := View in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   607
    self doSpec:aSpec for:l 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   608
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   609
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   610
xFramedBoxSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   611
    |v|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   612
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   613
    v := FramedBox in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   614
    self doSpec:aSpec for:v
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   615
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   616
    "Modified: 5.9.1995 / 21:05:38 / claus"
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   617
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   618
100
claus
parents: 96
diff changeset
   619
xFullSpec:aSpec
claus
parents: 96
diff changeset
   620
    topView isNil ifTrue:[
claus
parents: 96
diff changeset
   621
	topView := StandardSystemView new.
claus
parents: 96
diff changeset
   622
	topView controller:(ApplicationController new).
claus
parents: 96
diff changeset
   623
	topView application:application.
claus
parents: 96
diff changeset
   624
    ].
claus
parents: 96
diff changeset
   625
claus
parents: 96
diff changeset
   626
    view := View new.
claus
parents: 96
diff changeset
   627
    self doSpec:aSpec for:view.
claus
parents: 96
diff changeset
   628
claus
parents: 96
diff changeset
   629
    topView extent:(view extent).
claus
parents: 96
diff changeset
   630
    view origin:0.0@0.0 corner:1.0@1.0.
claus
parents: 96
diff changeset
   631
    topView add:view.
claus
parents: 96
diff changeset
   632
claus
parents: 96
diff changeset
   633
    ^ topView
claus
parents: 96
diff changeset
   634
!
claus
parents: 96
diff changeset
   635
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   636
xGroupBoxSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   637
    |l|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   638
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   639
    l := FramedBox in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   640
    self doSpec:aSpec for:l 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   641
!
66
claus
parents:
diff changeset
   642
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   643
xHorizontalPanelViewSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   644
    |v|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   645
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   646
    v := HorizontalPanelView in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   647
    self doSpec:aSpec for:v
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   648
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   649
    "Modified: 5.9.1995 / 21:06:25 / claus"
66
claus
parents:
diff changeset
   650
!
claus
parents:
diff changeset
   651
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   652
xInputFieldSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   653
    |l|
66
claus
parents:
diff changeset
   654
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   655
    l := EditField in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   656
    self fixFontFor:l.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   657
    l aspect:#value; change:#value:.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   658
    self doSpec:aSpec for:l 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   659
!
100
claus
parents: 96
diff changeset
   660
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   661
xLabelSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   662
    |l|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   663
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   664
    l := Label in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   665
    self fixFontFor:l.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   666
    self doSpec:aSpec for:l 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   667
66
claus
parents:
diff changeset
   668
!
claus
parents:
diff changeset
   669
100
claus
parents: 96
diff changeset
   670
xMenu:aSpec
claus
parents: 96
diff changeset
   671
    |items numItems unknown prevCurrent labels|
claus
parents: 96
diff changeset
   672
claus
parents: 96
diff changeset
   673
    topView := PullDownMenu new.
claus
parents: 96
diff changeset
   674
claus
parents: 96
diff changeset
   675
    items := aSpec at:2.
claus
parents: 96
diff changeset
   676
    numItems := (aSpec at:3) at:1.
claus
parents: 96
diff changeset
   677
    unknown := (aSpec at:4).
claus
parents: 96
diff changeset
   678
claus
parents: 96
diff changeset
   679
    prevCurrent := currentMenuSelector.
66
claus
parents:
diff changeset
   680
100
claus
parents: 96
diff changeset
   681
    "precollect labels ..."
claus
parents: 96
diff changeset
   682
    labels := OrderedCollection new.
claus
parents: 96
diff changeset
   683
    items do:[:item |
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   684
        (item at:1) ~~ #MenuItem ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   685
            self halt:'unexpected'
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   686
        ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   687
        (item at:2) ~~ #'label:' ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   688
            self halt:'unexpected'
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   689
        ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   690
        labels add:(item at:3)
100
claus
parents: 96
diff changeset
   691
    ].
claus
parents: 96
diff changeset
   692
claus
parents: 96
diff changeset
   693
    topView labels:labels.
claus
parents: 96
diff changeset
   694
claus
parents: 96
diff changeset
   695
    items with:(1 to:numItems) do:[:item :index |
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   696
        currentMenuSelector := index.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   697
        self doSpec:item for:topView.
100
claus
parents: 96
diff changeset
   698
    ].
claus
parents: 96
diff changeset
   699
claus
parents: 96
diff changeset
   700
    currentMenuSelector := prevCurrent.
claus
parents: 96
diff changeset
   701
    ^ topView
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   702
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   703
    "Created: 9.12.1995 / 23:06:31 / cg"
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   704
    "Modified: 9.12.1995 / 23:08:11 / cg"
66
claus
parents:
diff changeset
   705
!
claus
parents:
diff changeset
   706
100
claus
parents: 96
diff changeset
   707
xPopUpMenu:aSpec
claus
parents: 96
diff changeset
   708
    |menu values|
66
claus
parents:
diff changeset
   709
100
claus
parents: 96
diff changeset
   710
    menu := PopUpMenu 
claus
parents: 96
diff changeset
   711
		labels:(aSpec at:2).
claus
parents: 96
diff changeset
   712
    values := Array new:((aSpec at:2) size).
66
claus
parents:
diff changeset
   713
100
claus
parents: 96
diff changeset
   714
    (aSpec at:4) keysAndValuesDo:[:index :item |
claus
parents: 96
diff changeset
   715
	((item size > 0)
claus
parents: 96
diff changeset
   716
	and:[(item at:1) == #PopUpMenu]) ifTrue:[
claus
parents: 96
diff changeset
   717
	    menu subMenuAt:index put:(self xPopUpMenu:item)
claus
parents: 96
diff changeset
   718
	] ifFalse:[
claus
parents: 96
diff changeset
   719
	    values at:index put:item
claus
parents: 96
diff changeset
   720
	]
66
claus
parents:
diff changeset
   721
    ].
100
claus
parents: 96
diff changeset
   722
claus
parents: 96
diff changeset
   723
    menu values:values.
claus
parents: 96
diff changeset
   724
    ^ menu
claus
parents: 96
diff changeset
   725
!
claus
parents: 96
diff changeset
   726
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   727
xProgressIndicatorSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   728
    |s|
100
claus
parents: 96
diff changeset
   729
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   730
    s := ProgressIndicator in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   731
    self doSpec:aSpec for:s 
66
claus
parents:
diff changeset
   732
!
claus
parents:
diff changeset
   733
100
claus
parents: 96
diff changeset
   734
xScrollerSpec:aSpec view:aView
claus
parents: 96
diff changeset
   735
    |s idx orientation|
claus
parents: 96
diff changeset
   736
claus
parents: 96
diff changeset
   737
    idx := aSpec indexOf:#orientation:.
claus
parents: 96
diff changeset
   738
    idx == 0 ifTrue:[
claus
parents: 96
diff changeset
   739
	orientation := #vertical
claus
parents: 96
diff changeset
   740
    ] ifFalse:[
claus
parents: 96
diff changeset
   741
	orientation := aSpec at:(idx + 1)
claus
parents: 96
diff changeset
   742
    ].
claus
parents: 96
diff changeset
   743
    orientation == #horizontal ifTrue:[
claus
parents: 96
diff changeset
   744
	s := HorizontalScroller in:aView
claus
parents: 96
diff changeset
   745
    ] ifFalse:[
claus
parents: 96
diff changeset
   746
	s := Scroller in:aView
claus
parents: 96
diff changeset
   747
    ].
claus
parents: 96
diff changeset
   748
    self doSpec:aSpec for:s 
claus
parents: 96
diff changeset
   749
!
claus
parents: 96
diff changeset
   750
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   751
xSequenceViewSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   752
    |f s|
100
claus
parents: 96
diff changeset
   753
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   754
    f := ScrollableView for:SelectionInListView in:aView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   755
    s := f scrolledView.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   756
    self doSpec:aSpec for:s frame:f.
100
claus
parents: 96
diff changeset
   757
!
66
claus
parents:
diff changeset
   758
100
claus
parents: 96
diff changeset
   759
xSliderSpec:aSpec view:aView
claus
parents: 96
diff changeset
   760
    |s idx orientation|
66
claus
parents:
diff changeset
   761
100
claus
parents: 96
diff changeset
   762
    idx := aSpec indexOf:#orientation:.
claus
parents: 96
diff changeset
   763
    idx == 0 ifTrue:[
claus
parents: 96
diff changeset
   764
	orientation := #vertical
claus
parents: 96
diff changeset
   765
    ] ifFalse:[
claus
parents: 96
diff changeset
   766
	orientation := aSpec at:(idx + 1)
claus
parents: 96
diff changeset
   767
    ].
claus
parents: 96
diff changeset
   768
    orientation == #horizontal ifTrue:[
claus
parents: 96
diff changeset
   769
	s := HorizontalSlider in:aView
claus
parents: 96
diff changeset
   770
    ] ifFalse:[
claus
parents: 96
diff changeset
   771
	s := Slider in:aView
claus
parents: 96
diff changeset
   772
    ].
claus
parents: 96
diff changeset
   773
    self doSpec:aSpec for:s 
claus
parents: 96
diff changeset
   774
!
claus
parents: 96
diff changeset
   775
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   776
xSpecCollection:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   777
    self doSpec:aSpec for:aView
66
claus
parents:
diff changeset
   778
claus
parents:
diff changeset
   779
!
claus
parents:
diff changeset
   780
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   781
xSubCanvasSpec:aSpec view:aView
100
claus
parents: 96
diff changeset
   782
    |v|
66
claus
parents:
diff changeset
   783
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   784
    v := SubCanvas in:aView.
100
claus
parents: 96
diff changeset
   785
    v origin:0.0@0.0 corner:1.0@1.0.
claus
parents: 96
diff changeset
   786
    self doSpec:aSpec for:v
claus
parents: 96
diff changeset
   787
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   788
    "Modified: 2.9.1995 / 15:26:15 / claus"
100
claus
parents: 96
diff changeset
   789
!
claus
parents: 96
diff changeset
   790
claus
parents: 96
diff changeset
   791
xTableViewSpec:aSpec view:aView
claus
parents: 96
diff changeset
   792
    |l|
claus
parents: 96
diff changeset
   793
claus
parents: 96
diff changeset
   794
    'tableView ignored' printNL.
claus
parents: 96
diff changeset
   795
    l := Label label:'TableView' in:aView.
claus
parents: 96
diff changeset
   796
    l level:-1.
claus
parents: 96
diff changeset
   797
    self doSpec:aSpec for:l 
66
claus
parents:
diff changeset
   798
!
claus
parents:
diff changeset
   799
100
claus
parents: 96
diff changeset
   800
xVerticalPanelViewSpec:aSpec view:aView
claus
parents: 96
diff changeset
   801
    |v|
claus
parents: 96
diff changeset
   802
claus
parents: 96
diff changeset
   803
    v := VerticalPanelView in:aView.
claus
parents: 96
diff changeset
   804
    self doSpec:aSpec for:v
66
claus
parents:
diff changeset
   805
100
claus
parents: 96
diff changeset
   806
    "Modified: 5.9.1995 / 21:06:19 / claus"
claus
parents: 96
diff changeset
   807
!
66
claus
parents:
diff changeset
   808
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   809
xWindowSpec:aSpec view:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   810
    self doSpec:aSpec for:aView
100
claus
parents: 96
diff changeset
   811
66
claus
parents:
diff changeset
   812
! !
claus
parents:
diff changeset
   813
claus
parents:
diff changeset
   814
!UIBuilder methodsFor:'private spec parsing'!
claus
parents:
diff changeset
   815
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   816
add:aSpec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   817
    self readSpec:aSpec
66
claus
parents:
diff changeset
   818
!
claus
parents:
diff changeset
   819
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   820
doSingleSpec:selector args:args for:aView frame:frame
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   821
    Verbose ifTrue:[
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   822
	'doSingle (' print. aView print. ' -> ' print. selector print.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   823
	' ' print. args printString printNL.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   824
    ].
66
claus
parents:
diff changeset
   825
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   826
    self perform:('y' , selector asString asUppercaseFirst , 'view:frame:') asSymbol 
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   827
	    with:args
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   828
	    with:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   829
	    with:frame.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   830
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   831
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   832
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   833
doSpec:aSpec for:aView
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   834
    ^ self doSpec:aSpec for:aView frame:aView
66
claus
parents:
diff changeset
   835
!
claus
parents:
diff changeset
   836
claus
parents:
diff changeset
   837
doSpec:aSpec for:aView frame:frame 
claus
parents:
diff changeset
   838
    |state selector args argsToRead|
claus
parents:
diff changeset
   839
claus
parents:
diff changeset
   840
    argsToRead := 0.
claus
parents:
diff changeset
   841
    args := #().
claus
parents:
diff changeset
   842
    aSpec from:2 to:(aSpec size) do:[:element |
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   843
        argsToRead > 1 ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   844
            self halt:'invalid spec'.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   845
        ] ifFalse:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   846
            argsToRead == 1 ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   847
                args := element.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   848
                argsToRead := argsToRead - 1
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   849
            ] ifFalse:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   850
                selector := element.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   851
                argsToRead := selector numArgs.
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   852
            ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   853
        ].
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   854
        argsToRead == 0 ifTrue:[
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   855
            self doSingleSpec:selector args:args for:aView frame:frame
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   856
        ]
66
claus
parents:
diff changeset
   857
    ]
139
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   858
779ae6adb925 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
   859
    "Created: 9.12.1995 / 23:06:18 / cg"
66
claus
parents:
diff changeset
   860
!
claus
parents:
diff changeset
   861
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   862
readSpec:aSpec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   863
    |what|
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   864
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   865
    what := aSpec first.
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   866
    ^ self perform:('x' , what , ':') asSymbol with:aSpec
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   867
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   868
66
claus
parents:
diff changeset
   869
readSpec:aSpec view:aView frame:frameView
claus
parents:
diff changeset
   870
    |what|
claus
parents:
diff changeset
   871
claus
parents:
diff changeset
   872
    what := aSpec first.
claus
parents:
diff changeset
   873
    self perform:('x' , what , ':view:') asSymbol with:aSpec with:aView
claus
parents:
diff changeset
   874
! !
claus
parents:
diff changeset
   875
claus
parents:
diff changeset
   876
!UIBuilder methodsFor:'private special kludges'!
claus
parents:
diff changeset
   877
125
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   878
fixExtentFor:aPoint
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   879
    ^ aPoint "/ (aPoint * (1 @ 1.5)) truncated
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   880
!
fa5b5e4336bf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   881
66
claus
parents:
diff changeset
   882
fixFontFor:aComponent
claus
parents:
diff changeset
   883
    "since ST-80 seems to use a smaller default font,
claus
parents:
diff changeset
   884
     and component sizes are often given in pixels in winSpecs,
75
claus
parents: 69
diff changeset
   885
     make the font smaller for less ugly looking elements."
66
claus
parents:
diff changeset
   886
claus
parents:
diff changeset
   887
"/   aComponent font:(aComponent font size:8)
claus
parents:
diff changeset
   888
! !
claus
parents:
diff changeset
   889
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   890
!UIBuilder class methodsFor:'documentation'!
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   891
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   892
version
223
b65dc250db8d documentation
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
   893
    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.13 1996-04-25 16:43:47 cg Exp $'
132
0a8fe342ed91 version method at the end
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   894
! !
100
claus
parents: 96
diff changeset
   895
UIBuilder initialize!