From: Stefan Csomor Date: Wed, 11 Jun 2008 04:14:40 +0000 (+0000) Subject: forward port of fix X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ecac22d09ac08cec393b22464b24ae04feb98f6f forward port of fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 7f398c2738..3b822dcaa5 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;