--- a/VerticalPanelView.st Wed Aug 01 15:11:52 2001 +0200
+++ b/VerticalPanelView.st Wed Aug 01 15:23:47 2001 +0200
@@ -993,13 +993,13 @@
"/ If I have an explicit preferredExtent ..
preferredExtent notNil ifTrue:[
- ^ preferredExtent
+ ^ preferredExtent
].
subViews := self subViewsToConsider.
(subViews size == 0) ifTrue:[
- ^ super preferredExtent.
- "/ ^ horizontalSpace @ verticalSpace].
+ ^ super preferredExtent.
+ "/ ^ horizontalSpace @ verticalSpace].
].
@@ -1010,12 +1010,12 @@
maxHeight := 0.
subViews do:[:child |
- |childsPreference|
+ |childsPreference|
- childsPreference := child preferredExtent.
- sumOfHeights := sumOfHeights + childsPreference y.
- maxHeight := maxHeight max:childsPreference y.
- maxWidth := maxWidth max:childsPreference x.
+ childsPreference := child preferredExtent.
+ sumOfHeights := sumOfHeights + childsPreference y.
+ maxHeight := maxHeight max:childsPreference y.
+ maxWidth := maxWidth max:childsPreference x.
"/ sumOfHeights := sumOfHeights + child heightIncludingBorder.
"/ maxWidth := maxWidth max:(child widthIncludingBorder).
@@ -1023,32 +1023,36 @@
].
borderWidth ~~ 0 ifTrue:[
- sumOfHeights := sumOfHeights + (verticalSpace * 2).
- maxWidth := maxWidth + (horizontalSpace * 2).
+ sumOfHeights := sumOfHeights + (verticalSpace * 2).
+ maxWidth := maxWidth + (horizontalSpace * 2).
].
(vLayout == #fit or:[vLayout == #fitSpace]) ifTrue:[
- sumOfHeights := maxHeight * subViews size.
- borderWidth ~~ 0 ifTrue:[
- sumOfHeights := sumOfHeights + (verticalSpace * 2).
- ]
+ sumOfHeights := maxHeight * subViews size.
+ borderWidth ~~ 0 ifTrue:[
+ sumOfHeights := sumOfHeights + (verticalSpace * 2).
+ ].
+ vLayout == #fitSpace ifTrue:[
+ "/ care for spacing ...
+ sumOfHeights := sumOfHeights + (verticalSpace * (subViews size + 1)).
+ ].
] ifFalse:[
- sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
- ((vLayout == #topSpace) or:[vLayout == #bottomSpace]) ifTrue:[
- sumOfHeights := sumOfHeights + verticalSpace
- ] ifFalse:[
- ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[
- sumOfHeights := sumOfHeights + (verticalSpace * 2)
- ]
- ].
+ sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace).
+ ((vLayout == #topSpace) or:[vLayout == #bottomSpace]) ifTrue:[
+ sumOfHeights := sumOfHeights + verticalSpace
+ ] ifFalse:[
+ ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[
+ sumOfHeights := sumOfHeights + (verticalSpace * 2)
+ ]
+ ].
].
((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[
- maxWidth := maxWidth + horizontalSpace
+ maxWidth := maxWidth + horizontalSpace
] ifFalse:[
- ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[
- maxWidth := maxWidth + (horizontalSpace * 2)
- ]
+ ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[
+ maxWidth := maxWidth + (horizontalSpace * 2)
+ ]
].
m2 := margin * 2.
^ (maxWidth + m2) @ (sumOfHeights + m2)
@@ -1059,5 +1063,5 @@
!VerticalPanelView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.38 2001-05-17 22:43:22 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.39 2001-08-01 13:23:44 cg Exp $'
! !