VerticalPanelView.st
changeset 65 b33e4f3a264e
parent 63 f4eaf04d1eaf
child 77 565b052f5277
--- a/VerticalPanelView.st	Thu Nov 17 15:40:37 1994 +0100
+++ b/VerticalPanelView.st	Mon Nov 21 17:46:30 1994 +0100
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.6 1994-11-17 14:38:46 claus Exp $
+$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.7 1994-11-21 16:45:46 claus Exp $
 '!
 
 !VerticalPanelView class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.6 1994-11-17 14:38:46 claus Exp $
+$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.7 1994-11-21 16:45:46 claus Exp $
 "
 !
 
@@ -270,6 +270,7 @@
 
     sumOfHeights := 0.
     maxWidth := 0.
+    maxHeight := 0.
 
     subViews do:[:child |
 	|childsPreference|
@@ -287,8 +288,22 @@
 	sumOfHeights := sumOfHeights + (horizontalSpace * 2).
 	maxWidth := maxWidth + (horizontalSpace * 2).
     ].
-    sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
+    vLayout == #fit ifTrue:[
+	sumOfHeights := maxHeight * subViews size.
+	borderWidth ~~ 0 ifTrue:[
+	    sumOfHeights := sumOfHeights + (verticalSpace * 2).
+	]
+    ] ifFalse:[
+	sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
+    ].
 
+    ((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[
+	maxWidth := maxWidth + horizontalSpace
+    ] ifFalse:[
+	((hLayout == #fit) or:[hLayout == #center]) ifTrue:[
+	    maxWidth := maxWidth + (horizontalSpace * 2)
+	]        
+    ].
     ^ maxWidth @ sumOfHeights
 ! !