Merge branch 'propagate-inform-first-dir'
Fix some layouts involving wxWrapSizer by correctly propagating InformFirstDirection() call to the nested sizers that need it. See https://github.com/wxWidgets/wxWidgets/pull/988
This commit is contained in:
@@ -43,6 +43,23 @@ public:
|
||||
|
||||
virtual wxString GetLabel() const wxOVERRIDE = 0;
|
||||
virtual void SetLabel(const wxString& label) wxOVERRIDE = 0;
|
||||
|
||||
virtual bool
|
||||
InformFirstDirection(int direction,
|
||||
int size,
|
||||
int availableOtherDir) wxOVERRIDE
|
||||
{
|
||||
wxWindow* const p = GetPane();
|
||||
if ( !p )
|
||||
return false;
|
||||
|
||||
if ( !p->InformFirstDirection(direction, size, availableOtherDir) )
|
||||
return false;
|
||||
|
||||
InvalidateBestSize();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -619,6 +619,10 @@ public:
|
||||
|
||||
// Inform sizer about the first direction that has been decided (by parent item)
|
||||
// Returns true if it made use of the information (and recalculated min size)
|
||||
//
|
||||
// Note that while this method doesn't do anything by default, it should
|
||||
// almost always be overridden in the derived classes and should have been
|
||||
// pure virtual if not for backwards compatibility constraints.
|
||||
virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) )
|
||||
{ return false; }
|
||||
|
||||
@@ -958,6 +962,10 @@ public:
|
||||
virtual wxSize CalcMin() wxOVERRIDE;
|
||||
virtual void RecalcSizes() wxOVERRIDE;
|
||||
|
||||
virtual bool InformFirstDirection(int direction,
|
||||
int size,
|
||||
int availableOtherDir) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
// Only overridden to perform extra debugging checks.
|
||||
virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user