Replace wxSizer::RecalcSizes() with RepositionChildren()

The new method takes minimal size just computed by RecalcSizes() as its
argument making it unnecessary to store it as a member variable in the derived
classes such as wx{Box,FlexGrid}Sizer.

The old method can still be overridden for compatibility and by the derived
class that don't need minimal size when updating children.
This commit is contained in:
Vadim Zeitlin
2015-10-11 01:13:33 +02:00
parent 7d9675472d
commit 622deec262
7 changed files with 84 additions and 72 deletions

View File

@@ -92,8 +92,8 @@ void wxWrapSizer::ClearRows()
{
// all elements of the row sizers are also elements of this one (we
// directly add pointers to elements of our own m_children list to the row
// sizers in RecalcSizes()), so we need to detach them from the row sizer
// to avoid double deletion
// sizers in RepositionChildren()), so we need to detach them from the row
// sizer to avoid double deletion
wxSizerItemList& rows = m_rows.GetChildren();
for ( wxSizerItemList::iterator i = rows.begin(),
end = rows.end();
@@ -485,7 +485,7 @@ void wxWrapSizer::FinishRow(size_t n,
AdjustLastRowItemProp(n, itemLast);
}
void wxWrapSizer::RecalcSizes()
void wxWrapSizer::RepositionChildren(const wxSize& WXUNUSED(minSize))
{
// First restore any proportions we may have changed and remove the old rows
ClearRows();