From: Václav Slavík Date: Fri, 21 Dec 2007 22:49:58 +0000 (+0000) Subject: fixed XRC handler for sizers to do the expected thing when putting controls into... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5e1a9f05c7b4c442bcdf967571a56ec9c90f2ad0 fixed XRC handler for sizers to do the expected thing when putting controls into wxScrolledWindow: let them determine virtual size, not real size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index 8e5e9793c4..4b5f0b03aa 100644 --- a/src/xrc/xh_sizer.cpp +++ b/src/xrc/xh_sizer.cpp @@ -27,6 +27,7 @@ #include "wx/frame.h" #include "wx/dialog.h" #include "wx/button.h" + #include "wx/scrolwin.h" #endif #include "wx/gbsizer.h" @@ -236,7 +237,16 @@ wxObject* wxSizerXmlHandler::Handle_sizer() wxXmlNode *nd = m_node; m_node = parentNode; if (GetSize() == wxDefaultSize) - sizer->Fit(m_parentAsWindow); + { + if ( wxDynamicCast(m_parentAsWindow, wxScrolledWindow) != NULL ) + { + sizer->FitInside(m_parentAsWindow); + } + else + { + sizer->Fit(m_parentAsWindow); + } + } m_node = nd; if (m_parentAsWindow->IsTopLevel())