2014-07-16 20:30:19 -05:00
// 25 june 2014
package ui
type sizingbase struct {
2014-10-02 09:05:53 -05:00
xpadding int
ypadding int
2014-07-16 20:30:19 -05:00
}
2014-10-18 16:03:07 -05:00
// The container type, which is defined per-platform, is an internal Control that is only used to house other Controls from the underlying UI toolkit's point of view
2014-10-12 10:54:58 -05:00
2014-10-18 16:03:07 -05:00
/ * TODO
2014-08-04 16:46:08 -05:00
func ( c * container ) resize ( x , y , width , height int ) {
2014-10-02 09:05:53 -05:00
if c . child == nil { // no children; nothing to do
2014-07-25 18:28:34 -05:00
return
}
2014-07-28 13:00:01 -05:00
d := c . beginResize ( )
2014-10-02 09:05:53 -05:00
allocations := c . child . allocate ( x + d . xmargin , y + d . ymargintop ,
width - ( 2 * d . xmargin ) , height - d . ymargintop - d . ymarginbottom , d )
2014-07-25 18:28:34 -05:00
c . translateAllocationCoords ( allocations , width , height )
2014-07-16 20:30:19 -05:00
// move in reverse so as to approximate right->left order so neighbors make sense
for i := len ( allocations ) - 1 ; i >= 0 ; i -- {
allocations [ i ] . this . commitResize ( allocations [ i ] , d )
}
}
2014-10-18 16:03:07 -05:00
* /