diff --git a/include/wx/window.h b/include/wx/window.h index 0e22dfefad..7f516e51e4 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -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 diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 3f659ed9ac..5e7143c74a 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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 )