diff -r 9add9e2609d9 -r bca8b1953ee8 UIPainter.st --- a/UIPainter.st Tue Jun 10 12:51:52 1997 +0200 +++ b/UIPainter.st Wed Jun 11 15:59:16 1997 +0200 @@ -1,7 +1,6 @@ ApplicationModel subclass:#UIPainter - instanceVariableNames:'objectList currentView selectionPanel tabSelection lastSlice - specView layoutTool fileName specClass specSelector - specSuperclass aspects' + instanceVariableNames:'objectList selectionPanel tabSelection lastSlice specView + layoutTool fileName specClass specSelector specSuperclass aspects' classVariableNames:'' poolDictionaries:'' category:'Interface-UIPainter' @@ -430,17 +429,19 @@ #(#MenuPanelSpec #'name:' 'menuPullDown' #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 24 0) + #'tabable:' true #'menu:' #menuPullDown ) #(#MenuPanelSpec #'name:' 'menuAlignment' #'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0) + #'tabable:' true #'menu:' #menuAlignment #'showSeparatingLines:' true ) #(#PanelViewSpec #'name:' 'panelViewButtons' - #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 58 0.0) + #'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 -372 1.0) #'component:' #(#SpecCollection #'collection:' @@ -450,6 +451,7 @@ #'label:' '' #'translateLabel:' true #'labelChannel:' #'LABELb_moveLeft.xbm' + #'tabable:' true #'defaultable:' true #'model:' #moveSelectionLeft #'isTriggerOnDown:' true @@ -462,6 +464,7 @@ #'label:' '' #'translateLabel:' true #'labelChannel:' #'LABELb_moveRight.xbm' + #'tabable:' true #'defaultable:' true #'model:' #moveSelectionRight #'isTriggerOnDown:' true @@ -474,6 +477,7 @@ #'label:' '' #'translateLabel:' true #'labelChannel:' #'LABELb_moveUp.xbm' + #'tabable:' true #'defaultable:' true #'model:' #moveSelectionUp #'isTriggerOnDown:' true @@ -486,6 +490,7 @@ #'label:' '' #'translateLabel:' true #'labelChannel:' #'LABELb_moveDown.xbm' + #'tabable:' true #'defaultable:' true #'model:' #moveSelectionDown #'isTriggerOnDown:' true @@ -505,6 +510,7 @@ #'name:' 'objectTree' #'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 0 1.0) #'enableChannel:' #enableChannel + #'tabable:' true #'menu:' #objectListMenu #'model:' #objectList #'hasHorizontalScrollBar:' true @@ -518,15 +524,15 @@ #'name:' 'noteBook' #'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -30 1.0) #'enableChannel:' #enableChannel + #'tabable:' true #'menu:' #tabList #'style:' #(#FontDescription - #fixed #medium + #helvetica #medium #roman #'10' ) #'model:' #tabModel #'tabWidget:' #Window - #'level:' 0 #'canvas:' #noteBookView ) #(#HorizontalPanelViewSpec @@ -539,6 +545,7 @@ #(#ActionButtonSpec #'name:' 'cancelButton' #'label:' 'cancel' + #'tabable:' true #'model:' #cancel #'isTriggerOnDown:' false #'enableChannel:' #modifiedChannel @@ -548,6 +555,7 @@ #(#ActionButtonSpec #'name:' 'acceptButton' #'label:' 'ok' + #'tabable:' true #'model:' #accept #'isTriggerOnDown:' false #'enableChannel:' #modifiedChannel @@ -573,28 +581,26 @@ "automatically generated by UIPainter ..." |layout| - currentView notNil ifTrue:[ - tabSelection = 'Dimension' ifTrue:[ - (layout := layoutTool layout) notNil ifTrue:[ - layoutTool layoutType == #Extent ifTrue:[ - self painter setExtent:layout - ] ifFalse:[ - self painter setDimension:layout - ] + tabSelection = 'Dimension' ifTrue:[ + (layout := layoutTool layout) notNil ifTrue:[ + layoutTool layoutType == #Extent ifTrue:[ + self painter setExtent:layout + ] ifFalse:[ + self painter setDimension:layout ] - ] ifFalse:[ - self painter updateFromSpec:(specView specEdited). - ]. - self cancel - ] + ] + ] ifFalse:[ + self painter updateFromSpec:(specView specEdited). + ]. + self cancel ! cancel "cancel all changes and read back attributes from current view " - specView specEdited:(self painter specFor:currentView). - layoutTool forView:currentView. + specView specEdited:(self painter specForSelection). + layoutTool update. self modifiedChannel value:false. ! @@ -657,11 +663,9 @@ noteBook := View origin:0.0 @0.0 corner:1.0@1.0. layoutTool := UIPropertyView for:#Dimension in:noteBook. specView := UIPropertyView for:#Specification in:noteBook. - - channel := self modifiedChannel. + channel := self modifiedChannel. layoutTool modifiedHolder:channel. specView modifiedHolder:channel. - specView viewBackground:(layoutTool viewBackground). builder aspectAt:#noteBookView put:noteBook. ]. ^ noteBook @@ -688,7 +692,7 @@ (holder := builder bindingAt:#tabList) isNil ifTrue:[ builder aspectAt:#tabList put:(holder := ValueHolder new). - holder value:#( ' ' ' ' ). + holder value:#( 'Properties' ). ]. ^ holder ! @@ -726,7 +730,7 @@ self objectListChanged ] ifFalse:[ (self modifiedChannel value) ifFalse:[ - layoutTool forView:currentView + layoutTool update ] ] ] @@ -749,33 +753,30 @@ objectListChanged "something changed in the painter view " - |setSel slices list spec props size| + |setSel view slices list spec props size same| props := objectList selectedProperty. tabSelection := nil. props isNil ifFalse:[ - currentView := props view. + view := props view. + spec := props spec copy. - (currentView == layoutTool forView) ifTrue:[ - ^ self + layoutTool forView == view ifFalse:[ + slices := spec class slices. + size := slices size + 1. + list := Array new:size. + slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)]. + list at:size put:'Dimension'. + (self tabList) value:list. + ] ifTrue:[ + list := self tabList value ]. - layoutTool forView:currentView. - spec := props spec copy. - slices := spec class slices. - size := slices size + 1. - list := Array new:size. - slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)]. - list at:size put:'Dimension'. - (self tabList) value:list. - (list findFirst:[:aName| aName = lastSlice]) ~~ 0 ifTrue:[ setSel := lastSlice ] - ] ifTrue:[ - layoutTool forView:nil ]. - + layoutTool forView:view. specView specEdited:spec. self tabModel value:setSel. ! ! @@ -834,7 +835,7 @@ idx:= slices findFirst:[:aSlice| aSlice first = tabSelection ]. idx == 0 ifTrue:[ - layoutTool forView:currentView. + layoutTool update. ^ layoutTool raise. ]. spec := specEdited class perform:((slices at:idx) last).