From 37f784703e66c24bdc698a6de6496c775164c5ab Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 27 May 2008 14:15:14 +0000 Subject: [PATCH] guard against layout changes during DoSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/bookctrl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 32a6ffebe2..ad7ed55739 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -229,6 +229,13 @@ void wxBookCtrlBase::DoSize() sizeCtrl( GetControllerSize() ); m_bookctrl->SetClientSize( sizeCtrl.x - sizeBorder.x, sizeCtrl.y - sizeBorder.y ); + // if this changes the visibility of the scrollbars the best size changes, relayout in this case + wxSize sizeCtrl2 = GetControllerSize(); + if ( sizeCtrl != sizeCtrl2 ) + { + wxSize sizeBorder2 = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(); + m_bookctrl->SetClientSize( sizeCtrl2.x - sizeBorder2.x, sizeCtrl2.y - sizeBorder2.y ); + } const wxSize sizeNew = m_bookctrl->GetSize(); wxPoint posCtrl;