**************** wx.FlexGridSizer **************** Inheritance diagram for `wx.FlexGridSizer`: | .. inheritance-diagram:: wx.FlexGridSizer | Description =========== 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 `wx.GridSizer `_. Since wxWidgets 2.5.0, `wx.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 `SetFlexibleDirection <#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 `SetNonFlexibleGrowMode <#SetNonFlexibleGrowMode>`_ method serves this purpose. .. seealso:: `wx.Sizer `_ Derived From ^^^^^^^^^^^^^ * `wx.GridSizer `_ * `wx.Sizer `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.GridBagSizer `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `AddGrowableCol <#AddGrowableCol>`_ * `AddGrowableRow <#AddGrowableRow>`_ * `GetColWidths <#GetColWidths>`_ * `GetFlexibleDirection <#GetFlexibleDirection>`_ * `GetNonFlexibleGrowMode <#GetNonFlexibleGrowMode>`_ * `GetRowHeights <#GetRowHeights>`_ * `RemoveGrowableCol <#RemoveGrowableCol>`_ * `RemoveGrowableRow <#RemoveGrowableRow>`_ * `SetFlexibleDirection <#SetFlexibleDirection>`_ * `SetNonFlexibleGrowMode <#SetNonFlexibleGrowMode>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `ColWidths <#ColWidths>`_ * `FlexibleDirection <#FlexibleDirection>`_ * `NonFlexibleGrowMode <#NonFlexibleGrowMode>`_ * `RowHeights <#RowHeights>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(rows=1, cols=0, vgap=0, hgap=0) Constructor for a `wx.FlexGridSizer`. `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 from the total number of children in the sizer, thus making the sizer grow dynamically. `vgap` and `hgap` define extra space between all children. **Parameters:** * `rows` (int) * `cols` (int) * `vgap` (int) * `hgap` (int) | **Returns:** `wx.FlexGridSizer `_ -------- .. method:: AddGrowableCol(idx, 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). **Parameters:** * `idx` (long) * `proportion` (int) -------- .. method:: AddGrowableRow(idx, proportion=0) Specifies that row `idx` (starting from zero) should be grown if there is extra space available to the sizer. **Parameters:** * `idx` (long) * `proportion` (int) .. seealso:: `AddGrowableCol <#AddGrowableCol>`_ -------- .. method:: GetColWidths() Returns a list of integers representing the widths of each of the columns in the sizer. | **Returns:** `list` -------- .. method:: GetFlexibleDirection() Returns a value that specifies whether the sizer flexibly resizes its columns, rows, or both (default). | **Returns:** `int` .. seealso:: `SetFlexibleDirection <#SetFlexibleDirection>`_ -------- .. method:: GetNonFlexibleGrowMode() Returns the value that specifies how the sizer grows in the "non-flexible" direction if there is one. | **Returns:** `int` .. seealso:: `SetFlexibleDirection <#SetFlexibleDirection>`_, `SetNonFlexibleGrowMode <#SetNonFlexibleGrowMode>`_ -------- .. method:: GetRowHeights() Returns a list of integers representing the heights of each of the rows in the sizer. | **Returns:** `list` -------- .. method:: RemoveGrowableCol(idx) Specifies that column `idx` is no longer growable. **Parameters:** * `idx` (long) -------- .. method:: RemoveGrowableRow(idx) Specifies that row `idx` is no longer growable. **Parameters:** * `idx` (long) -------- .. method:: SetFlexibleDirection(direction) Specifies whether the sizer should flexibly resize its columns, rows, or both. Argument `direction` can be ``wx.VERTICAL``, ``wx.HORIZONTAL`` or ``wx.BOTH`` (which is the default value). Any other value is ignored. **Parameters:** * `direction` (int) .. note:: Note that this method does not trigger relayout. .. seealso:: `GetFlexibleDirection <#GetFlexibleDirection>`_ -------- .. method:: SetNonFlexibleGrowMode(mode) Specifies how the sizer should grow in the non-flexible direction if there is one (so `SetFlexibleDirection <#SetFlexibleDirection>`_ must have been called previously). Argument `mode` can be one of these values: ================================== ============================================= Mode Flag Description ================================== ============================================= ``wx.FLEX_GROWMODE_NONE`` Sizer doesn't grow in the non flexible direction. ``wx.FLEX_GROWMODE_SPECIFIED`` Sizer honors growable columns/rows set with `AddGrowableCol <#AddGrowableCol>`_ and `AddGrowableRow <#AddGrowableRow>`_. In this case equal sizing applies to minimum sizes of columns or rows (this is the default value). ``wx.FLEX_GROWMODE_ALL`` Sizer equally stretches all columns or rows in the non flexible direction, whether they are growable or not in the flexbile direction ================================== ============================================= | **Parameters:** * `mode` (int) .. note:: Note that this method does not trigger relayout. .. seealso:: `GetNonFlexibleGrowMode <#GetNonFlexibleGrowMode>`_ -------- Properties ^^^^^^^^^^ .. attribute:: ColWidths See `GetColWidths <#GetColWidths>`_ .. attribute:: FlexibleDirection See `GetFlexibleDirection <#GetFlexibleDirection>`_ and `SetFlexibleDirection <#SetFlexibleDirection>`_ .. attribute:: NonFlexibleGrowMode See `GetNonFlexibleGrowMode <#GetNonFlexibleGrowMode>`_ and `SetNonFlexibleGrowMode <#SetNonFlexibleGrowMode>`_ .. attribute:: RowHeights See `GetRowHeights <#GetRowHeights>`_