1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/mbarman.h
3 // Purpose: wxMenuBarManager class
4 // Author: David Elliott
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef __WX_COCOA_MBARMAN_H__
12 #define __WX_COCOA_MBARMAN_H__
16 #include "wx/toplevel.h"
18 DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver
);
20 // ========================================================================
22 // ========================================================================
23 class WXDLLIMPEXP_CORE wxMenuBarManager
: public wxObject
25 // ------------------------------------------------------------------------
26 // initialization/destruction
27 // ------------------------------------------------------------------------
30 virtual ~wxMenuBarManager();
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
35 static wxMenuBarManager
*GetInstance() { return sm_mbarmanInstance
; }
36 static void CreateInstance();
37 static void DestroyInstance();
39 static wxMenuBarManager
*sm_mbarmanInstance
;
40 // ------------------------------------------------------------------------
42 // ------------------------------------------------------------------------
44 void SetMainMenuBar(wxMenuBar
* menubar
);
45 void WindowDidBecomeKey(NSNotification
*notification
);
47 void WindowDidResignKey(NSNotification
*notification
);
48 void WindowDidBecomeMain(NSNotification
*notification
);
49 void WindowDidResignMain(NSNotification
*notification
);
50 void WindowWillClose(NSNotification
*notification
);
54 void SetMenuBar(wxMenuBar
* menubar
);
55 void InstallMenuBarForWindow(wxCocoaNSWindow
*win
);
56 void InstallMainMenu();
58 WX_NSMenu m_menuServices
;
59 WX_NSMenu m_menuWindows
;
61 // Is main menu bar the current one
62 bool m_mainMenuBarInstalled
;
63 // Main menu (if app provides one)
64 wxMenuBar
*m_mainMenuBar
;
65 wxMenuBarManagerObserver
*m_observer
;
66 WX_NSWindow m_currentNSWindow
;
70 #endif // _WX_COCOA_MBARMAN_H_