From 91452726c26d7c80b0f28b340659b8f22a501ddd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Dec 2011 13:51:25 +0000 Subject: [PATCH] Use best controller size in wxBookCtrl best size calculation. Don't use GetControllerSize() which returns the actual, not the best, size of the controller. Closes #11793. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/bookctrl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index cc2141b793..4a588a4ddb 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -105,8 +105,13 @@ void wxBookCtrlBase::DoInvalidateBestSize() wxSize wxBookCtrlBase::CalcSizeFromPage(const wxSize& sizePage) const { - // we need to add the size of the choice control and the border between - const wxSize sizeController = GetControllerSize(); + // We need to add the size of the controller and the border between if it's + // shown. Notice that we don't use GetControllerSize() here as it returns + // the actual size while we want the best size here. + if ( !m_bookctrl || !m_bookctrl->IsShown() ) + return sizePage; + + const wxSize sizeController = m_bookctrl->GetBestSize(); wxSize size = sizePage; if ( IsVertical() ) -- 2.50.0