wxFlexGridSizer Class Reference
[Window Layout]

#include <wx/sizer.h>

Inheritance diagram for wxFlexGridSizer:

wxGridSizer wxSizer wxObject wxGridBagSizer

List of all members.


Detailed 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 wxGridSizer.

Since wxWidgets 2.5.0, wxFlexGridSizer 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 wxFlexGridSizer::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 wxFlexGridSizer::SetNonFlexibleGrowMode method serves this purpose.

Library:  wxCore

Category:  Window Layout

See also:
wxSizer, Sizer Overview

Public Member Functions

void AddGrowableCol (size_t idx, int proportion=0)
void AddGrowableRow (size_t idx, int proportion=0)
int GetFlexibleDirection () const
int GetNonFlexibleGrowMode () const
bool IsColGrowable (size_t idx)
bool IsRowGrowable (size_t idx)
void RemoveGrowableCol (size_t idx)
void RemoveGrowableRow (size_t idx)
void SetFlexibleDirection (int direction)
void SetNonFlexibleGrowMode (wxFlexSizerGrowMode mode)
 wxFlexGridSizer (int rows, int cols, int vgap, int hgap)
 wxFlexGridSizer (int cols, int vgap=0, int hgap=0)

Constructor & Destructor Documentation

wxFlexGridSizer::wxFlexGridSizer ( int  rows,
int  cols,
int  vgap,
int  hgap 
)

Constructor for a wxGridSizer. 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.

wxFlexGridSizer::wxFlexGridSizer ( int  cols,
int  vgap = 0,
int  hgap = 0 
)

Constructor for a wxGridSizer. 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.


Member Function Documentation

void wxFlexGridSizer::AddGrowableCol ( size_t  idx,
int  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).

Notice that the row 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.

void wxFlexGridSizer::AddGrowableRow ( size_t  idx,
int  proportion = 0 
)

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.

int wxFlexGridSizer::GetFlexibleDirection (  )  const

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

Returns:
One of the following values:
See also:
SetFlexibleDirection()

int wxFlexGridSizer::GetNonFlexibleGrowMode (  )  const

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

Returns:
One of the following values:
See also:
SetFlexibleDirection(), SetNonFlexibleGrowMode()

bool wxFlexGridSizer::IsColGrowable ( size_t  idx  ) 

Returns true if column idx is growable.

Since:
2.9.0

bool wxFlexGridSizer::IsRowGrowable ( size_t  idx  ) 

Returns true if row idx is growable.

Since:
2.9.0

void wxFlexGridSizer::RemoveGrowableCol ( size_t  idx  ) 

Specifies that column idx is no longer growable.

void wxFlexGridSizer::RemoveGrowableRow ( size_t  idx  ) 

Specifies that row idx is no longer growable.

void wxFlexGridSizer::SetFlexibleDirection ( int  direction  ) 

Specifies whether the sizer should flexibly resize its columns, rows, or both. Argument direction can be wxVERTICAL, wxHORIZONTAL or wxBOTH (which is the default value). Any other value is ignored. See GetFlexibleDirection() GetFlexibleDirection for the explanation of these values. Note that this method does not trigger relayout.

void wxFlexGridSizer::SetNonFlexibleGrowMode ( wxFlexSizerGrowMode  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 those documented in GetNonFlexibleGrowMode(), please see there for their explanation. Note that this method does not trigger relayout.



wxWidgets logo

[ top ]