equal
deleted
inserted
replaced
19 |
19 |
20 HorizontalPanelView comment:' |
20 HorizontalPanelView comment:' |
21 COPYRIGHT (c) 1989 by Claus Gittinger |
21 COPYRIGHT (c) 1989 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
23 |
23 |
24 $Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.15 1995-09-07 12:45:02 claus Exp $ |
24 $Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.16 1995-09-18 10:38:31 claus Exp $ |
25 '! |
25 '! |
26 |
26 |
27 !HorizontalPanelView class methodsFor:'documentation'! |
27 !HorizontalPanelView class methodsFor:'documentation'! |
28 |
28 |
29 copyright |
29 copyright |
40 " |
40 " |
41 ! |
41 ! |
42 |
42 |
43 version |
43 version |
44 " |
44 " |
45 $Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.15 1995-09-07 12:45:02 claus Exp $ |
45 $Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.16 1995-09-18 10:38:31 claus Exp $ |
46 " |
46 " |
47 ! |
47 ! |
48 |
48 |
49 documentation |
49 documentation |
50 " |
50 " |
1062 setChildPositions |
1062 setChildPositions |
1063 "(re)compute position of every child whenever childs are added or |
1063 "(re)compute position of every child whenever childs are added or |
1064 my size has changed" |
1064 my size has changed" |
1065 |
1065 |
1066 |xpos space sumOfWidths numChilds l wEach wInside hL vL resizeToMaxV |
1066 |xpos space sumOfWidths numChilds l wEach wInside hL vL resizeToMaxV |
1067 resizeToMaxH maxHeight maxWidth| |
1067 resizeToMaxH maxHeight maxWidth d| |
1068 |
1068 |
1069 subViews isNil ifTrue:[^ self]. |
1069 subViews isNil ifTrue:[^ self]. |
1070 |
1070 |
1071 space := horizontalSpace. |
1071 space := horizontalSpace. |
1072 numChilds := subViews size. |
1072 numChilds := subViews size. |
1256 (ypos < 0) ifTrue:[ypos := 0]. |
1256 (ypos < 0) ifTrue:[ypos := 0]. |
1257 |
1257 |
1258 (hL == #fit |
1258 (hL == #fit |
1259 or:[hL == #fitSpace |
1259 or:[hL == #fitSpace |
1260 or:[resizeToMaxH]]) ifTrue:[ |
1260 or:[resizeToMaxH]]) ifTrue:[ |
1261 child origin:(xpos truncated @ ypos) |
1261 child sizeFixed ifTrue:[ |
1262 corner:(xpos + wEach - (child borderWidth) - 1) truncated |
1262 d := wEach - (child widthIncludingBorder) // 2. |
1263 @ (ypos + child height - 1). |
1263 child origin:(xpos truncated + d @ ypos) |
|
1264 ] ifFalse:[ |
|
1265 child origin:(xpos truncated @ ypos) |
|
1266 corner:(xpos + wEach - (child borderWidth) - 1) truncated |
|
1267 @ (ypos + child height - 1). |
|
1268 ]. |
1264 advance := wEach. |
1269 advance := wEach. |
1265 ] ifFalse:[ |
1270 ] ifFalse:[ |
1266 child origin:(xpos @ ypos). |
1271 child origin:(xpos @ ypos). |
1267 advance := child widthIncludingBorder |
1272 advance := child widthIncludingBorder |
1268 ]. |
1273 ]. |