]> git.saurik.com Git - wxWidgets.git/commitdiff
added GetWindowSizeForVirtualSize() virtual hook for wxScrolledWindow (cuts down...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 Oct 2005 18:15:34 +0000 (18:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 Oct 2005 18:15:34 +0000 (18:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 0e22dfefad03d43bf4bc22a9b57693231cb336f0..7f516e51e4c34efa52c69936ff2caaf920d0bd2d 100644 (file)
@@ -1279,6 +1279,14 @@ protected:
     // same size as it would have after a call to Fit()
     virtual wxSize DoGetBestSize() const;
 
+    // called from DoGetBestSize() to convert best virtual size (returned by
+    // the window sizer) to the best size for the window itself; this is
+    // overridden at wxScrolledWindow level to clump down virtual size to real
+    virtual wxSize GetWindowSizeForVirtualSize(const wxSize& size) const
+    {
+        return size;
+    }
+
     // this is the virtual function to be overriden in any derived class which
     // wants to change how SetSize() or Move() works - it is called by all
     // versions of these functions in the base class
index 3f659ed9ac383b4a4cbc812d637bbd289ed55272..5e7143c74a9a7600aff72191fbee1671a89b7ebe 100644 (file)
@@ -579,7 +579,7 @@ wxSize wxWindowBase::DoGetBestSize() const
 
     if ( m_windowSizer )
     {
-        best = m_windowSizer->GetMinSize();
+        best = GetWindowSizeForVirtualSize(m_windowSizer->GetMinSize());
     }
 #if wxUSE_CONSTRAINTS
     else if ( m_constraints )