From 7d840762c6201c90052923a1d9734658fc3e65c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 21 Dec 2007 22:50:35 +0000 Subject: [PATCH] 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/branches/WX_2_8_BRANCH@50880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xrc/xh_sizer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xrc/xh_sizer.cpp b/src/xrc/xh_sizer.cpp index d0b26df540..44a6347bce 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" @@ -237,7 +238,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->GetWindowStyle() & (wxMAXIMIZE_BOX | wxRESIZE_BORDER))