1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/mbarman.h
3 // Purpose: wxMenuBarManager class
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_MBARMAN_H__
13 #define __WX_COCOA_MBARMAN_H__
17 #include "wx/toplevel.h"
19 DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver
);
21 // ========================================================================
23 // ========================================================================
24 class WXDLLEXPORT wxMenuBarManager
: public wxObject
26 // ------------------------------------------------------------------------
27 // initialization/destruction
28 // ------------------------------------------------------------------------
31 virtual ~wxMenuBarManager();
32 // ------------------------------------------------------------------------
34 // ------------------------------------------------------------------------
36 static wxMenuBarManager
*GetInstance() { return sm_mbarmanInstance
; }
37 static void CreateInstance();
38 static void DestroyInstance();
40 static wxMenuBarManager
*sm_mbarmanInstance
;
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
45 void SetMainMenuBar(wxMenuBar
* menubar
);
46 void WindowDidBecomeKey(NSNotification
*notification
);
48 void WindowDidResignKey(NSNotification
*notification
);
49 void WindowDidBecomeMain(NSNotification
*notification
);
50 void WindowDidResignMain(NSNotification
*notification
);
51 void WindowWillClose(NSNotification
*notification
);
55 void SetMenuBar(wxMenuBar
* menubar
);
56 void InstallMenuBarForWindow(wxCocoaNSWindow
*win
);
57 void InstallMainMenu();
59 WX_NSMenu m_menuServices
;
60 WX_NSMenu m_menuWindows
;
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
;
71 #endif // _WX_COCOA_MBARMAN_H_