propagate invalidated best size upstream
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -317,7 +317,7 @@ public:
|
||||
|
||||
// reset the cached best size value so it will be recalculated the
|
||||
// next time it is needed.
|
||||
void InvalidateBestSize() { m_bestSizeCache = wxDefaultSize; }
|
||||
void InvalidateBestSize();
|
||||
void CacheBestSize(const wxSize& size) const
|
||||
{ wxConstCast(this, wxWindowBase)->m_bestSizeCache = size; }
|
||||
|
||||
|
@@ -531,6 +531,16 @@ static bool wxHasRealChildren(const wxWindowBase* win)
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxWindowBase::InvalidateBestSize()
|
||||
{
|
||||
m_bestSizeCache = wxDefaultSize;
|
||||
|
||||
// parent's best size calculation may depend on its children's
|
||||
// best sizes, so let's invalidate it as well to be safe:
|
||||
if (m_parent)
|
||||
m_parent->InvalidateBestSize();
|
||||
}
|
||||
|
||||
// return the size best suited for the current window
|
||||
wxSize wxWindowBase::DoGetBestSize() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user