support of menu and srollers for the canvas
authorca
Fri, 05 Sep 1997 11:03:47 +0200
changeset 311 52f954630dca
parent 310 a68c182d050f
child 312 386932d91a97
support of menu and srollers for the canvas
UIPainter.st
--- a/UIPainter.st	Fri Sep 05 11:02:28 1997 +0200
+++ b/UIPainter.st	Fri Sep 05 11:03:47 1997 +0200
@@ -22,7 +22,7 @@
 
 SelectionInTreeView subclass:#TreeView
 	instanceVariableNames:'lastDrawnMaster cvsEventsDisabled imageMasterParent
-		imageEmptyParent imageMasterChild'
+		imageEmptyParent imageMasterChild windowSpec'
 	classVariableNames:'ImageMasterParent ImageMasterChild ImageEmptyParent'
 	poolDictionaries:''
 	privateIn:UIPainter
@@ -2644,11 +2644,30 @@
     |spec|
 
     spec := WindowSpec new.
+
     spec fromView:(self canvas topView) callBack:nil.
     spec name:(listOfNodes at:1) name.
+
+    windowSpec notNil ifTrue:[
+        spec  menu:(windowSpec menu).
+        spec flags:(windowSpec flags).
+    ].
   ^ spec
 !
 
+canvasSpec:aSpec
+    "update canvas from spec
+    "
+    |spec|
+
+    self setAttributesFromWindowSpec:aSpec.
+    spec := aSpec copy.
+    spec  menu:nil.
+    spec flags:nil.
+
+    spec setAttributesIn:(self canvas topView) with:(UIBuilder new).
+!
+
 itemOfView:aView
     "returns item assigned to view or nil
     "
@@ -2716,6 +2735,7 @@
     "remove all items other than canvas
     "
     lastDrawnMaster := nil.
+    windowSpec := nil.
 
     self canvas subViews copy do:[:aView|
         (aView isKindOf:InputView) ifFalse:[aView destroy]
@@ -2742,6 +2762,36 @@
 
 ! !
 
+!UIPainter::TreeView methodsFor:'building'!
+
+generateFullSpecForComponents:aSpecArray
+    "generates an full spec for components
+    "
+    |fullSpec|
+
+    fullSpec := FullSpec new.
+
+    fullSpec fromBuilder:(self canvas topView)
+              components:(SpecCollection new collection:aSpecArray).
+
+    windowSpec notNil ifTrue:[
+        fullSpec window  menu:(windowSpec menu).
+        fullSpec window flags:(windowSpec flags).
+    ].    
+    ^ fullSpec literalArrayEncoding.
+!
+
+setAttributesFromWindowSpec:aWindowSpec
+    "set windowSpec from argument a WindowSpec
+    "
+    windowSpec := WindowSpec new.
+
+    windowSpec  menu:(aWindowSpec menu).
+    windowSpec flags:(aWindowSpec flags).
+
+    self canvasNameChanged:aWindowSpec name.
+! !
+
 !UIPainter::TreeView methodsFor:'canvas selection'!
 
 cvsSelection:aSelection