]> git.saurik.com Git - wxWidgets.git/commitdiff
propagate invalidated best size upstream
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 8 Oct 2004 21:52:52 +0000 (21:52 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 8 Oct 2004 21:52:52 +0000 (21:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/window.h
src/common/wincmn.cpp

index 1b88bc156cba9cdef9189c41290d76bd5add4443..7a20ca16150c901bc793a3806a96ee3bb546a15c 100644 (file)
@@ -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; }
 
index 784b618111ec0b2dc3f3cf165306d8cec6b76fc6..c15d4f4da929cf678e51a1a6442db9973087b990 100644 (file)
@@ -530,6 +530,16 @@ static bool wxHasRealChildren(const wxWindowBase* win)
     return (realChildCount > 0);
 }
 #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