postBuild
authorClaus Gittinger <cg@exept.de>
Wed, 15 Feb 2006 21:25:09 +0100
changeset 1994 afcf20d971e0
parent 1993 249b56817140
child 1995 ad11533a39e8
postBuild
UIPainter.st
--- a/UIPainter.st	Wed Feb 15 21:12:52 2006 +0100
+++ b/UIPainter.st	Wed Feb 15 21:25:09 2006 +0100
@@ -3500,6 +3500,33 @@
     ].
 !
 
+commonPostBuild
+    "sets the root of the tree view as first selection;
+     sets the grid parameters, if defined"
+
+    |cls sel|
+
+    cls := specClassName.
+    cls isString ifTrue:[
+        cls := Smalltalk at:(cls string asSymbol)
+    ].
+    sel := specSelector.
+    cls notNil ifTrue:[
+        self setClass:cls selector:sel.
+
+        (cls respondsTo:sel) ifTrue:[  
+            self painter setupFromSpec:(cls perform:sel).
+        ]
+    ].
+
+    self autoAcceptOnSelectionChange addDependent:self.
+    self autoAcceptOnSelectionChange value ifTrue:[
+        (builder componentAt:'acceptButton') label:(resources string:'Apply')
+    ].
+
+    "Modified: / 22.8.1998 / 17:41:34 / cg"
+!
+
 initialize
     super initialize.
 
@@ -3535,7 +3562,7 @@
 !
 
 openInterface:aSymbol 
-    "opens the interface on the selector aSymbol"
+    "in addition to opening my interface, also open up a gallery and a painter"
     
     |cls painterView painter topView galleryWindow icon name|
 
@@ -3565,10 +3592,12 @@
         put:((specSelector notNil 
                 ifTrue:[ specSelector asValue ]
                 ifFalse:[ #windowSpec ]) asValue).
+
     treeView := TreeView new.
     treeView windowSpecClass:(self defaultWindowSpecClass).
     treeView 
         selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ].
+
     painterView := StandardSystemView new.
     name := name ? UIPainter defaultNameOfCanvas.
     painterView beToolWindow.
@@ -3580,11 +3609,14 @@
     treeView := treeView canvas:painter specName:name.
     painter treeView:treeView.
     treeView model addDependent:self.
+
     super openInterface:aSymbol.
+
     topView := self window.
     topView label:'GUI Painter'.
     painterView openInGroup:(topView windowGroup).
     painterView application:self.
+
     selectionPanel := self selectionPanelClass new.
     selectionPanel allButOpenInterface:#windowSpec.
     galleryWindow := selectionPanel window.
@@ -3637,50 +3669,18 @@
 !
 
 postBuildWith: aBuilder
-    "sets the root of the tree view as first selection;
-     sets the grid parameters, if defined"
-
-    |painter settings gridPara hspace vspace cls sel|
-
     super postBuildWith:aBuilder.
 
-    cls := specClassName.
-    cls isString ifTrue:[
-        cls := Smalltalk at:(cls string asSymbol)
-    ].
-    sel := specSelector.
     specSelector := nil.
     specClassName    := nil.
 
-    painter  := self painter.
-    settings := self class settings.
-    gridPara := painter gridParameters copy.
-    hspace   := settings at: #HGridSpace ifAbsent:10.
-    vspace   := settings at: #VGridSpace ifAbsent:10.
-    gridPara at:1 put:hspace; at:2 put:vspace; at:5 put:hspace; at:6 put:vspace.
-    painter gridParameters:gridPara.
-    painter gridShown: (settings at: #GridShown ifAbsent:false).
-    painter gridAlign: (settings at: #GridAlign ifAbsent:false).
-    painter shown ifTrue:[painter clearView].
-
-    cls notNil ifTrue:[
-        self setClass:cls selector:sel.
-
-        (cls respondsTo:sel) ifTrue:[  
-            painter setupFromSpec:(cls perform:sel).
-        ]
-    ].
-
-    self autoAcceptOnSelectionChange addDependent:self.
-    self autoAcceptOnSelectionChange value ifTrue:[
-        (builder componentAt:'acceptButton') label:(resources string:'Apply')
-    ].
+    self setupPainter.
 
     "Modified: / 22.8.1998 / 17:41:34 / cg"
 !
 
 postOpenWith: aBuilder
-    "sets the initial selection"
+    "spread the painter and gallery views on the screen"
 
     |myWindow canvasWindow canvasOrg galleryWindow 
      galleryOrg myOrg myCorner windowGroup|
@@ -3727,6 +3727,25 @@
 
 selectionPanelClass
     ^ UISelectionPanel
+!
+
+setupPainter
+    "sets the painter's grid parameters, if defined"
+
+    |painter settings gridPara hspace vspace|
+
+    painter  := self painter.
+    settings := self class settings.
+    gridPara := painter gridParameters copy.
+    hspace   := settings at: #HGridSpace ifAbsent:10.
+    vspace   := settings at: #VGridSpace ifAbsent:10.
+    gridPara at:1 put:hspace; at:2 put:vspace; at:5 put:hspace; at:6 put:vspace.
+    painter gridParameters:gridPara.
+    painter gridShown: (settings at: #GridShown ifAbsent:false).
+    painter gridAlign: (settings at: #GridAlign ifAbsent:false).
+    painter shown ifTrue:[painter clearView].
+
+    "Modified: / 22.8.1998 / 17:41:34 / cg"
 ! !
 
 !UIPainter methodsFor:'user actions'!