UIPainter.st
changeset 121 96d6feeeb049
parent 118 bc196200ea8b
child 124 98d26d6f01cb
equal deleted inserted replaced
120:d83c307f3bf5 121:96d6feeeb049
     1 ApplicationModel subclass:#UIPainter
     1 ApplicationModel subclass:#UIPainter
     2 	instanceVariableNames:'objectList currentView selectionPanel tabSelection lastSlice
     2 	instanceVariableNames:'objectList currentView selectionPanel tabSelection lastSlice
     3 		specView layoutTool emptyView fileName specClass specSelector
     3 		specView layoutTool fileName specClass specSelector
     4 		specSuperclass aspects'
     4 		specSuperclass aspects'
     5 	classVariableNames:''
     5 	classVariableNames:''
     6 	poolDictionaries:''
     6 	poolDictionaries:''
     7 	category:'Interface-UIPainter'
     7 	category:'Interface-UIPainter'
     8 !
     8 !
   753 
   753 
   754     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
   754     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
   755         noteBook   := View origin:0.0 @0.0 corner:1.0@1.0.
   755         noteBook   := View origin:0.0 @0.0 corner:1.0@1.0.
   756         layoutTool := UIPropertyView for:#Dimension     in:noteBook.
   756         layoutTool := UIPropertyView for:#Dimension     in:noteBook.
   757         specView   := UIPropertyView for:#Specification in:noteBook.
   757         specView   := UIPropertyView for:#Specification in:noteBook.
   758         emptyView  := View origin:0.0 @0.0 corner:1.0@1.0 in:noteBook.
       
   759 
   758 
   760         channel := self modifiedChannel.
   759         channel := self modifiedChannel.
   761         layoutTool modifiedHolder:channel.
   760         layoutTool modifiedHolder:channel.
   762         specView   modifiedHolder:channel.
   761         specView   modifiedHolder:channel.
   763         specView   viewBackground:(layoutTool viewBackground).
   762         specView   viewBackground:(layoutTool viewBackground).
   764         emptyView  viewBackground:(layoutTool viewBackground).
       
   765         builder aspectAt:#noteBookView put:noteBook.
   763         builder aspectAt:#noteBookView put:noteBook.
   766     ].
   764     ].
   767     ^ noteBook
   765     ^ noteBook
   768 !
   766 !
   769 
   767 
   773 
   771 
   774 objectListMenu
   772 objectListMenu
   775     "returns a block which returns the menu
   773     "returns a block which returns the menu
   776      !!hack!!
   774      !!hack!!
   777     "
   775     "
   778     ^ [ (self painter menu) startUp. nil ].
   776     ^ [ self painter showMiddleButtonMenu ].
   779 
   777 
   780 
   778 
   781 
   779 
   782 !
   780 !
   783 
   781 
   864         (self tabList) value:list.
   862         (self tabList) value:list.
   865 
   863 
   866         (list findFirst:[:aName| aName = lastSlice]) ~~ 0 ifTrue:[
   864         (list findFirst:[:aName| aName = lastSlice]) ~~ 0 ifTrue:[
   867             setSel := lastSlice
   865             setSel := lastSlice
   868         ]
   866         ]
       
   867     ] ifTrue:[
       
   868         layoutTool forView:nil
   869     ].
   869     ].
   870 
   870 
   871     specView specEdited:spec.
   871     specView specEdited:spec.
   872     self tabModel value:setSel.
   872     self tabModel value:setSel.
   873 ! !
   873 ! !
   914 !
   914 !
   915 
   915 
   916 tabSelection:something
   916 tabSelection:something
   917     |specEdited slices spec idx|
   917     |specEdited slices spec idx|
   918 
   918 
   919     (tabSelection := something) notNil ifTrue:[
   919     something isNil ifTrue:[^ self].
   920         (specEdited := specView specEdited) notNil ifTrue:[
   920 
   921             slices    := specEdited class slices.
   921     tabSelection := something.
   922             lastSlice := tabSelection.
   922 
   923 
   923     (specEdited := specView specEdited) notNil ifTrue:[
   924             idx:= slices findFirst:[:aSlice| aSlice first = tabSelection ].
   924         slices    := specEdited class slices.
   925             idx == 0 ifTrue:[
   925         lastSlice := tabSelection.
   926                 layoutTool forView:currentView.
   926 
   927               ^ layoutTool raise.
   927         idx:= slices findFirst:[:aSlice| aSlice first = tabSelection ].
   928             ].
   928         idx == 0 ifTrue:[
   929             spec := specEdited class perform:((slices at:idx) last).
   929             layoutTool forView:currentView.
   930         ]
   930           ^ layoutTool raise.
   931     ].
   931         ].
       
   932         spec := specEdited class perform:((slices at:idx) last).
       
   933     ].
       
   934     specView raise.
       
   935 
   932     specEdited isNil ifTrue:[
   936     specEdited isNil ifTrue:[
   933         emptyView raise
   937         specView buildFromSpec:nil
   934     ] ifFalse:[
   938     ] ifFalse:[
   935         specView raise.
       
   936         specView buildFromSpec:spec
   939         specView buildFromSpec:spec
   937     ]
   940     ]
   938 ! !
   941 ! !
   939 
   942 
   940 !UIPainter methodsFor:'startup / release'!
   943 !UIPainter methodsFor:'startup / release'!