HorizontalPanelView.st
changeset 4023 06b045d4e152
parent 3778 c7257987a773
child 4565 4c4b47122c2c
--- a/HorizontalPanelView.st	Fri Oct 23 17:22:27 2009 +0200
+++ b/HorizontalPanelView.st	Fri Oct 23 17:22:29 2009 +0200
@@ -1131,7 +1131,7 @@
 
     |xpos space sumOfWidths numChilds l wEach wInside hL vL resizeToMaxV 
      resizeToMaxH maxHeight maxWidth m2 subViews ext
-     restWidth y2|
+     restWidth y2 bw|
 
     subViews := self subViewsToConsider.
     (numChilds := subViews size) == 0 ifTrue:[^ self].
@@ -1150,8 +1150,9 @@
 
     space := horizontalSpace.
 
+    bw := self borderWidth.
     m2 := margin * 2.
-    wInside := width - m2 + (borderWidth*2) - subViews last borderWidth.
+    wInside := width - m2 + (bw*2) - subViews last borderWidth.
 
     hL := hLayout.
     vL := vLayout.
@@ -1182,7 +1183,7 @@
          Be careful to avoid accumulation of rounding errors
         "
         wEach := (wInside - ((numChilds + 1) * space)) / numChilds.
-        xpos := space + margin - borderWidth.
+        xpos := space + margin - bw.
     ] ifFalse:[
         hL == #fit ifTrue:[
             "
@@ -1190,7 +1191,7 @@
              Be careful to avoid accumulation of rounding errors
             "
             wEach := (wInside - ((numChilds - 1) * space)) / numChilds.
-            xpos := margin - borderWidth.
+            xpos := margin - bw.
         ] ifFalse:[
             l := hL.
 
@@ -1237,7 +1238,7 @@
                 or:[l == #rightFit or:[l == #rightSpaceFit]]]) ifTrue:[
                     xpos := restWidth - (space * (numChilds - 1)).
 "/
-"/                    borderWidth == 0 ifTrue:[
+"/                    bw == 0 ifTrue:[
 "/                        xpos := xpos + space 
 "/                    ].
 "/
@@ -1413,7 +1414,7 @@
             |x|
 
             (hL == #leftFit or:[hL == #leftSpaceFit]) ifTrue:[
-                x := width - margin - 1 - (bwChild * 2) + borderWidth.
+                x := width - margin - 1 - (bwChild * 2) + bw.
                 hL == #leftSpaceFit ifTrue:[
                     x := x - space
                 ].
@@ -1422,7 +1423,7 @@
         ].
         index == 1 ifTrue:[
             (hL == #rightFit or:[hL == #rightSpaceFit]) ifTrue:[
-                xpos := margin + 0 + (bwChild * 2) - borderWidth.
+                xpos := margin + 0 + (bwChild * 2) - bw.
                 hL == #rightSpaceFit ifTrue:[
                     xpos := xpos + space
                 ].
@@ -1491,7 +1492,7 @@
 "/        maxHeight := maxHeight max:(child heightIncludingBorder).
 "/        maxWidth := maxWidth max:(child widthIncludingBorder).
     ].
-"/    borderWidth ~~ 0 ifTrue:[
+"/    self borderWidth ~~ 0 ifTrue:[
 "/        sumOfWidths := sumOfWidths + (horizontalSpace * 2).
 "/        maxHeight := maxHeight + (verticalSpace * 2).
 "/    ].
@@ -1500,7 +1501,7 @@
     or:[hLayout == #fitSpace
     or:[hLayout endsWith:'Max']]) ifTrue:[
         sumOfWidths := maxWidth * subViews size.
-        borderWidth ~~ 0 ifTrue:[
+        self borderWidth ~~ 0 ifTrue:[
             sumOfWidths := sumOfWidths + (horizontalSpace * 2).
         ].
         hLayout == #fitSpace ifTrue:[
@@ -1538,5 +1539,9 @@
 !HorizontalPanelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.60 2008-11-14 13:06:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.61 2009-10-23 15:22:29 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.61 2009-10-23 15:22:29 cg Exp $'
 ! !