--- a/VerticalPanelView.st Fri Jun 20 14:45:27 1997 +0200
+++ b/VerticalPanelView.st Fri Jun 27 11:56:45 1997 +0200
@@ -652,7 +652,7 @@
"(re)compute position of every child"
|ypos space sumOfHeights numChilds l hEach hInside
- maxWidth resizeToMax hL m2 subViews ext|
+ maxWidth resizeToMax hL m2 subViews ext restHeight|
subViews := self subViews.
subViews size == 0 ifTrue:[^ self].
@@ -688,6 +688,7 @@
compute net height needed
"
sumOfHeights := subViews inject:0 into:[:sumSoFar :child | sumSoFar + child heightIncludingBorder].
+ restHeight := height - sumOfHeights.
l := vLayout.
((l == #center) and:[numChilds == 1]) ifTrue:[
@@ -718,7 +719,7 @@
]
].
((l == #bottom) or:[l == #bottomSpace]) ifTrue:[
- ypos := height - (space * (numChilds - 1)) - sumOfHeights.
+ ypos := restHeight - (space * (numChilds - 1)).
"
borderWidth == 0 ifTrue:[
ypos := ypos + space
@@ -731,29 +732,29 @@
].
ypos < 0 ifTrue:[
- space := space min:(height - sumOfHeights) // (numChilds + 1).
- ypos := height - (space * numChilds) - sumOfHeights.
+ space := space min:(restHeight // (numChilds + 1)).
+ ypos := restHeight - (space * numChilds).
]
] ifFalse: [
(l == #spread) ifTrue:[
- space := (height - m2 - sumOfHeights) // (numChilds - 1).
+ space := (restHeight - m2) // (numChilds - 1).
ypos := margin.
(space == 0) ifTrue:[
- ypos := (height - sumOfHeights) // 2
+ ypos := restHeight // 2
]
] ifFalse: [
(l == #spreadSpace) ifTrue:[
- space := (height - sumOfHeights) // (numChilds + 1).
+ space := restHeight // (numChilds + 1).
ypos := space.
(space == 0) ifTrue:[
- ypos := (height - sumOfHeights) // 2
+ ypos := restHeight // 2
]
] ifFalse: [
((l == #top)
or:[l == #topSpace
or:[l == #topFit
or:[l == #topSpaceFit]]]) ifTrue:[
- space := space min:(height - sumOfHeights - m2) // (numChilds + 1).
+ space := space min:(restHeight - m2) // (numChilds + 1).
(vLayout == #fixTop or:[vLayout == #fixTopSpace]) ifTrue:[
space := space max:verticalSpace.
] ifFalse:[
@@ -775,12 +776,10 @@
]
] ifFalse:[
"center"
- ypos := (height - (sumOfHeights
- + ((numChilds - 1) * space))) // 2.
+ ypos := (restHeight - ((numChilds - 1) * space)) // 2.
ypos < 0 ifTrue:[
- space := (height - sumOfHeights) // (numChilds + 1).
- ypos := (height - (sumOfHeights
- + ((numChilds - 1) * space))) // 2.
+ space := restHeight // (numChilds + 1).
+ ypos := (restHeight - ((numChilds - 1) * space)) // 2.
]
]
]
@@ -886,7 +885,7 @@
]
"Modified: 4.9.1995 / 18:43:29 / claus"
- "Modified: 28.1.1997 / 17:57:05 / cg"
+ "Modified: 27.6.1997 / 11:50:47 / cg"
! !
!VerticalPanelView methodsFor:'queries'!
@@ -964,5 +963,5 @@
!VerticalPanelView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.29 1997-02-25 13:03:55 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.30 1997-06-27 09:56:25 cg Exp $'
! !