X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4a980f4f57a4e7eea00c55cbb3d139f97d90c20..beb2638a997914bd12c55e81589adebd90af9ed2:/src/common/bookctrl.cpp?ds=inline diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 7f398c2738..d45ff84f7d 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; @@ -448,7 +455,7 @@ int wxBookCtrlBase::DoSetSelection(size_t n, int flags) if ( n != (size_t)oldSel ) { - wxBookCtrlBaseEvent *event = CreatePageChangingEvent(); + wxBookCtrlEvent *event = CreatePageChangingEvent(); bool allowed = false; if ( flags & SetSelection_SendEvent ) @@ -486,5 +493,6 @@ int wxBookCtrlBase::DoSetSelection(size_t n, int flags) return oldSel; } +IMPLEMENT_DYNAMIC_CLASS(wxBookCtrlEvent, wxNotifyEvent) #endif // wxUSE_BOOKCTRL