]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSMenu.mm
don't propagate wxChildFocusEvent outside of wxTLWs
[wxWidgets.git] / src / cocoa / NSMenu.mm
index be8e5417355fedf682f7b609ee0a4e718dbeb047..819cc1f136cb21e2d4308bc6d8ccad50bfdebb81 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2002/12/09
 // RCS-ID:      $Id$
 // Copyright:   (c) 2002 David Elliott
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
 #endif // WX_PRECOMP
 
 #include "wx/cocoa/NSMenu.h"
-//#include "wx/cocoa/ObjcPose.h"
 
 #import <Foundation/NSNotification.h>
-#import <AppKit/NSMenu.h>
+#include "wx/cocoa/objc/NSMenu.h"
 
-#if 0 // There is no reason to pose for NSMenu at this time.
 // ============================================================================
-// @class wxPoserNSMenu
+// @class WXNSMenu
 // ============================================================================
-@interface wxPoserNSMenu : NSMenu
-{
-}
 
-@end // wxPoserNSMenu
+@implementation WXNSMenu : NSMenu
 
-WX_IMPLEMENT_POSER(wxPoserNSMenu);
-@implementation wxPoserNSMenu : NSMenu
+- (void)dealloc
+{
+    wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa(self);
+    if(menu)
+        menu->Cocoa_dealloc();
+    [super dealloc];
+}
 
-@end // wxPoserNSMenu
-#endif // 0
+@end // WXNSMenu
 
 // ============================================================================
 // @class wxNSMenuNotificationObserver
@@ -58,35 +57,35 @@ struct objc_object *wxCocoaNSMenu::sm_cocoaObserver = [[wxNSMenuNotificationObse
 - (void)menuDidAddItem: (NSNotification *)notification
 {
     wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
-    wxCHECK_RET(menu,"menuDidAddItem received but no wxMenu exists");
+    wxCHECK_RET(menu,wxT("menuDidAddItem received but no wxMenu exists"));
     menu->CocoaNotification_menuDidAddItem(notification);
 }
 
 - (void)menuDidChangeItem: (NSNotification *)notification
 {
     wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
-    wxCHECK_RET(menu,"menuDidChangeItem received but no wxMenu exists");
+    wxCHECK_RET(menu,wxT("menuDidChangeItem received but no wxMenu exists"));
     menu->CocoaNotification_menuDidChangeItem(notification);
 }
 
 - (void)menuDidRemoveItem: (NSNotification *)notification
 {
     wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
-    wxCHECK_RET(menu,"menuDidRemoveItem received but no wxMenu exists");
+    wxCHECK_RET(menu,wxT("menuDidRemoveItem received but no wxMenu exists"));
     menu->CocoaNotification_menuDidRemoveItem(notification);
 }
 
 - (void)menuDidSendAction: (NSNotification *)notification
 {
     wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
-    wxCHECK_RET(menu,"menuDidSendAction received but no wxMenu exists");
+    wxCHECK_RET(menu,wxT("menuDidSendAction received but no wxMenu exists"));
     menu->CocoaNotification_menuDidSendAction(notification);
 }
 
 - (void)menuWillSendAction: (NSNotification *)notification
 {
     wxCocoaNSMenu *menu = wxCocoaNSMenu::GetFromCocoa([notification object]);
-    wxCHECK_RET(menu,"menuWillSendAction received but no wxMenu exists");
+    wxCHECK_RET(menu,wxT("menuWillSendAction received but no wxMenu exists"));
     menu->CocoaNotification_menuWillSendAction(notification);
 }