]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/cocoa/NSMenu.h
Make wxJoystick::GetNumberJoystick a static method, as the number of
[wxWidgets.git] / include / wx / cocoa / NSMenu.h
index 2b43c336d27edf76554697055ee0376e72d78fc9..146b9d66b755c9dd46c330cfdd04317ed5d10ec9 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      David Elliott
 // Modified by:
 // Created:     2002/12/09
 // Author:      David Elliott
 // Modified by:
 // Created:     2002/12/09
-// RCS-ID:      $Id
+// RCS-ID:      $Id$
 // Copyright:   (c) 2002 David Elliott
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2002 David Elliott
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -13,7 +13,7 @@
 #define __WX_COCOA_NSMENU_H__
 
 #include "wx/hashmap.h"
 #define __WX_COCOA_NSMENU_H__
 
 #include "wx/hashmap.h"
-#include "wx/cocoa/ObjcPose.h"
+#include "wx/cocoa/ObjcAssociate.h"
 
 WX_DECLARE_OBJC_HASHMAP(NSMenu);
 
 
 WX_DECLARE_OBJC_HASHMAP(NSMenu);
 
@@ -23,28 +23,25 @@ WX_DECLARE_OBJC_HASHMAP(NSMenu);
 
 class wxCocoaNSMenu
 {
 
 class wxCocoaNSMenu
 {
-    WX_DECLARE_OBJC_INTERFACE(NSMenu)
-// ------------------------------------------------------------------------
-// initialization
-// ------------------------------------------------------------------------
+    WX_DECLARE_OBJC_INTERFACE_HASHMAP(NSMenu)
 public:
 public:
-    inline wxCocoaNSMenu()
-    {
-        m_cocoaNSMenu = NULL;
-    }
-    ~wxCocoaNSMenu();
-// ------------------------------------------------------------------------
-// Cocoa specifics
-// ------------------------------------------------------------------------
-public:
-    bool CocoaCreate(const wxString &title);
-    inline WX_NSMenu GetNSMenu() { return m_cocoaNSMenu; }
-protected:
-    WX_NSMenu m_cocoaNSMenu;
-// ------------------------------------------------------------------------
-// Implementation
-// ------------------------------------------------------------------------
+    void AssociateNSMenu(WX_NSMenu cocoaNSMenu, unsigned int flags = 0);
+    void DisassociateNSMenu(WX_NSMenu cocoaNSMenu);
+    enum
+    {   OBSERVE_DidAddItem          = 0x01
+    ,   OBSERVE_DidChangeItem       = 0x02
+    ,   OBSERVE_DidRemoveItem       = 0x04
+    ,   OBSERVE_DidSendAction       = 0x08
+    ,   OBSERVE_WillSendAction      = 0x10
+    };
+    virtual void Cocoa_dealloc() {}
+    virtual void CocoaNotification_menuDidAddItem(WX_NSNotification notification) {}
+    virtual void CocoaNotification_menuDidChangeItem(WX_NSNotification notification) {}
+    virtual void CocoaNotification_menuDidRemoveItem(WX_NSNotification notification) {}
+    virtual void CocoaNotification_menuDidSendAction(WX_NSNotification notification) {}
+    virtual void CocoaNotification_menuWillSendAction(WX_NSNotification notification) {}
 protected:
 protected:
+    static struct objc_object *sm_cocoaObserver;
 };
 
 #endif // _WX_COCOA_NSMENU_H_
 };
 
 #endif // _WX_COCOA_NSMENU_H_