X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/common/nbkbase.cpp diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index 6beaa057ec..ec391bb57f 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "notebookbase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -49,7 +45,7 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const // default because not all ports implement this wxSize sizeTotal = sizePage; - if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) ) + if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) ) { sizeTotal.x += 90; sizeTotal.y += 10; @@ -63,5 +59,26 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const return sizeTotal; } -#endif // wxUSE_NOTEBOOK +// ---------------------------------------------------------------------------- +// 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