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 wxWidgets 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 FlexGridSizer.SetFlexibleDirection ), it needs to be decided how the sizer should grow in the other (“non-flexible”) direction in order to fill the available space. The FlexGridSizer.SetNonFlexibleGrowMode method serves this purpose.
See also
__init__ | FlexGridSizer constructors. |
AddGrowableCol | Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer. |
AddGrowableRow | Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer. |
CalcMin | This method is abstract and has to be overwritten by any derived class. |
GetFlexibleDirection | Returns a Orientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default). |
GetNonFlexibleGrowMode | Returns the value that specifies how the sizer grows in the “non-flexible” direction if there is one. |
IsColGrowable | Returns True if column idx is growable. |
IsRowGrowable | Returns True if row idx is growable. |
RecalcSizes | This method is abstract and has to be overwritten by any derived class. |
RemoveGrowableCol | Specifies that the idx column index is no longer growable. |
RemoveGrowableRow | Specifies that the idx row index is no longer growable. |
SetFlexibleDirection | Specifies whether the sizer should flexibly resize its columns, rows, or both. |
SetNonFlexibleGrowMode | Specifies how the sizer should grow in the non-flexible direction if there is one (so SetFlexibleDirection must have been called previously). |
FlexibleDirection | See GetFlexibleDirection and SetFlexibleDirection |
NonFlexibleGrowMode | See GetNonFlexibleGrowMode and SetNonFlexibleGrowMode |
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.
Possible constructors:
FlexGridSizer(cols, vgap, hgap)
FlexGridSizer(cols, gap=Size(0,0))
FlexGridSizer(rows, cols, vgap, hgap)
FlexGridSizer(rows, cols, gap)
FlexGridSizer constructors.
Please see GridSizer.__init__ documentation.
New in version 2.9.1: (except for the four argument overload)
Overloaded Implementations:
__init__ (self, cols, vgap, hgap)
Parameters: |
|
---|
__init__ (self, cols, gap=Size(0,0))
Parameters: |
|
---|
__init__ (self, rows, cols, vgap, hgap)
Parameters: |
|
---|
__init__ (self, rows, cols, gap)
Parameters: |
|
---|
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 (see BoxSizer) except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all).
Notice that the column must not be already growable, if you need to change the proportion you must call RemoveGrowableCol first and then make it growable (with a different proportion) again. You can use IsColGrowable to check whether a column is already growable.
Parameters: |
|
---|
Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.
This is identical to AddGrowableCol except that it works with rows and not columns.
Parameters: |
|
---|
This method is abstract and has to be overwritten by any derived class.
Here, the sizer will do the actual calculation of its children’s minimal sizes.
Return type: | Size |
---|
Returns a Orientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).
Return type: | int |
---|---|
Returns: | One of the following values:
|
See also
Returns the value that specifies how the sizer grows in the “non-flexible” direction if there is one.
The behaviour of the elements in the flexible direction (i.e. both rows and columns by default, or rows only if GetFlexibleDirection is VERTICAL or columns only if it is HORIZONTAL ) is always governed by their proportion as specified in the call to AddGrowableRow or AddGrowableCol . What happens in the other direction depends on the value of returned by this function as described below.
Return type: | FlexSizerGrowMode |
---|---|
Returns: | One of the following values:
|
See also
Returns True if column idx is growable.
Parameters: | idx (int) – |
---|---|
Return type: | bool |
New in version 2.9.0.
Returns True if row idx is growable.
Parameters: | idx (int) – |
---|---|
Return type: | bool |
New in version 2.9.0.
This method is abstract and has to be overwritten by any derived class.
Here, the sizer will do the actual calculation of its children’s positions and sizes.
Specifies that the idx column index is no longer growable.
Parameters: | idx (int) – |
---|
Specifies that the idx row index is no longer growable.
Parameters: | idx (int) – |
---|
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 GetFlexibleDirection for the explanation of these values. Note that this method does not trigger relayout.
Parameters: | direction (int) – |
---|
Specifies how the sizer should grow in the non-flexible direction if there is one (so SetFlexibleDirection must have been called previously).
Argument mode can be one of those documented in GetNonFlexibleGrowMode , please see there for their explanation. Note that this method does not trigger relayout.
Parameters: | mode (FlexSizerGrowMode) – |
---|