]>
Commit | Line | Data |
---|---|---|
268bec5a DE |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/mbarman.h | |
3 | // Purpose: wxMenuBarManager class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/09/04 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2003 David Elliott | |
65571936 | 9 | // Licence: wxWindows licence |
268bec5a DE |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __WX_COCOA_MBARMAN_H__ | |
13 | #define __WX_COCOA_MBARMAN_H__ | |
14 | ||
15 | #if wxUSE_MENUS | |
16 | ||
17 | #include "wx/toplevel.h" | |
18 | ||
f1d04a42 DE |
19 | DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver); |
20 | ||
268bec5a DE |
21 | // ======================================================================== |
22 | // wxMenuBarManager | |
23 | // ======================================================================== | |
53a2db12 | 24 | class WXDLLIMPEXP_CORE wxMenuBarManager : public wxObject |
268bec5a DE |
25 | { |
26 | // ------------------------------------------------------------------------ | |
27 | // initialization/destruction | |
28 | // ------------------------------------------------------------------------ | |
29 | public: | |
30 | wxMenuBarManager(); | |
31 | virtual ~wxMenuBarManager(); | |
32 | // ------------------------------------------------------------------------ | |
33 | // Single instance | |
34 | // ------------------------------------------------------------------------ | |
35 | public: | |
36 | static wxMenuBarManager *GetInstance() { return sm_mbarmanInstance; } | |
37 | static void CreateInstance(); | |
38 | static void DestroyInstance(); | |
39 | protected: | |
40 | static wxMenuBarManager *sm_mbarmanInstance; | |
41 | // ------------------------------------------------------------------------ | |
42 | // Implementation | |
43 | // ------------------------------------------------------------------------ | |
44 | public: | |
45 | void SetMainMenuBar(wxMenuBar* menubar); | |
f1d04a42 DE |
46 | void WindowDidBecomeKey(NSNotification *notification); |
47 | #if 0 | |
48 | void WindowDidResignKey(NSNotification *notification); | |
49 | void WindowDidBecomeMain(NSNotification *notification); | |
50 | void WindowDidResignMain(NSNotification *notification); | |
51 | void WindowWillClose(NSNotification *notification); | |
52 | #endif // 0 | |
243f5c2d | 53 | void UpdateMenuBar(); |
268bec5a DE |
54 | protected: |
55 | void SetMenuBar(wxMenuBar* menubar); | |
f1d04a42 | 56 | void InstallMenuBarForWindow(wxCocoaNSWindow *win); |
268bec5a DE |
57 | void InstallMainMenu(); |
58 | WX_NSMenu m_menuApp; | |
59 | WX_NSMenu m_menuServices; | |
60 | WX_NSMenu m_menuWindows; | |
61 | WX_NSMenu m_menuMain; | |
268bec5a DE |
62 | // Is main menu bar the current one |
63 | bool m_mainMenuBarInstalled; | |
64 | // Main menu (if app provides one) | |
65 | wxMenuBar *m_mainMenuBar; | |
f1d04a42 | 66 | wxMenuBarManagerObserver *m_observer; |
af849107 | 67 | WX_NSWindow m_currentNSWindow; |
268bec5a DE |
68 | }; |
69 | ||
70 | #endif // wxUSE_MENUS | |
71 | #endif // _WX_COCOA_MBARMAN_H_ |