VerticalPanelView.st
changeset 980 6079922a5519
parent 797 2f9cd56f48ee
child 1000 cf4ad1135e06
equal deleted inserted replaced
979:c71f75bb9ffc 980:6079922a5519
    15 	classVariableNames:''
    15 	classVariableNames:''
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Views-Layout'
    17 	category:'Views-Layout'
    18 !
    18 !
    19 
    19 
    20 !VerticalPanelView  class methodsFor:'documentation'!
    20 !VerticalPanelView class methodsFor:'documentation'!
    21 
    21 
    22 copyright
    22 copyright
    23 "
    23 "
    24  COPYRIGHT (c) 1989 by Claus Gittinger
    24  COPYRIGHT (c) 1989 by Claus Gittinger
    25 	      All Rights Reserved
    25 	      All Rights Reserved
   649 !VerticalPanelView methodsFor:'layout'!
   649 !VerticalPanelView methodsFor:'layout'!
   650 
   650 
   651 setChildPositions
   651 setChildPositions
   652     "(re)compute position of every child"
   652     "(re)compute position of every child"
   653 
   653 
   654     |ypos space sumOfHeights numChilds l hEach hInside maxWidth resizeToMax hL m2|
   654     |ypos space sumOfHeights numChilds l hEach hInside 
   655 
   655      maxWidth resizeToMax hL m2 subViews|
       
   656 
       
   657     subViews := self subViews.
   656     subViews isNil ifTrue:[^ self].
   658     subViews isNil ifTrue:[^ self].
   657 
   659 
   658     space := verticalSpace.
   660     space := verticalSpace.
   659     numChilds := subViews size.
   661     numChilds := subViews size.
   660     m2 := margin * 2.
   662     m2 := margin * 2.
   873             ]
   875             ]
   874         ]
   876         ]
   875     ]
   877     ]
   876 
   878 
   877     "Modified: 4.9.1995 / 18:43:29 / claus"
   879     "Modified: 4.9.1995 / 18:43:29 / claus"
   878     "Modified: 17.7.1996 / 12:01:31 / cg"
   880     "Modified: 28.1.1997 / 17:57:05 / cg"
   879 ! !
   881 ! !
   880 
   882 
   881 !VerticalPanelView methodsFor:'queries'!
   883 !VerticalPanelView methodsFor:'queries'!
   882 
   884 
   883 preferredExtent
   885 preferredExtent
   884     "return a good extent, one that makes subviews fit"
   886     "return a good extent, one that makes subviews fit"
   885 
   887 
   886     |sumOfHeights maxWidth maxHeight m2|
   888     |sumOfHeights maxWidth maxHeight m2 subViews|
   887 
   889 
   888     "/ If I have an explicit preferredExtent ..
   890     "/ If I have an explicit preferredExtent ..
   889 
   891 
   890     preferredExtent notNil ifTrue:[
   892     preferredExtent notNil ifTrue:[
   891         ^ preferredExtent
   893         ^ preferredExtent
   892     ].
   894     ].
   893 
   895 
   894     subViews isNil ifTrue:[^ horizontalSpace @ verticalSpace].
   896     (subViews := self subViews) isNil ifTrue:[^ horizontalSpace @ verticalSpace].
   895 
   897 
   896     "compute net height needed"
   898     "compute net height needed"
   897 
   899 
   898     sumOfHeights := 0.
   900     sumOfHeights := 0.
   899     maxWidth := 0.
   901     maxWidth := 0.
   941         ]        
   943         ]        
   942     ].
   944     ].
   943     m2 := margin * 2.
   945     m2 := margin * 2.
   944     ^ (maxWidth + m2) @ (sumOfHeights + m2)
   946     ^ (maxWidth + m2) @ (sumOfHeights + m2)
   945 
   947 
   946     "Modified: 19.7.1996 / 20:45:46 / cg"
   948     "Modified: 28.1.1997 / 17:56:45 / cg"
   947 ! !
   949 ! !
   948 
   950 
   949 !VerticalPanelView  class methodsFor:'documentation'!
   951 !VerticalPanelView class methodsFor:'documentation'!
   950 
   952 
   951 version
   953 version
   952     ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.25 1996-07-19 18:47:49 cg Exp $'
   954     ^ '$Header: /cvs/stx/stx/libwidg/VerticalPanelView.st,v 1.26 1997-01-28 17:05:55 cg Exp $'
   953 ! !
   955 ! !