]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't reserve space for hidden controller in wxBookCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Oct 2010 22:39:55 +0000 (22:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Oct 2010 22:39:55 +0000 (22:39 +0000)
Even when the controller was hidden, space was still allocated for it by
wxBookCtrl. Fix this by only reserving extra space when the controller is
shown.

Closes #12609.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/bookctrl.cpp

index cfc13b78a3e537c3c80629e50cfc39037a6da1eb..c635c2cbf86e6c3a2b08245c26b0f53a7b454e5c 100644 (file)
@@ -311,7 +311,10 @@ void wxBookCtrlBase::OnSize(wxSizeEvent& event)
 
 wxSize wxBookCtrlBase::GetControllerSize() const
 {
-    if ( !m_bookctrl )
+    // For at least some book controls (e.g. wxChoicebook) it may make sense to
+    // (temporarily?) hide the controller and we shouldn't leave extra space
+    // for the hidden control in this case.
+    if ( !m_bookctrl || !m_bookctrl->IsShown() )
         return wxSize(0, 0);
 
     const wxSize sizeClient = GetClientSize(),