diff --git a/include/wx/window.h b/include/wx/window.h index 9ae3e47848..06d52fc835 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -374,12 +374,8 @@ public: // get the size best suited for the window (in fact, minimal // acceptable size using which it will still look "nice" in // most situations) - wxSize GetBestSize() const - { - if (m_bestSizeCache.IsFullySpecified()) - return m_bestSizeCache; - return DoGetBestSize(); - } + wxSize GetBestSize() const; + void GetBestSize(int *w, int *h) const { wxSize s = GetBestSize(); diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 5bb116f600..96e14509b3 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -47,6 +47,8 @@ #include "wx/menu.h" #endif //WX_PRECOMP +#include "wx/collpane.h" + #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" #endif // wxUSE_DRAG_AND_DROP @@ -720,6 +722,13 @@ wxSize wxWindowBase::GetEffectiveMinSize() const return min; } +wxSize wxWindowBase::GetBestSize() const +{ + if ((!m_windowSizer) && (m_bestSizeCache.IsFullySpecified())) + return m_bestSizeCache; + + return DoGetBestSize(); +} void wxWindowBase::SetMinSize(const wxSize& minSize) {