Package wx :: Class FlexGridSizer

[frames | no frames]

## Type FlexGridSizer

    object --+
             |
        Object --+
                 |
             Sizer --+
                     |
             GridSizer --+
                         |
                        FlexGridSizer

Known Subclasses:
  `GridBagSizer`

A flex grid sizer is a sizer which lays out its children in a two-dimensional table with all table cells in one row having the same height and all cells 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`.

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`), 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` method serves this purpose.

Method Summary
FlexGridSizer | ``__init__`(self, rows, cols, vgap, hgap)` Constructor for a wx.FlexGridSizer.
| ``AddGrowableCol`(self, idx, proportion)` Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer.
| ``AddGrowableRow`(self, idx, proportion)` Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.
list | ``GetColWidths`(self)` Returns a list of integers representing the widths of each of the columns in the sizer.
int | ``GetFlexibleDirection`(self)` Returns a value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).
int | ``GetNonFlexibleGrowMode`(self)` Returns the value that specifies how the sizer grows in the non-flexible direction if there is one.
list | ``GetRowHeights`(self)` Returns a list of integers representing the heights of each of the rows in the sizer.
| ``RemoveGrowableCol`(self, idx)` Specifies that column idx is no longer growable.
| ``RemoveGrowableRow`(self, idx)` Specifies that row idx is no longer growable.
| ``SetFlexibleDirection`(self, direction)` Specifies whether the sizer should flexibly resize its columns, rows, or both.
| ``SetNonFlexibleGrowMode`(self, mode)` Specifies how the sizer should grow in the non-flexible direction if there is one (so `SetFlexibleDirection` must have been called previously).

Property Summary
| `ColWidths`: See `GetColWidths`
| `FlexibleDirection`: See `GetFlexibleDirection` and `SetFlexibleDirection`
| `NonFlexibleGrowMode`: See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`
| `RowHeights`: See `GetRowHeights`
| `thisown`: The membership flag

Method Details

### __init__(self, rows=1, cols=0, vgap=0, hgap=0)
(Constructor)

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`
    (type=int)

    `cols`
    (type=int)

    `vgap`
    (type=int)

    `hgap`
    (type=int)

  Returns:
    FlexGridSizer
  Overrides:
    `wx.GridSizer.__init__`

### AddGrowableCol(self, 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 box sizers except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all).

  Parameters:
    `idx`
    (type=size_t)

    `proportion`
    (type=int)

### AddGrowableRow(self, idx, proportion=0)

Specifies that row 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 box sizers except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all).

  Parameters:
    `idx`
    (type=size_t)

    `proportion`
    (type=int)

### GetColWidths(self)

Returns a list of integers representing the widths of each of the columns in the sizer.

  Returns:
    list

### GetFlexibleDirection(self)

Returns a value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).

  Returns:
    int

  See Also:

  `SetFlexibleDirection`

### GetNonFlexibleGrowMode(self)

Returns the value that specifies how the sizer grows in the non-flexible direction if there is one.

  Returns:
    int

  See Also:

  `SetNonFlexibleGrowMode`

### GetRowHeights(self)

Returns a list of integers representing the heights of each of the rows in the sizer.

  Returns:
    list

### RemoveGrowableCol(self, idx)

Specifies that column idx is no longer growable.

  Parameters:
    `idx`
    (type=size_t)

### RemoveGrowableRow(self, idx)

Specifies that row idx is no longer growable.

  Parameters:
    `idx`
    (type=size_t)

### SetFlexibleDirection(self, direction)

Specifies whether the sizer should flexibly resize its columns, rows, or both. Argument direction can be one of the following values. Any other value is ignored.

> wx.VERTICAL | Rows are flexibly sized.
> wx.HORIZONTAL | Columns are flexibly sized.
> wx.BOTH | Both rows and columns are flexibly sized (this is the default value).

Note that this method does not trigger relayout.

  Parameters:
    `direction`
    (type=int)

### SetNonFlexibleGrowMode(self, mode)

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 the following values:

> 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` and `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.

Note that this method does not trigger relayout.

  Parameters:
    `mode`
    (type=int)

Property Details

### ColWidths

See `GetColWidths`

  Get Method:
    `GetColWidths`(self)

### FlexibleDirection

See `GetFlexibleDirection` and `SetFlexibleDirection`

  Get Method:
    `GetFlexibleDirection`(self)
  Set Method:
    `SetFlexibleDirection`(self, direction)

### NonFlexibleGrowMode

See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`

  Get Method:
    `GetNonFlexibleGrowMode`(self)
  Set Method:
    `SetNonFlexibleGrowMode`(self, mode)

### RowHeights

See `GetRowHeights`

  Get Method:
    `GetRowHeights`(self)

### thisown

The membership flag

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:11:50 2007 | http://epydoc.sf.net