X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ddb4d13585d5235556119fb1937273da9e433a3..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/common/nbkbase.cpp diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index 47011be703..ec391bb57f 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -59,4 +59,26 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const return sizeTotal; } +// ---------------------------------------------------------------------------- +// events +// ---------------------------------------------------------------------------- + +bool wxNotebookBase::SendPageChangingEvent(int nPage) +{ + wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId()); + event.SetSelection(nPage); + event.SetOldSelection(GetSelection()); + event.SetEventObject(this); + return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); +} + +void wxNotebookBase::SendPageChangedEvent(int nPageOld, int nPageNew) +{ + wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId()); + event.SetSelection(nPageNew == -1 ? GetSelection() : nPageNew); + event.SetOldSelection(nPageOld); + event.SetEventObject(this); + GetEventHandler()->ProcessEvent(event); +} + #endif // wxUSE_NOTEBOOK