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

@@ -725,11 +725,16 @@ public:
wxSizerItem* PrependStretchSpacer(int prop = 1);
/**
This method is abstract and has to be overwritten by any derived class.
Here, the sizer will do the actual calculation of its children's
positions and sizes.
Method which must be overridden in the derived sizer classes.
The implementation should reposition the children using the current
total size available to the sizer (@c m_size) and the size computed by
the last call to CalcMin().
@since 3.1.3, before this version RecalcSizes() method not taking any
arguments had to be overridden in the derived classes instead.
*/
virtual void RecalcSizes() = 0;
virtual void RepositionChildren(const wxSize& minSize) = 0;
/**
Removes a child window from the sizer, but does @b not destroy it