Package wx :: Class GridSizer
[frames | no frames]

Type GridSizer

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

Known Subclasses:
FlexGridSizer

A grid sizer is a sizer which lays out its children in a two-dimensional table with all cells having the same size. In other words, the width of each cell within the grid is the width of the widest item added to the sizer and the height of each grid cell is the height of the tallest item. An optional vertical and/or horizontal gap between items can also be specified (in pixels.)

Items are placed in the cells of the grid in the order they are added, in row-major order. In other words, the first row is filled first, then the second, and so on until all items have been added. (If neccessary, additional rows will be added as items are added.) If you need to have greater control over the cells that items are placed in then use the wx.GridBagSizer.


Method Summary
GridSizer __init__(self, rows, cols, vgap, hgap)
Constructor for a wx.GridSizer.
(rows, cols) CalcRowsCols()
Calculates how many rows and columns will be in the sizer based on the current number of items and also the rows, cols specified in the constructor.
int GetCols(self)
Returns the number of columns in the sizer.
int GetHGap(self)
Returns the horizontal gap (in pixels) between cells in the sizer.
int GetRows(self)
Returns the number of rows in the sizer.
int GetVGap(self)
Returns the vertical gap (in pixels) between the cells in the sizer.
  SetCols(self, cols)
Sets the number of columns in the sizer.
  SetHGap(self, gap)
Sets the horizontal gap (in pixels) between cells in the sizer
  SetRows(self, rows)
Sets the number of rows in the sizer.
  SetVGap(self, gap)
Sets the vertical gap (in pixels) between the cells in the sizer.

Property Summary
  Cols: See GetCols and SetCols
  HGap: See GetHGap and SetHGap
  Rows: See GetRows and SetRows
  thisown: The membership flag
  VGap: See GetVGap and SetVGap

Method Details

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

Constructor for a wx.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 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:
GridSizer
Overrides:
wx.Sizer.__init__

CalcRowsCols()

Calculates how many rows and columns will be in the sizer based on the current number of items and also the rows, cols specified in the constructor.

Returns:
(rows, cols)

GetCols(self)

Returns the number of columns in the sizer.

Returns:
int

GetHGap(self)

Returns the horizontal gap (in pixels) between cells in the sizer.

Returns:
int

GetRows(self)

Returns the number of rows in the sizer.

Returns:
int

GetVGap(self)

Returns the vertical gap (in pixels) between the cells in the sizer.

Returns:
int

SetCols(self, cols)

Sets the number of columns in the sizer.

Parameters:
cols
           (type=int)

SetHGap(self, gap)

Sets the horizontal gap (in pixels) between cells in the sizer

Parameters:
gap
           (type=int)

SetRows(self, rows)

Sets the number of rows in the sizer.

Parameters:
rows
           (type=int)

SetVGap(self, gap)

Sets the vertical gap (in pixels) between the cells in the sizer.

Parameters:
gap
           (type=int)


Property Details

Cols

See GetCols and SetCols

Get Method:
GetCols(self)
Set Method:
SetCols(self, cols)

HGap

See GetHGap and SetHGap

Get Method:
GetHGap(self)
Set Method:
SetHGap(self, gap)

Rows

See GetRows and SetRows

Get Method:
GetRows(self)
Set Method:
SetRows(self, rows)

thisown

The membership flag

VGap

See GetVGap and SetVGap

Get Method:
GetVGap(self)
Set Method:
SetVGap(self, gap)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:10:02 2007 http://epydoc.sf.net