UIBuilder.st
changeset 100 0300e64bb883
parent 96 948318b2fbd4
child 114 e577a2f332d0
--- a/UIBuilder.st	Wed Aug 30 19:54:43 1995 +0200
+++ b/UIBuilder.st	Sat Sep 09 04:30:16 1995 +0200
@@ -1,6 +1,6 @@
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -10,10 +10,10 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:2.10.5 on 11-apr-1995 at 9:42:52 am'!
+'From Smalltalk/X, Version:2.10.7 on 7-sep-1995 at 10:06:32 pm'                 !
 
-WindowBuilder subclass:#UIBuilder 
-	 instanceVariableNames:'view currentMenuSelector menuAspect'
+WindowBuilder subclass:#UIBuilder
+	 instanceVariableNames:'view currentMenuSelector menuAspect spec'
 	 classVariableNames:'Verbose'
 	 poolDictionaries:''
 	 category:'Interface-Support-UI'
@@ -21,23 +21,9 @@
 
 !UIBuilder class methodsFor:'documentation'!
 
-copyright
-"
- COPYRIGHT (c) 1995 by Claus Gittinger
-              All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice.   This software may not
- be provided or otherwise made available to, or used by, any
- other person.  No title to or ownership of the software is
- hereby transferred.
-"
-!
-
 version
 "
-$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.7 1995-08-29 17:45:13 claus Exp $
+$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.8 1995-09-09 02:30:09 claus Exp $
 "
 !
 
@@ -52,6 +38,20 @@
     The class is not completed yet and certainly not bug free.
     Also, it is not quaranteed that all winSpecs are understood.
 "
+!
+
+copyright
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
 ! !
 
 !UIBuilder class methodsFor:'initialization'!
@@ -68,322 +68,184 @@
 
 !UIBuilder methodsFor:'operation'!
 
-buildFromSpec:aSpec
-    |m|
+buildFromSpec:aSpecArray in:aView
+    |m spec|
 
-    self readSpec:aSpec.
+    spec := UISpecification from:aSpecArray.
+
+    view := spec buildViewFor:self in:aView.
 
     menuAspect notNil ifTrue:[
-	m := self componentAt:menuAspect.
-	m notNil ifTrue:[
-	    m := m value.
-	    m notNil ifTrue:[
-		m receiver:application.
-		topView add:m.
-		view topInset:(m heightIncludingBorder).
-	    ]
-	]
+        m := self componentAt:menuAspect.
+        m notNil ifTrue:[
+            m := m value.
+            m notNil ifTrue:[
+                m receiver:application.
+                topView add:m.
+                view topInset:(m heightIncludingBorder).
+            ]
+        ]
     ].
 
     ^ topView
-! !
 
-!UIBuilder methodsFor:'private spec component parsing'!
-
-xLabelSpec:aSpec view:aView
-    |l|
-
-    l := Label in:aView.
-    self fixFontFor:l.
-    self doSpec:aSpec for:l 
-
+    "Modified: 5.9.1995 / 21:48:09 / claus"
 !
 
-xFullSpec:aSpec
-    topView isNil ifTrue:[
-	topView := StandardSystemView new.
-	topView controller:(ApplicationController new).
-	topView application:application.
+buildFromSpec:aSpecArray
+    |m spec|
+
+"/ old:
+"/    self readSpec:aSpecArray.
+
+    spec := UISpecification from:aSpecArray.
+    topView := view := spec buildViewFor:self.
+
+    menuAspect notNil ifTrue:[
+        m := self componentAt:menuAspect.
+        m notNil ifTrue:[
+            m := m value.
+            m notNil ifTrue:[
+                m receiver:application.
+                topView add:m.
+                view topInset:(m heightIncludingBorder).
+            ]
+        ]
     ].
 
-    view := View new.
-    self doSpec:aSpec for:view.
+    ^ topView
 
-    topView extent:(view extent).
-    view origin:0.0@0.0 corner:1.0@1.0.
-    topView add:view.
+    "Modified: 5.9.1995 / 21:43:29 / claus"
+! !
 
-    ^ topView
-!
+!UIBuilder methodsFor:'private arg parsing'!
 
-xSubCanvasSpec:aSpec view:aView
-    |v|
+getLayoutFrame:spec
+    "called for #(LayoutFrame absOrgX relOrgX absOrgY relOrgY absCornX relCornX absCornY relCornY)"
+    "             1           2       3       4        5      6        7        8        9"
 
-    v := SubCanvas in:aView.
-    self doSpec:aSpec for:v 
-!
+    ^ LayoutFrame new fromLiteralArrayEncoding:spec.
 
-xSpecCollection:aSpec view:aView
-    self doSpec:aSpec for:aView
-
-!
-
-xWindowSpec:aSpec view:aView
-    self doSpec:aSpec for:aView
+"/    ^ Array with:#layoutFrame
+"/            with:((spec at:2) @ (spec at:4))     "/ org inset
+"/            with:((spec at:6) @ (spec at:8))     "/ corner inset
+"/            with:((spec at:3) @ (spec at:5))     "/ rel org
+"/            with:((spec at:7) @ (spec at:9))     "/ rel corn 
 
 !
 
-xMenu:aSpec
-    |items numItems unknown prevCurrent labels|
-
-    topView := PullDownMenu new.
-
-    items := aSpec at:2.
-    numItems := (aSpec at:3) at:1.
-    unknown := (aSpec at:4).
-
-    prevCurrent := currentMenuSelector.
+getArg:spec
+    "take something like #(Point 50 100) and return the value"
 
-    "precollect labels ..."
-    labels := OrderedCollection new.
-    items do:[:item |
-	(item at:1) ~~ #MenuItem ifTrue:[
-	    self halt
-	].
-	(item at:2) ~~ #'label:' ifTrue:[
-	    self halt
-	].
-	labels add:(item at:3)
-    ].
+    |what|
 
-    topView labels:labels.
-
-    items with:(1 to:numItems) do:[:item :index |
-	currentMenuSelector := index.
-	self doSpec:item for:topView.
-    ].
-
-    currentMenuSelector := prevCurrent.
-    ^ topView
+    what := spec at:1.
+    ^ self perform:('get' , what , ':') asSymbol with:spec
 !
 
-xPopUpMenu:aSpec
-    |menu values|
-
-    menu := PopUpMenu 
-		labels:(aSpec at:2).
-    values := Array new:((aSpec at:2) size).
+getRectangle:spec
+    "called for #(Rectangle x y)"
 
-    (aSpec at:4) keysAndValuesDo:[:index :item |
-	((item size > 0)
-	and:[(item at:1) == #PopUpMenu]) ifTrue:[
-	    menu subMenuAt:index put:(self xPopUpMenu:item)
-	] ifFalse:[
-	    values at:index put:item
-	]
-    ].
-
-    menu values:values.
-    ^ menu
+    ^ Array with:#rectangle
+	    with:(((spec at:2) @ (spec at:3)) corner:((spec at:4) @ (spec at:5)))
 !
 
-xInputFieldSpec:aSpec view:aView
-    |l|
+getPoint:spec
+    "called for #(Point x y)"
 
-    l := EditField in:aView.
-    self fixFontFor:l.
-    l aspect:#value; change:#value:.
-    self doSpec:aSpec for:l 
+    ^ Array with:#point 
+	    with:((spec at:2) @ (spec at:3))
 !
 
-xActionButtonSpec:aSpec view:aView
-    |b|
+getLayoutOrigin:spec
+    "called for #(LayoutOrigin xInset relX yInset relY)"
 
-    b := Button in:aView.
-    self fixFontFor:b.
-    self doSpec:aSpec for:b 
-!
-
-xSequenceViewSpec:aSpec view:aView
-    |f s|
-
-    f := ScrollableView for:SelectionInListView in:aView.
-    s := f scrolledView.
-    self doSpec:aSpec for:s frame:f.
+    ^ LayoutOrigin new fromLiteralArrayEncoding:spec.
+"/    ^ Array with:#layoutOrigin
+"/            with:((spec at:3) @ (spec at:5))     "/ rels
+"/            with:((spec at:2) @ (spec at:4))     "/ insets
 !
 
-xScrollerSpec:aSpec view:aView
-    |s idx orientation|
+getCompositeSpec:spec
+    "called for #(CompositeSpec layout: #(orgx orgy cornx corny)"
+
+    |layout|
 
-    idx := aSpec indexOf:#orientation:.
-    idx == 0 ifTrue:[
-	orientation := #vertical
-    ] ifFalse:[
-	orientation := aSpec at:(idx + 1)
+    (spec at:2) == #layout: ifTrue:[
+	layout := spec at:3.
+	(layout at:1) == #Rectangle ifTrue:[
+	    ^ Rectangle
+		    origin:(layout at:2) @ (layout at:3)
+		    corner:(layout at:4) @ (layout at:5)
+	].
     ].
-    orientation == #horizontal ifTrue:[
-	s := HorizontalScroller in:aView
-    ] ifFalse:[
-	s := Scroller in:aView
-    ].
-    self doSpec:aSpec for:s 
+    self halt:'unimplemented'.
 !
 
-xProgressIndicatorSpec:aSpec view:aView
-    |s|
-
-    s := ProgressIndicator in:aView.
-    self doSpec:aSpec for:s 
-!
-
-xSliderSpec:aSpec view:aView
-    |s idx orientation|
+getAlignmentOrigin:spec
+    "called for #(AlignmentOrigin ?x ?relX ?x ?y ?relY ?y)"
 
-    idx := aSpec indexOf:#orientation:.
-    idx == 0 ifTrue:[
-	orientation := #vertical
-    ] ifFalse:[
-	orientation := aSpec at:(idx + 1)
-    ].
-    orientation == #horizontal ifTrue:[
-	s := HorizontalSlider in:aView
-    ] ifFalse:[
-	s := Slider in:aView
-    ].
-    self doSpec:aSpec for:s 
+    ^ AlignmentOrigin new fromLiteralArrayEncoding:spec.
+"/    ^ Array with:#alignmentOrigin
+"/            with:((spec at:2) @ (spec at:5))     "/ ?
+"/            with:((spec at:3) @ (spec at:6))     "/ rels ?
+"/            with:((spec at:4) @ (spec at:7))     "/ insets ?
 !
 
-xCompositeSpecCollection:aSpec view:aView
-    |v|
+getLookPreferences:spec
+    "called for #(LookPreferences setForegroundColor: (...) setBackgroundColor: (...) ...)"
 
-"/ 'compositeSpecCollection ignored' printNL.
-"/ ^ self.
-    v := View in:aView.
-    self doSpec:aSpec for:v 
+    |coll|
 
-!
-
-xArbitraryComponentSpec:aSpec view:aView
-    |v|
-
-    v := View in:aView.
-"/    v := Label label:'ArbitraryView' in:aView.
-    v level:-1.
-    self doSpec:aSpec for:v 
+    coll := OrderedCollection new.
+    2 to:spec size by:2 do:[:index |
+	coll add: 
+	    (Array with:(spec at:index)
+		  with:(self getArg:(spec at:index+1)))
+    ].
+    ^ coll.
 !
 
-xCheckBoxSpec:aSpec view:aView
-    |b|
+getColorValue:spec
+    "called for #(ColorValue #sym)
+	     or #(ColorValue red green blue)"
 
-    b := CheckBox in:aView.
-    self fixFontFor:b.
-    self doSpec:aSpec for:b 
-
-!
-
-xTableViewSpec:aSpec view:aView
-    |l|
+    |clr arg|
 
-    'tableView ignored' printNL.
-    l := Label label:'TableView' in:aView.
-    l level:-1.
-    self doSpec:aSpec for:l 
-!
-
-xGroupBoxSpec:aSpec view:aView
-    |l|
+    (arg := spec at:2) isSymbol ifTrue:[
+	(Color respondsTo:arg) ifTrue:[
+	    ^ Color perform:arg
+	].
+	^ Color name:arg asString ifIllegal:[Color black]
+    ].
+    arg isInteger ifTrue:[
+	^ ColorValue scaledRed:arg
+		     scaledGreen:(spec at:3)
+		     scaledBlue:(spec at:4)
+    ].
+    ^ ColorValue red:arg
+		 green:(spec at:3)
+		 blue:(spec at:4)
 
-    l := FramedBox in:aView.
-    self doSpec:aSpec for:l 
-!
 
-xDividerSpec:aSpec view:aView
-    |l|
-
-    l := View in:aView.
-    self doSpec:aSpec for:l 
 ! !
 
 !UIBuilder methodsFor:'private spec attribute parsing'!
 
-yMultipleSelections:args view:aView frame:frameView
-    args == true ifTrue:[
-	aView multipleSelectOk:true
-    ]
-!
-
-XXyMultipleSelections:args view:aView
-    aView multipleSelectOk:args
-!
-
-yBounds:args view:aView frame:frameView
-    |value r|
-
-    value := self getArg:args.
-    (value at:1) == #rectangle ifTrue:[
-	r := value at:2.
-	aView origin:r origin corner:r corner.
-	^ self
-    ].
-    self halt:'unimplemented'.
-!
-
 yCollection:args view:aView frame:frameView
     args do:[:aSpec |
 	self readSpec:aSpec view:aView frame:frameView.
     ].
 !
 
-yComponent:args view:aView frame:frameView
-    |v|
-
-    args isSymbol ifTrue:[
-	v := application perform:args.
-	v origin:0.0@0.0 corner:1.0@1.0.
-	aView addSubView:v
-    ] ifFalse:[
-"/        v := View origin:0.0@0.0 corner:1.0@1.0 in:aView.
-"/        self readSpec:args view:v frame:frameView.
-	self readSpec:args view:aView frame:frameView.
-    ]
-!
-
-yColors:args view:aView frame:frameView
-    |value|
-
-    value := self getArg:args.
-    self halt:'unimplemented'.
-!
-
-yCompositeSpec:args view:aView frame:frameView
-    |value r|
-
-    self doSpec:args for:aView.
-"
-    value := self getArg:args.
-    (value at:1) == #rectangle ifTrue:[
-	r := value at:2.
-	aView origin:r origin corner:r corner.
-	^ self
-    ].
-
-self halt.
-"
-!
-
-yDefaultable:args view:aView frame:frameView
-    'defaultable ignored' printNL
-!
-
-yLabel:args view:aView frame:frameView
-    aView label:args.
-
-!
-
 yLayout:args view:aView frame:frameView
     |value r org corn orgInset cornInset what|
 
     value := self getArg:args.
+    value isLayout ifTrue:[
+	frameView geometryLayout:value.
+	^ self
+    ].
 
     what := value at:1.
     what == #point ifTrue:[
@@ -456,8 +318,85 @@
     self halt:'unimplemented'.
 !
 
+yBounds:args view:aView frame:frameView
+    |value r|
+
+    value := self getArg:args.
+    (value at:1) == #rectangle ifTrue:[
+	r := value at:2.
+	aView origin:r origin corner:r corner.
+	^ self
+    ].
+    self halt:'unimplemented'.
+!
+
+yMultipleSelections:args view:aView frame:frameView
+    args == true ifTrue:[
+	aView multipleSelectOk:true
+    ]
+!
+
+yComponent:args view:aView frame:frameView
+    |v|
+
+    args isSymbol ifTrue:[
+	v := application perform:args.
+	v origin:0.0@0.0 corner:1.0@1.0.
+	aView addSubView:v
+    ] ifFalse:[
+"/        v := View origin:0.0@0.0 corner:1.0@1.0 in:aView.
+"/        self readSpec:args view:v frame:frameView.
+	self readSpec:args view:aView frame:frameView.
+    ]
+!
+
+XXyMultipleSelections:args view:aView
+    aView multipleSelectOk:args
+!
+
+yColors:args view:aView frame:frameView
+    |value|
+
+    value := self getArg:args.
+    self halt:'unimplemented'.
+!
+
+yName:args view:aView frame:frameView
+    self componentAt:args put:aView
+!
+
+yCompositeSpec:args view:aView frame:frameView
+    |value r|
+
+    self doSpec:args for:aView.
+"
+    value := self getArg:args.
+    (value at:1) == #rectangle ifTrue:[
+	r := value at:2.
+	aView origin:r origin corner:r corner.
+	^ self
+    ].
+
+self halt.
+"
+!
+
+yDefaultable:args view:aView frame:frameView
+    'defaultable ignored' printNL
+!
+
 yFlags:args view:aView frame:frameView
-    'flags ignored' printNL
+    'flags: ' print. args print. ' for ' print. aView print. ' ignored' printNL
+"
+32 : initially disabled
+16 : initially invisible
+ 8 : border
+ 4 : menuBar
+ 2 : hScroll
+ 1 : vScroll
+"
+
+    "Modified: 2.9.1995 / 15:44:15 / claus"
 !
 
 yIsDefault:args view:aView frame:frameView
@@ -517,10 +456,6 @@
     menuAspect := args
 !
 
-yName:args view:aView frame:frameView
-    self componentAt:args put:aView
-!
-
 yOrientation:args view:aView frame:frameView
     'orientation ignored' printNL.
 !
@@ -540,6 +475,10 @@
     ]
 !
 
+yWindow:args view:aView frame:frameView
+    self readSpec:args view:aView frame:frameView.
+!
+
 yStart:args view:aView frame:frameView
     (aView isKindOf:Scroller) ifTrue:[
 	aView start:args.
@@ -589,10 +528,6 @@
 	receiver:nil.
 !
 
-yWindow:args view:aView frame:frameView
-    self readSpec:args view:aView frame:frameView.
-!
-
 yStyle:args view:aView frame:frameView
     'name ignored' printNL.
 
@@ -607,115 +542,272 @@
     ].
 
     'type ignored' printNL.
+!
+
+doesNotUnderstand:aMessage
+    |rest sel|
+
+    ((sel := aMessage selector) startsWith:'y') ifTrue:[
+        rest := sel copyFrom:2 to:(sel indexOf:$:).
+        rest at:1 put:(rest at:1) asLowercase.
+        rest := rest asSymbolIfInterned.
+        rest notNil ifTrue:[
+            (aMessage arguments at:2) perform:rest with:(aMessage arguments at:1).
+            ^ self.
+        ]
+    ].
+    super doesNotUnderstand:aMessage
+
+    "Modified: 5.9.1995 / 21:13:16 / claus"
 ! !
 
-!UIBuilder methodsFor:'private arg parsing'!
+!UIBuilder methodsFor:'private spec component parsing'!
 
-getArg:spec
-    "take something like #(Point 50 100) and return the value"
+xLabelSpec:aSpec view:aView
+    |l|
 
-    |what|
+    l := Label in:aView.
+    self fixFontFor:l.
+    self doSpec:aSpec for:l 
 
-    what := spec at:1.
-    ^ self perform:('get' , what , ':') asSymbol with:spec
+!
+
+xSpecCollection:aSpec view:aView
+    self doSpec:aSpec for:aView
+
 !
 
-getPoint:spec
-    "called for #(Point x y)"
+xInputFieldSpec:aSpec view:aView
+    |l|
 
-    ^ Array with:#point 
-	    with:((spec at:2) @ (spec at:3))
+    l := EditField in:aView.
+    self fixFontFor:l.
+    l aspect:#value; change:#value:.
+    self doSpec:aSpec for:l 
+!
+
+xActionButtonSpec:aSpec view:aView
+    |b|
+
+    b := Button in:aView.
+    self fixFontFor:b.
+    self doSpec:aSpec for:b 
 !
 
-getLayoutFrame:spec
-    "called for #(LayoutFrame absOrgX relOrgX absOrgY relOrgY absCornX relCornX absCornY relCornY)"
-    "             1           2       3       4        5      6        7        8        9"
-    ^ Array with:#layoutFrame
-	    with:((spec at:2) @ (spec at:4))     "/ org inset
-	    with:((spec at:6) @ (spec at:8))     "/ corner inset
-	    with:((spec at:3) @ (spec at:5))     "/ rel org
-	    with:((spec at:7) @ (spec at:9))     "/ rel corn 
+xFullSpec:aSpec
+    topView isNil ifTrue:[
+	topView := StandardSystemView new.
+	topView controller:(ApplicationController new).
+	topView application:application.
+    ].
+
+    view := View new.
+    self doSpec:aSpec for:view.
+
+    topView extent:(view extent).
+    view origin:0.0@0.0 corner:1.0@1.0.
+    topView add:view.
+
+    ^ topView
+!
+
+xWindowSpec:aSpec view:aView
+    self doSpec:aSpec for:aView
 
 !
 
-getRectangle:spec
-    "called for #(Rectangle x y)"
+xSubCanvasSpec:aSpec view:aView
+    |v|
 
-    ^ Array with:#rectangle
-	    with:(((spec at:2) @ (spec at:3)) corner:((spec at:4) @ (spec at:5)))
+    v := SubCanvas in:aView.
+    v origin:0.0@0.0 corner:1.0@1.0.
+    self doSpec:aSpec for:v
+
+    "Modified: 2.9.1995 / 15:26:15 / claus"
 !
 
-getLayoutOrigin:spec
-    "called for #(LayoutOrigin xInset relX yInset relY)"
+xMenu:aSpec
+    |items numItems unknown prevCurrent labels|
+
+    topView := PullDownMenu new.
+
+    items := aSpec at:2.
+    numItems := (aSpec at:3) at:1.
+    unknown := (aSpec at:4).
+
+    prevCurrent := currentMenuSelector.
 
-    ^ Array with:#layoutOrigin
-	    with:((spec at:3) @ (spec at:5))     "/ rels
-	    with:((spec at:2) @ (spec at:4))     "/ insets
+    "precollect labels ..."
+    labels := OrderedCollection new.
+    items do:[:item |
+	(item at:1) ~~ #MenuItem ifTrue:[
+	    self halt
+	].
+	(item at:2) ~~ #'label:' ifTrue:[
+	    self halt
+	].
+	labels add:(item at:3)
+    ].
+
+    topView labels:labels.
+
+    items with:(1 to:numItems) do:[:item :index |
+	currentMenuSelector := index.
+	self doSpec:item for:topView.
+    ].
+
+    currentMenuSelector := prevCurrent.
+    ^ topView
 !
 
-getCompositeSpec:spec
-    "called for #(CompositeSpec layout: #(orgx orgy cornx corny)"
+xPopUpMenu:aSpec
+    |menu values|
 
-    |layout|
+    menu := PopUpMenu 
+		labels:(aSpec at:2).
+    values := Array new:((aSpec at:2) size).
 
-    (spec at:2) == #layout: ifTrue:[
-	layout := spec at:3.
-	(layout at:1) == #Rectangle ifTrue:[
-	    ^ Rectangle
-		    origin:(layout at:2) @ (layout at:3)
-		    corner:(layout at:4) @ (layout at:5)
-	].
+    (aSpec at:4) keysAndValuesDo:[:index :item |
+	((item size > 0)
+	and:[(item at:1) == #PopUpMenu]) ifTrue:[
+	    menu subMenuAt:index put:(self xPopUpMenu:item)
+	] ifFalse:[
+	    values at:index put:item
+	]
     ].
-    self halt:'unimplemented'.
+
+    menu values:values.
+    ^ menu
+!
+
+xSequenceViewSpec:aSpec view:aView
+    |f s|
+
+    f := ScrollableView for:SelectionInListView in:aView.
+    s := f scrolledView.
+    self doSpec:aSpec for:s frame:f.
 !
 
-getAlignmentOrigin:spec
-    "called for #(AlignmentOrigin ?x ?relX ?x ?y ?relY ?y)"
+xScrollerSpec:aSpec view:aView
+    |s idx orientation|
+
+    idx := aSpec indexOf:#orientation:.
+    idx == 0 ifTrue:[
+	orientation := #vertical
+    ] ifFalse:[
+	orientation := aSpec at:(idx + 1)
+    ].
+    orientation == #horizontal ifTrue:[
+	s := HorizontalScroller in:aView
+    ] ifFalse:[
+	s := Scroller in:aView
+    ].
+    self doSpec:aSpec for:s 
+!
+
+xProgressIndicatorSpec:aSpec view:aView
+    |s|
+
+    s := ProgressIndicator in:aView.
+    self doSpec:aSpec for:s 
+!
 
-    ^ Array with:#alignmentOrigin
-	    with:((spec at:2) @ (spec at:5))     "/ ?
-	    with:((spec at:3) @ (spec at:6))     "/ rels ?
-	    with:((spec at:4) @ (spec at:7))     "/ insets ?
+xSliderSpec:aSpec view:aView
+    |s idx orientation|
 
+    idx := aSpec indexOf:#orientation:.
+    idx == 0 ifTrue:[
+	orientation := #vertical
+    ] ifFalse:[
+	orientation := aSpec at:(idx + 1)
+    ].
+    orientation == #horizontal ifTrue:[
+	s := HorizontalSlider in:aView
+    ] ifFalse:[
+	s := Slider in:aView
+    ].
+    self doSpec:aSpec for:s 
+!
+
+xCompositeSpecCollection:aSpec view:aView
+    |v|
+
+"/ 'compositeSpecCollection ignored' printNL.
+"/ ^ self.
+    v := View in:aView.
+    self doSpec:aSpec for:v 
 
 !
 
-getLookPreferences:spec
-    "called for #(LookPreferences setForegroundColor: (...) setBackgroundColor: (...) ...)"
+xArbitraryComponentSpec:aSpec view:aView
+    |v|
 
-    |coll|
+    v := View in:aView.
+"/    v := Label label:'ArbitraryView' in:aView.
+    v origin:0.0@0.0 corner:1.0@1.0.
+    v level:-1.
+    self doSpec:aSpec for:v
+
+    "Modified: 2.9.1995 / 15:26:03 / claus"
+!
 
-    coll := OrderedCollection new.
-    2 to:spec size by:2 do:[:index |
-	coll add: 
-	    (Array with:(spec at:index)
-		  with:(self getArg:(spec at:index+1)))
-    ].
-    ^ coll.
+xCheckBoxSpec:aSpec view:aView
+    |b|
+
+    b := CheckBox in:aView.
+    self fixFontFor:b.
+    self doSpec:aSpec for:b 
+
+!
+
+xTableViewSpec:aSpec view:aView
+    |l|
+
+    'tableView ignored' printNL.
+    l := Label label:'TableView' in:aView.
+    l level:-1.
+    self doSpec:aSpec for:l 
 !
 
-getColorValue:spec
-    "called for #(ColorValue #sym)
-	     or #(ColorValue red green blue)"
+xGroupBoxSpec:aSpec view:aView
+    |l|
+
+    l := FramedBox in:aView.
+    self doSpec:aSpec for:l 
+!
+
+xDividerSpec:aSpec view:aView
+    |l|
 
-    |clr arg|
+    l := View in:aView.
+    self doSpec:aSpec for:l 
+!
+
+xFramedBoxSpec:aSpec view:aView
+    |v|
+
+    v := FramedBox in:aView.
+    self doSpec:aSpec for:v
 
-    (arg := spec at:2) isSymbol ifTrue:[
-	(Color respondsTo:arg) ifTrue:[
-	    ^ Color perform:arg
-	].
-	^ Color name:arg asString ifIllegal:[Color black]
-    ].
-    arg isInteger ifTrue:[
-	^ ColorValue scaledRed:arg
-		     scaledGreen:(spec at:3)
-		     scaledBlue:(spec at:4)
-    ].
-    ^ ColorValue red:arg
-		 green:(spec at:3)
-		 blue:(spec at:4)
+    "Modified: 5.9.1995 / 21:05:38 / claus"
+!
+
+xVerticalPanelViewSpec:aSpec view:aView
+    |v|
+
+    v := VerticalPanelView in:aView.
+    self doSpec:aSpec for:v
 
+    "Modified: 5.9.1995 / 21:06:19 / claus"
+!
 
+xHorizontalPanelViewSpec:aSpec view:aView
+    |v|
+
+    v := HorizontalPanelView in:aView.
+    self doSpec:aSpec for:v
+
+    "Modified: 5.9.1995 / 21:06:25 / claus"
 ! !
 
 !UIBuilder methodsFor:'private spec parsing'!
@@ -724,10 +816,6 @@
     ^ self doSpec:aSpec for:aView frame:aView
 !
 
-add:aSpec
-    self readSpec:aSpec
-!
-
 readSpec:aSpec
     |what|
 
@@ -776,6 +864,10 @@
 	    with:aView
 	    with:frame.
 
+!
+
+add:aSpec
+    self readSpec:aSpec
 ! !
 
 !UIBuilder methodsFor:'private special kludges'!
@@ -792,4 +884,4 @@
     ^ aPoint "/ (aPoint * (1 @ 1.5)) truncated
 ! !
 
-UIBuilder  initialize!
+UIBuilder initialize!