m_sizePad = GetRenderer()->GetTabPadding();
- SetBestSize(size);
+ SetInitialSize(size);
CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
// wxNotebook page switching
// ----------------------------------------------------------------------------
-int wxNotebook::SetSelection(size_t nPage)
+int wxNotebook::DoSetSelection(size_t nPage, int flags)
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
return m_sel;
}
- // event handling
- wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
- event.SetSelection(nPage);
- event.SetOldSelection(m_sel);
- event.SetEventObject(this);
- if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
+ if ( flags & SetSelection_SendEvent )
{
- // program doesn't allow the page change
- return m_sel;
+ if ( !SendPageChangingEvent(nPage) )
+ {
+ // program doesn't allow the page change
+ return m_sel;
+ }
}
// we need to change m_sel first, before calling RefreshTab() below as
m_pages[m_sel]->Show();
}
- // event handling
- event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
- GetEventHandler()->ProcessEvent(event);
+ if ( flags & SetSelection_SendEvent )
+ {
+ // event handling
+ SendPageChangedEvent(selOld);
+ }
return selOld;
}