X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76fa43ec36e1dd759572d1d0175c5f6ab2d4851f..0286d08d1453506f9ff9a830d58b3b35817d0b14:/src/univ/notebook.cpp?ds=sidebyside diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 7ec0981b86..392f13c4aa 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -153,7 +153,7 @@ bool wxNotebook::Create(wxWindow *parent, m_sizePad = GetRenderer()->GetTabPadding(); - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_NOTEBOOK); @@ -243,14 +243,9 @@ int wxNotebook::DoSetSelection(size_t nPage, int flags) 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) 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;