remember previous relative sizes and
authorClaus Gittinger <cg@exept.de>
Tue, 29 Oct 2002 22:28:13 +0100
changeset 1640 87ce36f48fbc
parent 1639 8f2059cc287c
child 1641 7e63a11f3333
remember previous relative sizes and come up with those as default.
ImageEditor.st
--- a/ImageEditor.st	Tue Oct 29 18:12:19 2002 +0100
+++ b/ImageEditor.st	Tue Oct 29 22:28:13 2002 +0100
@@ -15,7 +15,8 @@
 ToolApplicationModel subclass:#ImageEditor
 	instanceVariableNames:'imageEditView colorMapMode editMode mouseKeyColorMode
 		selectedColorIndex postOpenAction imageSeqNr'
-	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode'
+	classVariableNames:'LastDirectory LastSizeString MaskClipboard LastColormapMode
+		DefaultRelativeSizes'
 	poolDictionaries:''
 	category:'Interface-UIPainter'
 !
@@ -1162,7 +1163,7 @@
           #label: 'Image Editor'
           #name: 'Image Editor'
           #min: #(#Point 400 320)
-          #bounds: #(#Rectangle 105 601 555 951)
+          #bounds: #(#Rectangle 16 46 466 396)
           #menu: #menu
         )
         #component: 
@@ -1176,7 +1177,7 @@
               #showSeparatingLines: true
             )
            #(#VariableHorizontalPanelSpec
-              #name: 'variableHorizontalPanel1'
+              #name: 'horizontalPanel'
               #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
               #snapMode: #both
               #barLevel: 1
@@ -1190,7 +1191,7 @@
                    #(#SpecCollection
                       #collection: #(
                        #(#VariableVerticalPanelSpec
-                          #name: 'VariableVerticalPanel1'
+                          #name: 'verticalPanel'
                           #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
                           #level: 0
                           #snapMode: #both
@@ -2927,6 +2928,15 @@
 
 !ImageEditor methodsFor:'startup / release'!
 
+closeDownViews
+    DefaultRelativeSizes :=
+        Array 
+            with:(builder componentAt:#horizontalPanel) relativeCorners    
+            with:(builder componentAt:#verticalPanel) relativeCorners.
+
+    super closeDownViews
+!
+
 closeRequest
     "close request"
 
@@ -2942,6 +2952,15 @@
     imageEditView := (self componentAt: #imageEditView) subViews first.
 !
 
+postBuildWith:aBuilder
+    super postBuildWith:aBuilder.
+
+    DefaultRelativeSizes notNil ifTrue:[
+        (aBuilder componentAt:#horizontalPanel) relativeCorners:DefaultRelativeSizes first.
+        (aBuilder componentAt:#verticalPanel) relativeCorners:DefaultRelativeSizes second.
+    ].
+!
+
 postOpenWith:aBuilder
     "after opening, sets the masterApplication of the imageEditView to self;
      evaluate the postOpenAction"