]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/NSMenu.h
Destroy the wxDialog::ShowWindowModalThenDo() functor a.s.a.p.
[wxWidgets.git] / include / wx / cocoa / NSMenu.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/NSMenu.h
3 // Purpose: wxCocoaNSMenu class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2002/12/09
7 // Copyright: (c) 2002 David Elliott
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef __WX_COCOA_NSMENU_H__
12 #define __WX_COCOA_NSMENU_H__
13
14 #include "wx/hashmap.h"
15 #include "wx/cocoa/ObjcAssociate.h"
16
17 WX_DECLARE_OBJC_HASHMAP(NSMenu);
18
19 // ========================================================================
20 // wxCocoaNSMenu
21 // ========================================================================
22
23 class wxCocoaNSMenu
24 {
25 WX_DECLARE_OBJC_INTERFACE_HASHMAP(NSMenu)
26 public:
27 void AssociateNSMenu(WX_NSMenu cocoaNSMenu, unsigned int flags = 0);
28 void DisassociateNSMenu(WX_NSMenu cocoaNSMenu);
29 enum
30 { OBSERVE_DidAddItem = 0x01
31 , OBSERVE_DidChangeItem = 0x02
32 , OBSERVE_DidRemoveItem = 0x04
33 , OBSERVE_DidSendAction = 0x08
34 , OBSERVE_WillSendAction = 0x10
35 };
36 virtual void Cocoa_dealloc() {}
37 virtual void CocoaNotification_menuDidAddItem(WX_NSNotification WXUNUSED(notification)) {}
38 virtual void CocoaNotification_menuDidChangeItem(WX_NSNotification WXUNUSED(notification)) {}
39 virtual void CocoaNotification_menuDidRemoveItem(WX_NSNotification WXUNUSED(notification)) {}
40 virtual void CocoaNotification_menuDidSendAction(WX_NSNotification WXUNUSED(notification)) {}
41 virtual void CocoaNotification_menuWillSendAction(WX_NSNotification WXUNUSED(notification)) {}
42 virtual ~wxCocoaNSMenu() { }
43
44 protected:
45 static struct objc_object *sm_cocoaObserver;
46 };
47
48 #endif // _WX_COCOA_NSMENU_H_