MultiColumnPanelView.st
changeset 4019 bf57f58f13a8
parent 3760 96d214ff4395
child 4564 0a0d41148e11
--- a/MultiColumnPanelView.st	Fri Oct 23 17:22:01 2009 +0200
+++ b/MultiColumnPanelView.st	Fri Oct 23 17:22:19 2009 +0200
@@ -275,7 +275,7 @@
 
     |xpos ypos space sumOfHeights numChilds l hEach hInside hL vL
      maxWidth maxHeight resizeToMaxV resizeToMaxH m2 subViews restHeight
-     rowsPerCol maxWidthPerCol col numCols cX cY|
+     rowsPerCol maxWidthPerCol col numCols cX cY bw|
 
     subViews := self subViewsToConsider.
     subViews size == 0 ifTrue:[^ self].
@@ -290,8 +290,9 @@
     numChilds := subViews size.
     numCols := columnWidths size max:1.
 
+    bw := self borderWidth.
     m2 := margin * 2.
-    hInside := height - m2 + (borderWidth*2) - subViews last borderWidth.
+    hInside := height - m2 + (bw*2) - subViews last borderWidth.
 
     hL := hLayout.
     vL := vLayout.
@@ -363,7 +364,7 @@
          Be careful to avoid accumulation of rounding errors
         "
         hEach := (hInside - ((numChilds + 1) * space)) / numChilds.
-        ypos := space + margin - borderWidth.
+        ypos := space + margin - bw.
     ] ifFalse:[
         vL == #fit ifTrue:[
             "
@@ -371,7 +372,7 @@
              Be careful to avoid accumulation of rounding errors
             "
             hEach := (hInside - ((numChilds - 1) * space)) / numChilds.
-            ypos := margin - borderWidth.
+            ypos := margin - bw.
         ] ifFalse:[
             l := vL.
 
@@ -422,7 +423,7 @@
                 or:[l == #bottomFit or:[l == #bottomSpaceFit]]]) ifTrue:[
                     ypos := restHeight - (space * (numChilds - 1)).
 "/
-"/                    borderWidth == 0 ifTrue:[
+"/                    bw == 0 ifTrue:[
 "/                        ypos := ypos + space 
 "/                    ].
 "/           
@@ -514,7 +515,7 @@
         ].
 
         hL == #left ifTrue:[
-            xpos := 0 - borderWidth + margin.
+            xpos := 0 - bw + margin.
         ] ifFalse:[
             hL == #leftSpace ifTrue:[
                 xpos := horizontalSpace + margin
@@ -531,14 +532,14 @@
                         ] ifFalse:[
                             hL == #fit ifTrue:[
                                 newWChild := width "- (bwChild * 2)".
-                                borderWidth == 0 ifTrue:[
+                                bw == 0 ifTrue:[
                                     newWChild :=  newWChild - (bwChild * 2)
                                 ].
                                 true "child level == 0" ifTrue:[
-                                    xpos := margin - borderWidth.
+                                    xpos := margin - bw.
                                     newWChild := newWChild - m2
                                 ] ifFalse:[
-                                    xpos := 0 - borderWidth. 
+                                    xpos := 0 - bw. 
                                 ].
                             ] ifFalse:[
                                 "centered"
@@ -581,7 +582,7 @@
         ].
         index == 1 ifTrue:[
             (vL == #bottomFit or:[vL == #bottomSpaceFit]) ifTrue:[
-                ypos := margin + 0 + (child borderWidth * 2) - borderWidth.
+                ypos := margin + 0 + (child borderWidth * 2) - bw.
                 vL == #bottomSpaceFit ifTrue:[
                     ypos := ypos + space
                 ].
@@ -642,7 +643,7 @@
         col > numCols ifTrue:[ col := 1 ].
     ].
 
-    borderWidth ~~ 0 ifTrue:[
+    self borderWidth ~~ 0 ifTrue:[
         maxWidth := maxWidth + (horizontalSpace * 2).
     ].
 
@@ -675,5 +676,9 @@
 !MultiColumnPanelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/MultiColumnPanelView.st,v 1.2 2008-10-26 20:11:53 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/MultiColumnPanelView.st,v 1.3 2009-10-23 15:22:19 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libwidg/MultiColumnPanelView.st,v 1.3 2009-10-23 15:22:19 cg Exp $'
 ! !