X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937013e0fd914d4c42f9f5ec98da665986b93dfa..76e7cfab8fdb0c7862fd07e427af54181717fc62:/src/cocoa/notebook.mm diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index 10e04d98e7..c766bc4099 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -1,12 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/notebook.mm +// Name: src/cocoa/notebook.mm // Purpose: wxNotebook // Author: David Elliott // Modified by: // Created: 2004/04/08 -// RCS-ID: $Id$ // Copyright: (c) 2004 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -124,17 +123,10 @@ WX_DECLARE_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem) @end // implementation WXCTabViewImageItem : NSTabViewItem WX_IMPLEMENT_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem) -// ======================================================================== -// wxNotebookEvent -// ======================================================================== -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent) - // ======================================================================== // wxNotebook // ======================================================================== -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) + BEGIN_EVENT_TABLE(wxNotebook, wxNotebookBase) END_EVENT_TABLE() WX_IMPLEMENT_COCOA_OWNER(wxNotebook,NSTabView,NSView,NSView) @@ -308,21 +300,22 @@ int wxNotebook::GetSelection() const { NSTabViewItem *selectedItem = [GetNSTabView() selectedTabViewItem]; if(!selectedItem) - return -1; + return wxNOT_FOUND; return [GetNSTabView() indexOfTabViewItem:selectedItem]; } void wxNotebook::CocoaDelegate_tabView_didSelectTabViewItem(WX_NSTabViewItem tabViewItem) { // FIXME: oldSel probably == newSel - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(), + wxBookCtrlEvent event(wxEVT_NOTEBOOK_PAGE_CHANGED, GetId(), [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection()); event.SetEventObject(this); + GetEventHandler()->ProcessEvent(event); } bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem tabViewItem) { - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(), + wxBookCtrlEvent event(wxEVT_NOTEBOOK_PAGE_CHANGING, GetId(), [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection()); event.SetEventObject(this); return !HandleWindowEvent(event) || event.IsAllowed();