A flex grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or width as in the GridSizer.
Since Widgets 2.5.0, FlexGridSizer can also size items equally in one direction but unequally (“flexibly”) in the other. If the sizer is only flexible in one direction (this can be changed using set_flexible_drection), it needs to be decided how the sizer should grow in the other (“non flexible”) direction in order to fill the available space. The set_non_flexible_grow_mode method serves this purpose.
FlexGridSizer.new(Integer rows, Integer cols, Integer vgap,
Integer hgap)
FlexGridSizer.new(Integer cols, Integer vgap = 0,
Integer hgap = 0)
Constructor for a GridSizer. rows and cols determine the number of columns and rows in the sizer – if either of the parameters is zero, it will be calculated to form the total number of children in the sizer, thus making the sizer grow dynamically. vgap and hgap define extra space between all children.
add_growable_col(Integer idx, Integer proportion = $0$)
Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer.
The proportion parameter has the same meaning as the stretch factor for the sizers except that if all proportions are $0$, then all columns are resized equally (instead of not being resized at all).
add_growable_row(Integer idx, Integer proportion = $0$)
Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.
See add_growable_col for the description of proportion parameter.
Integer get_flexible_directions()
Returns a Orientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).
One of the following values:
| VERTICAL | Rows are flexibly sized. |
| HORIZONTAL | Columns are flexibly sized. |
| BOTH | Both rows and columns are flexibly sized (this is the default value). |
Integer get_non_flexible_grow_mode()
Returns the value that specifies how the sizer grows in the “non flexible” direction if there is one.
One of the following values:
| FLEX_GROWMODE_NONE | Sizer doesn’t grow in the non flexible direction. |
| FLEX_GROWMODE_SPECIFIED | Sizer honors growable columns/rows set withadd_growable_col and add_growable_row this case equal sizing applies to minimum sizes of columns orrows (this is the default value). |
| FLEX_GROWMODE_ALL | Sizer equally stretches all columns or rowsin the non flexible direction, whether they are growable or not in the flexibledirection. |
set_flexible_drection, set_non_flexible_grow_mode
remove_growable_col(Integer idx)
Specifies that column idx is no longer growable.
remove_growable_row(Integer idx)
Specifies that row idx is no longer growable.
set_flexible_directions(Integer direction)
Specifies whether the sizer should flexibly resize its columns, rows, or
both. Argument direction can be VERTICAL, HORIZONTAL
or BOTH (which is the default value). Any other value is ignored. See
get_flexible_direction()() for the
explanation of these values.
Note that this method does not trigger relayout.
set_non_flexible_grow_mode(FlexSizerGrowMode mode)
Specifies how the sizer should grow in the non flexible direction if there is one (so set_flexible_directions()() must have been called previously). Argument mode can be one of those documented in get_non_flexible_grow_mode, please see there for their explanation.
Note that this method does not trigger relayout.
[This page automatically generated from the Textile source at Thu May 01 00:50:36 +0100 2008]