easy to mistake for wxGridSizer(int rows, int cols) overload was removed, you
will need to specify both vertical and horizontal gap if you want to use this
overload or specify both rows and columns and the gap otherwise. Use of the
- new constructors taking wxSize for the gap argument is preferred.
+ new constructors taking wxSize for the gap argument is preferred. The same
+ applies to wxFlexGridSizer as well.
Changes in behaviour which may result in compilation errors
wxGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
// ctors specifying the number of rows and columns
- wxGridSizer( int rows, int cols, const wxSize& gap );
wxGridSizer( int rows, int cols, int vgap, int hgap );
+ wxGridSizer( int rows, int cols, const wxSize& gap );
virtual wxSizerItem *Insert(size_t index, wxSizerItem *item);
class WXDLLIMPEXP_CORE wxFlexGridSizer: public wxGridSizer
{
public:
- // ctors/dtor
+ // ctors specifying the number of columns only: number of rows will be
+ // deduced automatically depending on the number of sizer elements
+ wxFlexGridSizer( int cols, int vgap, int hgap );
+ wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
+
+ // ctors specifying the number of rows and columns
wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
- wxFlexGridSizer( int cols, int vgap = 0, int hgap = 0 );
- virtual ~wxFlexGridSizer();
+ wxFlexGridSizer( int rows, int cols, const wxSize& gap );
+ // dtor
+ virtual ~wxFlexGridSizer();
// set the rows/columns which will grow (the others will remain of the
// constant initial size)
public:
//@{
/**
- Constructor for a wxFlexGridSizer.
+ wxFlexGridSizer constructors.
- @a rows and @a 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.
+ Usually only the number of columns in the flex grid sizer needs to be
+ specified using @a cols argument. The number of rows will be deduced
+ automatically depending on the number of the elements added to the
+ sizer. If the number of @a rows is explicitly specified (and not zero),
+ the sizer will check that it no more than @code cols*rows @endcode
+ elements are added to it.
- @a vgap and @a hgap define extra space between all children.
+ The @a gap (or @a vgap and @a hgap, which correspond to the height and
+ width of the wxSize object) argument defines the size of the padding
+ between the rows (its vertical component, or @a vgap) and columns
+ (its horizontal component, or @a hgap), in pixels.
+
+ @since 2.9.1 (except for the four argument overload)
*/
- wxFlexGridSizer(int rows, int cols, int vgap, int hgap);
- wxFlexGridSizer(int cols, int vgap = 0, int hgap = 0);
+ wxFlexGridSizer( int cols, int vgap, int hgap );
+ wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
+
+ wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
+ wxFlexGridSizer( int rows, int cols, const wxSize& gap );
//@}
/**
// wxGridSizer
//---------------------------------------------------------------------------
-wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
- : m_rows( rows || cols ? rows : 1 ),
+wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
+ : m_rows( cols == 0 ? 1 : 0 ),
m_cols( cols ),
m_vgap( vgap ),
m_hgap( hgap )
{
}
-wxGridSizer::wxGridSizer( int rows, int cols, const wxSize& gap )
- : m_rows( rows || cols ? rows : 1 ),
+wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
+ : m_rows( cols == 0 ? 1 : 0 ),
m_cols( cols ),
m_vgap( gap.GetHeight() ),
m_hgap( gap.GetWidth() )
{
}
-wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
- : m_rows( cols == 0 ? 1 : 0 ),
+wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
+ : m_rows( rows || cols ? rows : 1 ),
m_cols( cols ),
m_vgap( vgap ),
m_hgap( hgap )
{
}
-wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
- : m_rows( cols == 0 ? 1 : 0 ),
+wxGridSizer::wxGridSizer( int rows, int cols, const wxSize& gap )
+ : m_rows( rows || cols ? rows : 1 ),
m_cols( cols ),
m_vgap( gap.GetHeight() ),
m_hgap( gap.GetWidth() )
// wxFlexGridSizer
//---------------------------------------------------------------------------
+wxFlexGridSizer::wxFlexGridSizer( int cols, int vgap, int hgap )
+ : wxGridSizer( cols, vgap, hgap ),
+ m_flexDirection(wxBOTH),
+ m_growMode(wxFLEX_GROWMODE_SPECIFIED)
+{
+}
+
+wxFlexGridSizer::wxFlexGridSizer( int cols, const wxSize& gap )
+ : wxGridSizer( cols, gap ),
+ m_flexDirection(wxBOTH),
+ m_growMode(wxFLEX_GROWMODE_SPECIFIED)
+{
+}
+
wxFlexGridSizer::wxFlexGridSizer( int rows, int cols, int vgap, int hgap )
: wxGridSizer( rows, cols, vgap, hgap ),
m_flexDirection(wxBOTH),
{
}
-wxFlexGridSizer::wxFlexGridSizer( int cols, int vgap, int hgap )
- : wxGridSizer( cols, vgap, hgap ),
+wxFlexGridSizer::wxFlexGridSizer( int rows, int cols, const wxSize& gap )
+ : wxGridSizer( rows, cols, gap ),
m_flexDirection(wxBOTH),
m_growMode(wxFLEX_GROWMODE_SPECIFIED)
{