X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d6fcbcc7088e9c104b3dc5b4704a07f728d55ae..e69d5138dc8f95e294ae6d03beb4f321406f4e34:/src/univ/notebook.cpp diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 7a72aaf22e..ebe2c8bb58 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -233,7 +233,7 @@ wxNotebook::~wxNotebook() // wxNotebook page switching // ---------------------------------------------------------------------------- -int wxNotebook::DoSetSelection(size_t nPage, int flags = 0) +int wxNotebook::DoSetSelection(size_t nPage, int flags) { wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") ); @@ -243,14 +243,9 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags = 0) return m_sel; } - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId); - if (flags & SetSelection_SendEvent) + if ( flags & SetSelection_SendEvent ) { - // event handling - event.SetSelection(nPage); - event.SetOldSelection(m_sel); - event.SetEventObject(this); - if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() ) + if ( !SendPageChangingEvent(nPage) ) { // program doesn't allow the page change return m_sel; @@ -300,11 +295,10 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags = 0) m_pages[m_sel]->Show(); } - if (flags & SetSelection_SendEvent) + if ( flags & SetSelection_SendEvent ) { // event handling - event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED); - GetEventHandler()->ProcessEvent(event); + SendPageChangedEvent(selOld); } return selOld;