860 sumOfHeights := 0. |
860 sumOfHeights := 0. |
861 maxWidth := 0. |
861 maxWidth := 0. |
862 maxHeight := 0. |
862 maxHeight := 0. |
863 |
863 |
864 subViews do:[:child | |
864 subViews do:[:child | |
865 |childsPreference| |
865 |childsPreference| |
866 |
866 |
867 childsPreference := child preferredExtent. |
867 childsPreference := child preferredExtent. |
868 sumOfHeights := sumOfHeights + childsPreference y. |
868 sumOfHeights := sumOfHeights + childsPreference y. |
869 maxHeight := maxHeight max:childsPreference y. |
869 maxHeight := maxHeight max:childsPreference y. |
870 maxWidth := maxWidth max:childsPreference x. |
870 maxWidth := maxWidth max:childsPreference x. |
871 |
871 |
872 "/ sumOfHeights := sumOfHeights + child heightIncludingBorder. |
872 "/ sumOfHeights := sumOfHeights + child heightIncludingBorder. |
873 "/ maxWidth := maxWidth max:(child widthIncludingBorder). |
873 "/ maxWidth := maxWidth max:(child widthIncludingBorder). |
874 "/ maxHeight := maxHeight max:(child heightIncludingBorder). |
874 "/ maxHeight := maxHeight max:(child heightIncludingBorder). |
875 ]. |
875 ]. |
|
876 |
876 borderWidth ~~ 0 ifTrue:[ |
877 borderWidth ~~ 0 ifTrue:[ |
877 sumOfHeights := sumOfHeights + (horizontalSpace * 2). |
878 sumOfHeights := sumOfHeights + (verticalSpace * 2). |
878 maxWidth := maxWidth + (horizontalSpace * 2). |
879 maxWidth := maxWidth + (horizontalSpace * 2). |
879 ]. |
880 ]. |
|
881 |
880 (vLayout == #fit or:[vLayout == #fitSpace]) ifTrue:[ |
882 (vLayout == #fit or:[vLayout == #fitSpace]) ifTrue:[ |
881 sumOfHeights := maxHeight * subViews size. |
883 sumOfHeights := maxHeight * subViews size. |
882 borderWidth ~~ 0 ifTrue:[ |
884 borderWidth ~~ 0 ifTrue:[ |
883 sumOfHeights := sumOfHeights + (verticalSpace * 2). |
885 sumOfHeights := sumOfHeights + (verticalSpace * 2). |
884 ] |
886 ] |
885 ] ifFalse:[ |
887 ] ifFalse:[ |
886 sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace). |
888 sumOfHeights := sumOfHeights + ((subViews size - 1) * verticalSpace). |
887 vLayout == #topSpace ifTrue:[ |
889 vLayout == #topSpace ifTrue:[ |
888 sumOfHeights := sumOfHeights + verticalSpace |
890 sumOfHeights := sumOfHeights + verticalSpace |
889 ] ifFalse:[ |
891 ] ifFalse:[ |
890 ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[ |
892 ((vLayout == #center) or:[vLayout == #spread]) ifTrue:[ |
891 sumOfHeights := sumOfHeights + (verticalSpace * 2) |
893 sumOfHeights := sumOfHeights + (verticalSpace * 2) |
892 ] |
894 ] |
893 ]. |
895 ]. |
894 ]. |
896 ]. |
895 |
897 |
896 ((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[ |
898 ((hLayout == #leftSpace) or:[hLayout == #rightSpace]) ifTrue:[ |
897 maxWidth := maxWidth + horizontalSpace |
899 maxWidth := maxWidth + horizontalSpace |
898 ] ifFalse:[ |
900 ] ifFalse:[ |
899 ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[ |
901 ((hLayout == #fitSpace) or:[hLayout == #center]) ifTrue:[ |
900 maxWidth := maxWidth + (horizontalSpace * 2) |
902 maxWidth := maxWidth + (horizontalSpace * 2) |
901 ] |
903 ] |
902 ]. |
904 ]. |
903 ^ maxWidth @ sumOfHeights |
905 ^ maxWidth @ sumOfHeights |
|
906 |
|
907 "Modified: 6.2.1996 / 14:31:20 / cg" |
904 ! ! |
908 ! ! |
905 |
909 |
906 !VerticalPanelView class methodsFor:'documentation'! |
910 !VerticalPanelView class methodsFor:'documentation'! |
907 |
911 |
908 version |
912 version |
909 ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.17 1995-11-23 18:16:34 cg Exp $' |
913 ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.18 1996-02-06 20:46:13 cg Exp $' |
910 ! ! |
914 ! ! |