X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/448ca22809ae775faae8c1366561d8add20536c5..b132a83bffa4f9855fb02c7c82d48cee33a69b1a:/src/common/bookctrl.cpp?ds=sidebyside diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index c635c2cbf8..5392388681 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -53,6 +53,7 @@ END_EVENT_TABLE() void wxBookCtrlBase::Init() { + m_selection = wxNOT_FOUND; m_bookctrl = NULL; m_imageList = NULL; m_ownsImageList = false; @@ -470,6 +471,19 @@ int wxBookCtrlBase::GetNextPage(bool forward) const return nPage; } +bool wxBookCtrlBase::DoSetSelectionAfterInsertion(size_t n, bool bSelect) +{ + if ( bSelect ) + SetSelection(n); + else if ( m_selection == wxNOT_FOUND ) + ChangeSelection(0); + else // We're not going to select this page. + return false; + + // Return true to indicate that we selected this page. + return true; +} + int wxBookCtrlBase::DoSetSelection(size_t n, int flags) { wxCHECK_MSG( n < GetPageCount(), wxNOT_FOUND,