*** empty log message ***
authorwerner
Wed, 07 Apr 2004 15:23:25 +0200
changeset 1826 25ddfdfe0bf9
parent 1825 58bcec422efd
child 1827 691d1471cd3e
*** empty log message ***
UILayoutTool.st
--- a/UILayoutTool.st	Wed Apr 07 10:35:42 2004 +0200
+++ b/UILayoutTool.st	Wed Apr 07 15:23:25 2004 +0200
@@ -46,7 +46,7 @@
 
 UILayoutTool::AnyLayout subclass:#LayoutFrame
 	instanceVariableNames:''
-	classVariableNames:''
+	classVariableNames:'DefaultFixPartHeight'
 	poolDictionaries:''
 	privateIn:UILayoutTool
 !
@@ -538,19 +538,18 @@
 
     (self aspectFor:#defaultExtentEnabled) value:(aSpec class ==  WindowSpec) not.
 
-    aTypeOrNil notNil ifTrue:[
+    aTypeOrNil notNil ifTrue:[ 
         self class slices findFirst:[:e|
             e last == aTypeOrNil ifTrue:[name := e first. true]
         ].
-        list := Array with:name
+        list := Array with:name with: 'Frame'.
     ] ifFalse:[
         (type := UIPainterView layoutType:layoutView) notNil ifTrue:[
             self class slices findFirst:[:e|
                 e last == type ifTrue:[name := e first. true]
             ].
             list := tabList.
-
-            type == #Extent ifTrue:[
+            type == #Extent ifTrue:[ 
                 aView superView specClass isLayoutContainer ifTrue:[
                     list := Array with:name
                 ] ifFalse:[
@@ -1564,6 +1563,12 @@
 
 ! !
 
+!UILayoutTool::LayoutFrame class methodsFor:'defaults'!
+
+defaultFixPartHeight
+    ^ DefaultFixPartHeight ? 30
+! !
+
 !UILayoutTool::LayoutFrame class methodsFor:'help specs'!
 
 helpSpec
@@ -2201,6 +2206,22 @@
               menu: commonFrameLayoutsMenu2
               textDefault: true
             )
+           #(#MenuPanelSpec
+              #name: 'commonLayoutToolBar3'
+              #layout: #(LayoutFrame 6 0.0 295 0 -4 1.0 327 0)
+              #level: 0
+              #tabable: true
+              #menu: #commonFrameLayoutsMenu3
+              #textDefault: true
+
+
+
+
+
+
+
+
+            )
            )
          
         )
@@ -2427,15 +2448,54 @@
         nil
         nil
       )
+!
+
+commonFrameLayoutsMenu3
+    "This resource specification was automatically generated
+     by the MenuEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the MenuEditor may not be able to read the specification."
+
+    "
+     MenuEditor new openOnClass:UILayoutTool::LayoutFrame andSelector:#commonFrameLayoutsMenu2
+     (Menu new fromLiteralArrayEncoding:(UILayoutTool::LayoutFrame commonFrameLayoutsMenu2)) startUp
+    "
+
+    <resource: #menu>
+
+    ^ 
+     #(#Menu
+        #(
+         #(#MenuItem
+            #label: 'setScreenFrame'
+            #translateLabel: true
+            #isButton: true
+            #nameKey: #setScreenFrame
+            #value: #setScreenFrame
+            #activeHelpKey: #screenFrameLayout
+            #enabled: true
+            #labelImage: #(#ResourceRetriever #'UILayoutTool::LayoutFrame' #setScreenIcon)
+          )
+         )
+        nil
+        nil
+      )
 ! !
 
 !UILayoutTool::LayoutFrame methodsFor:'accessing'!
 
 fetch:aView spec:aSpec
+
     |layout|
 
-    layout  := UIPainterView asLayoutFrameFromView:aView.
-
+    aSpec class == WindowSpec ifTrue:[
+         (layout := aSpec layout) isNil ifTrue:[
+             layout := aSpec bounds asLayout.
+         ] 
+    ] ifFalse: [
+         layout  := UIPainterView asLayoutFrameFromView:aView.
+    ].
     (self aspectFor:#leftOffset)     value:(layout leftOffset).
     (self aspectFor:#leftFraction)   value:(layout leftFraction).
     (self aspectFor:#topOffset)      value:(layout topOffset).
@@ -2473,7 +2533,7 @@
     self
         setFrameLeft:0   offset:0 
         right:1          offset:0 
-        top:0            offset:30 
+        top:0            offset:(self class defaultFixPartHeight) 
         bottom:1         offset:0
 !
 
@@ -2481,8 +2541,8 @@
     self
         setFrameLeft:0   offset:0 
         right:1          offset:0 
-        top:0            offset:30 
-        bottom:1         offset:-30
+        top:0            offset:(self class defaultFixPartHeight) 
+        bottom:1         offset:(self class defaultFixPartHeight negated)
 !
 
 setBigTopFixPartFrame
@@ -2490,14 +2550,14 @@
         setFrameLeft:0   offset:0 
         right:1          offset:0 
         top:0            offset:0 
-        bottom:1         offset:-30
+        bottom:1         offset:(self class defaultFixPartHeight negated)
 !
 
 setBottomFixPartFrame
     self
         setFrameLeft:0   offset:0 
         right:1          offset:0 
-        top:1            offset:-30 
+        top:1            offset:(self class defaultFixPartHeight negated) 
         bottom:1         offset:0
 !
 
@@ -2549,14 +2609,14 @@
     self
         setFrameLeft:0   offset:0 
         right:1          offset:0 
-        top:0.5          offset:-15 
-        bottom:0.5       offset:15
+        top:0.5          offset:(self class defaultFixPartHeight negated // 2) 
+        bottom:0.5       offset:(self class defaultFixPartHeight // 2)
 !
 
 setLeftFixPartFrame
     self
         setFrameLeft:0   offset:0 
-        right:0          offset:30 
+        right:0          offset:(self class defaultFixPartHeight) 
         top:0            offset:0 
         bottom:1         offset:0
 !
@@ -2571,7 +2631,7 @@
 
 setRightFixPartFrame
     self
-        setFrameLeft:1   offset:-30 
+        setFrameLeft:1   offset:(self class defaultFixPartHeight negated) 
         right:1          offset:0 
         top:0            offset:0 
         bottom:1         offset:0
@@ -2590,7 +2650,7 @@
         setFrameLeft:0   offset:0 
         right:1          offset:0 
         top:0            offset:0 
-        bottom:0         offset:30
+        bottom:0         offset:(self class defaultFixPartHeight)
 !
 
 setTopHalfFrame
@@ -2619,8 +2679,8 @@
 
 setVerticalFixPartFrame
     self
-        setFrameLeft:0.5   offset:-15 
-        right:0.5          offset:15 
+        setFrameLeft:0.5   offset:(self class defaultFixPartHeight negated // 2 )
+        right:0.5          offset:(self class defaultFixPartHeight // 2 ) 
         top:0          offset:0 
         bottom:1       offset:0
 ! !