]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/mbarman.h
don't do anything in SetWindowMenu() if we're setting the same menu as we already...
[wxWidgets.git] / include / wx / cocoa / mbarman.h
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
9 // Licence: wxWindows licence
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
19 DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver);
20
21 // ========================================================================
22 // wxMenuBarManager
23 // ========================================================================
24 class WXDLLIMPEXP_CORE wxMenuBarManager : public wxObject
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);
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
53 void UpdateMenuBar();
54 protected:
55 void SetMenuBar(wxMenuBar* menubar);
56 void InstallMenuBarForWindow(wxCocoaNSWindow *win);
57 void InstallMainMenu();
58 WX_NSMenu m_menuApp;
59 WX_NSMenu m_menuServices;
60 WX_NSMenu m_menuWindows;
61 WX_NSMenu m_menuMain;
62 // Is main menu bar the current one
63 bool m_mainMenuBarInstalled;
64 // Main menu (if app provides one)
65 wxMenuBar *m_mainMenuBar;
66 wxMenuBarManagerObserver *m_observer;
67 WX_NSWindow m_currentNSWindow;
68 };
69
70 #endif // wxUSE_MENUS
71 #endif // _WX_COCOA_MBARMAN_H_