BoxSizerAdd

HC GUI programming BoxSizers BoxSizerAdd
BoxSizer BoxSizerDestroy

BoxSizerAdd aboxsizer acontrol proportion flag border


Command to add the control acontrol to the BoxSizer aboxsizer.

proportion indicates, if a child of a sizer can change its size in the main orientation of the BoxSizer - where 0 stands for not changeable and a value of more than zero is interpreted relative to the value of other children of the same BoxSizer. For example, you might have a horizontal BoxSizer with three children, two of which are supposed to change their size with the sizer. Then the two stretchable windows would get a value of 1 each to make them grow and shrink equally with the sizer's horizontal dimension. As another example you can have a BoxSizer with two children of whom the first shall be 150% of the size of the second, then you'd add the first child with a proportion of 150, and the second child with a proportion of 100.

flag can be used to set a number of flags which can be combined using the binary or BitOr (or + in most cases). Two main behaviours are defined using these flags. One is the border around a window: the border parameter determines the border width whereas the flags given here determine which side(s) of the item that the border will be added. The other flags determine how the sizer item behaves when the space allotted to the sizer changes, and is somewhat dependent on the specific kind of sizer used.

wxTOP

wxBOTTOM

wxLEFT

wxRIGHT

wxALL These flags are used to specify which side(s) of the sizer item the border width will apply to.

wxEXPAND The item will be expanded to fill the space assigned to the item.

wxSHAPED The item will be expanded as much as possible while also maintaining its aspect ratio

wxFIXED_MINSIZE Normally wxSizers will use GetAdjustedBestSize to determine what the minimal size of window items should be, and will use that size to calculate the layout. This allows layouts to adjust when an item changes and its best size becomes different. If you would rather have a window item stay the size it started with then use wxFIXED_MINSIZE.

wxALIGN_CENTER

wxALIGN_LEFT

wxALIGN_RIGHT

wxALIGN_TOP

wxALIGN_BOTTOM

wxALIGN_CENTER_VERTICAL

wxALIGN_CENTER_HORIZONTAL The wxALIGN flags allow you to specify the alignment of the item within the space allotted to it by the sizer, adjusted for the border if any.



border determines the border width, if the flag parameter is set to include any border flag.

For examples see BoxSizer!

Examples:

References:

BoxSizer BoxSizerDestroy