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