GridBagLayoutView.st
changeset 2955 57c6b1a672dd
parent 2840 93e2b635838d
child 3245 facdad487e2f
equal deleted inserted replaced
2954:d9d43dc5d4a5 2955:57c6b1a672dd
   376 
   376 
   377     info startX:(((diffw / 2) + (insets left)) asInteger).
   377     info startX:(((diffw / 2) + (insets left)) asInteger).
   378     info startY:(((diffh / 2) + (insets top)) asInteger).
   378     info startY:(((diffh / 2) + (insets top)) asInteger).
   379 
   379 
   380     subViews do:[ :child |
   380     subViews do:[ :child |
   381         |rW rH|
   381         |rW rH minWidth minHeight|
   382 
   382 
   383         c := self constraints:child.
   383         c := self constraints:child.
       
   384         minWidth := info minWidth.
       
   385         minHeight := info minHeight.
   384 
   386 
   385         r setLeft:(info startX).
   387         r setLeft:(info startX).
   386         0 to:((c tempX) - 1) do:[ :i | r setLeft:((r left) + ((info minWidth) at:(i + 1))). ].
   388         0 to:((c tempX) - 1) do:[ :i | r setLeft:((r left) + (minWidth at:(i + 1))). ].
   387         
   389         
   388         r setTop:(info startY).
   390         r setTop:(info startY).
   389         0 to:((c tempY) - 1) do:[ :i | r setTop:((r top) + ((info minHeight) at:(i + 1))). ].
   391         0 to:((c tempY) - 1) do:[ :i | r setTop:((r top) + (minHeight at:(i + 1))). ].
   390 
   392 
   391         r width:0.
   393         r width:0.
   392         (c tempX) to:((c tempX) + (c tempWidth) - 1) do:[ :i |
   394         (c tempX) to:((c tempX) + (c tempWidth) - 1) do:[ :i |
   393             r width:((r width) + ((info minWidth) at:(i + 1))).
   395             r width:((r width) + (minWidth at:(i + 1))).
   394         ].
   396         ].
   395 
   397 
   396         r height:0.
   398         r height:0.
   397         (c tempY) to:((c tempY) + (c tempHeight) - 1) do:[ :i |
   399         (c tempY) to:((c tempY) + (c tempHeight) - 1) do:[ :i |
   398             r height:((r height) + ((info minHeight) at:(i + 1))).
   400             r height:((r height) + (minHeight at:(i + 1))).
   399         ].
   401         ].
   400 
   402 
   401         self adjustForGravity:c in:r.
   403         self adjustForGravity:c in:r.
   402 
   404 
   403         "/ If the window is too small to be interesting then
   405         "/ If the window is too small to be interesting then
   849 ! !
   851 ! !
   850 
   852 
   851 !GridBagLayoutView class methodsFor:'documentation'!
   853 !GridBagLayoutView class methodsFor:'documentation'!
   852 
   854 
   853 version
   855 version
   854     ^ '$Header: /cvs/stx/stx/libwidg2/GridBagLayoutView.st,v 1.5 2005-08-02 13:14:18 cg Exp $'
   856     ^ '$Header: /cvs/stx/stx/libwidg2/GridBagLayoutView.st,v 1.6 2006-04-04 12:26:56 cg Exp $'
   855 ! !
   857 ! !