]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/bookctrl.cpp
use HandleWindowEvent() in Close() as it can be called from a GTK+ callback (#9565)
[wxWidgets.git] / src / common / bookctrl.cpp
index 7f398c2738e59fe644904f0ffc1d58bda0d7242d..3b822dcaa5fad93b398914dd9b42766db4b5df54 100644 (file)
@@ -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;