Rename wxBoxSizer::m_minSize to avoid clash with the base class

wxSizer already has m_minSize field, use m_calculatedMinSize for the field of
the derived wxBoxSizer class to avoid confusion, just as wxFlexGridSizer
already did.

Also add a new unit test checking that GetMinSize() still works after this
change.
This commit is contained in:
Vadim Zeitlin
2015-10-11 00:35:30 +02:00
parent cfb1e8adbf
commit 154ebfd1d9
4 changed files with 37 additions and 20 deletions

View File

@@ -41,6 +41,7 @@ private:
CPPUNIT_TEST( Size1 );
CPPUNIT_TEST( Size3 );
CPPUNIT_TEST( CalcMin );
CPPUNIT_TEST( SetMinSize );
CPPUNIT_TEST( BestSizeRespectsMaxSize );
CPPUNIT_TEST( RecalcSizesRespectsMaxSize1 );
CPPUNIT_TEST( RecalcSizesRespectsMaxSize2 );
@@ -50,6 +51,7 @@ private:
void Size1();
void Size3();
void CalcMin();
void SetMinSize();
void BestSizeRespectsMaxSize();
void RecalcSizesRespectsMaxSize1();
void RecalcSizesRespectsMaxSize2();
@@ -307,6 +309,21 @@ void BoxSizerTestCase::CalcMin()
}
}
void BoxSizerTestCase::SetMinSize()
{
wxWindow* const child = new wxWindow(m_win, wxID_ANY);
child->SetInitialSize(wxSize(10, -1));
m_sizer->Add(child);
// Setting minimal size explicitly must make GetMinSize() return at least
// this size even if it needs a much smaller one.
m_sizer->SetMinSize(100, 0);
CPPUNIT_ASSERT_EQUAL( 100, m_sizer->GetMinSize().x );
m_sizer->Layout();
CPPUNIT_ASSERT_EQUAL( 100, m_sizer->GetMinSize().x );
}
void BoxSizerTestCase::BestSizeRespectsMaxSize()
{
m_sizer->Clear();