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 // ========================================================================
21 // ========================================================================
22 class WXDLLEXPORT wxMenuBarManager
: public wxObject
24 // ------------------------------------------------------------------------
25 // initialization/destruction
26 // ------------------------------------------------------------------------
29 virtual ~wxMenuBarManager();
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
34 static wxMenuBarManager
*GetInstance() { return sm_mbarmanInstance
; }
35 static void CreateInstance();
36 static void DestroyInstance();
38 static wxMenuBarManager
*sm_mbarmanInstance
;
39 // ------------------------------------------------------------------------
41 // ------------------------------------------------------------------------
43 void SetMainMenuBar(wxMenuBar
* menubar
);
44 void CocoaInternalIdle();
45 void WindowDidBecomeKey(wxTopLevelWindowNative
*win
);
46 void WindowDidResignKey(wxTopLevelWindowNative
*win
);
47 void WindowDidBecomeMain(wxTopLevelWindowNative
*win
);
48 void WindowDidResignMain(wxTopLevelWindowNative
*win
);
49 void UpdateWindowMenuBar(wxTopLevelWindowNative
*win
);
51 void SetMenuBar(wxMenuBar
* menubar
);
52 void InstallMenuBarForWindow(wxTopLevelWindowNative
*win
);
53 void InstallMainMenu();
55 WX_NSMenu m_menuServices
;
56 WX_NSMenu m_menuWindows
;
58 // Some menu bar needs to be installed
60 // Is main menu bar the current one
61 bool m_mainMenuBarInstalled
;
62 // Main menu (if app provides one)
63 wxMenuBar
*m_mainMenuBar
;
64 wxTopLevelWindowNative
*m_windowKey
;
65 wxTopLevelWindowNative
*m_windowMain
;
69 #endif // _WX_COCOA_MBARMAN_H_