From 7dd8b1ea102a9c25be25ef6ef33630afed1dbc7c Mon Sep 17 00:00:00 2001 From: David Elliott Date: Fri, 27 Feb 2004 06:07:47 +0000 Subject: [PATCH] Make wxMenuItemAction: and validateMenuItem: delegate messages take an NSWindow* parameter instead of an id. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/NSWindow.h | 5 +++-- include/wx/cocoa/toplevel.h | 4 ++-- src/cocoa/NSWindow.mm | 8 ++++---- src/cocoa/toplevel.mm | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/wx/cocoa/NSWindow.h b/include/wx/cocoa/NSWindow.h index 0b2491e70c..761b28ee08 100644 --- a/include/wx/cocoa/NSWindow.h +++ b/include/wx/cocoa/NSWindow.h @@ -19,6 +19,7 @@ WX_DECLARE_OBJC_HASHMAP(NSWindow); class WXDLLEXPORT wxMenuBar; +DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); DECLARE_WXCOCOA_OBJC_CLASS(wxNSWindowDelegate); class wxCocoaNSWindow @@ -36,8 +37,8 @@ public: virtual void CocoaDelegate_windowDidResignKey(void) { } virtual void CocoaDelegate_windowDidBecomeMain(void) { } virtual void CocoaDelegate_windowDidResignMain(void) { } - virtual void CocoaDelegate_wxMenuItemAction(struct objc_object *sender) = 0; - virtual bool CocoaDelegate_validateMenuItem(struct objc_object *sender) = 0; + virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem) = 0; + virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem) = 0; virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win); protected: wxCocoaNSWindow(); diff --git a/include/wx/cocoa/toplevel.h b/include/wx/cocoa/toplevel.h index 7cc666b111..821d77d462 100644 --- a/include/wx/cocoa/toplevel.h +++ b/include/wx/cocoa/toplevel.h @@ -67,8 +67,8 @@ public: virtual void CocoaDelegate_windowDidResignKey(void); virtual void CocoaDelegate_windowDidBecomeMain(void); virtual void CocoaDelegate_windowDidResignMain(void); - virtual void CocoaDelegate_wxMenuItemAction(struct objc_object *sender); - virtual bool CocoaDelegate_validateMenuItem(struct objc_object *sender); + virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem sender); + virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem sender); virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win); static void DeactivatePendingWindow(); protected: diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index bde3aa64ce..1f8663740c 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -51,8 +51,8 @@ - (void)windowWillClose: (NSNotification *)notification; // Menu item handlers -- (void)wxMenuItemAction: (id)sender; -- (BOOL)validateMenuItem: (id)menuItem; +- (void)wxMenuItemAction: (NSMenuItem *)menuItem; +- (BOOL)validateMenuItem: (NSMenuItem *)menuItem; @end //interface wxNSWindowDelegate @implementation wxNSWindowDelegate : NSObject @@ -129,13 +129,13 @@ } // Menu item handlers -- (void)wxMenuItemAction: (id)sender +- (void)wxMenuItemAction: (NSMenuItem *)sender { wxASSERT(m_wxCocoaInterface); m_wxCocoaInterface->CocoaDelegate_wxMenuItemAction(sender); } -- (BOOL)validateMenuItem: (id)sender +- (BOOL)validateMenuItem: (NSMenuItem *)sender { wxASSERT(m_wxCocoaInterface); return m_wxCocoaInterface->CocoaDelegate_validateMenuItem(sender); diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index 9f4518bbfb..d87628547c 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -232,11 +232,11 @@ bool wxTopLevelWindowCocoa::CocoaDelegate_windowShouldClose() return wxWindowBase::Close(false); } -void wxTopLevelWindowCocoa::CocoaDelegate_wxMenuItemAction(struct objc_object *sender) +void wxTopLevelWindowCocoa::CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem) { } -bool wxTopLevelWindowCocoa::CocoaDelegate_validateMenuItem(struct objc_object *sender) +bool wxTopLevelWindowCocoa::CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem) { return false; } -- 2.45.2