Make wxGridSizer ctors more consistent.

The old and confusing wxGridSizer(int cols, int vgap = 0, int hgap = 0) is removed and replaced with wxGridSizer(int cols, int vgap, int hgap).

New ctor overloads using wxSize for the gap parameter added.

Closes #11040.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-08-02 00:48:58 +00:00
parent 4f671eebc9
commit 7e6edd2772
4 changed files with 55 additions and 16 deletions

View File

@@ -1318,18 +1318,34 @@ bool wxSizer::IsShown( size_t index ) const
//---------------------------------------------------------------------------
wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
: m_rows( ( cols == 0 && rows == 0 ) ? 1 : rows )
, m_cols( cols )
, m_vgap( vgap )
, m_hgap( hgap )
: m_rows( rows || cols ? rows : 1 ),
m_cols( cols ),
m_vgap( vgap ),
m_hgap( hgap )
{
}
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() )
{
}
wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
: m_rows( cols == 0 ? 1 : 0 )
, m_cols( cols )
, m_vgap( vgap )
, m_hgap( hgap )
: m_rows( cols == 0 ? 1 : 0 ),
m_cols( cols ),
m_vgap( vgap ),
m_hgap( hgap )
{
}
wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
: m_rows( cols == 0 ? 1 : 0 ),
m_cols( cols ),
m_vgap( gap.GetHeight() ),
m_hgap( gap.GetWidth() )
{
}