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:
@@ -2179,7 +2179,7 @@ void wxBoxSizer::RecalcSizes()
|
||||
|
||||
// the amount of free space which we should redistribute among the
|
||||
// stretchable items (i.e. those with non zero proportion)
|
||||
int delta = totalMajorSize - GetSizeInMajorDir(m_minSize);
|
||||
int delta = totalMajorSize - GetSizeInMajorDir(m_calculatedMinSize);
|
||||
|
||||
// declare loop variables used below:
|
||||
wxSizerItemList::const_iterator i; // iterator in m_children list
|
||||
@@ -2498,7 +2498,7 @@ void wxBoxSizer::RecalcSizes()
|
||||
wxSize wxBoxSizer::CalcMin()
|
||||
{
|
||||
m_totalProportion = 0;
|
||||
m_minSize = wxSize(0, 0);
|
||||
m_calculatedMinSize = wxSize(0, 0);
|
||||
|
||||
// The minimal size for the sizer should be big enough to allocate its
|
||||
// element at least its minimal size but also, and this is the non trivial
|
||||
@@ -2529,19 +2529,19 @@ wxSize wxBoxSizer::CalcMin()
|
||||
else // fixed size item
|
||||
{
|
||||
// Just account for its size directly
|
||||
SizeInMajorDir(m_minSize) += GetSizeInMajorDir(sizeMinThis);
|
||||
SizeInMajorDir(m_calculatedMinSize) += GetSizeInMajorDir(sizeMinThis);
|
||||
}
|
||||
|
||||
// In the transversal direction we just need to find the maximum.
|
||||
if ( GetSizeInMinorDir(sizeMinThis) > GetSizeInMinorDir(m_minSize) )
|
||||
SizeInMinorDir(m_minSize) = GetSizeInMinorDir(sizeMinThis);
|
||||
if ( GetSizeInMinorDir(sizeMinThis) > GetSizeInMinorDir(m_calculatedMinSize) )
|
||||
SizeInMinorDir(m_calculatedMinSize) = GetSizeInMinorDir(sizeMinThis);
|
||||
}
|
||||
|
||||
// Using the max ratio ensures that the min size is big enough for all
|
||||
// items to have their min size and satisfy the proportions among them.
|
||||
SizeInMajorDir(m_minSize) += (int)(maxMinSizeToProp*m_totalProportion);
|
||||
SizeInMajorDir(m_calculatedMinSize) += (int)(maxMinSizeToProp*m_totalProportion);
|
||||
|
||||
return m_minSize;
|
||||
return m_calculatedMinSize;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user