]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/cocoa/mbarman.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / cocoa / mbarman.h
... / ...
CommitLineData
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/mbarman.h
3// Purpose: wxMenuBarManager class
4// Author: David Elliott
5// Modified by:
6// Created: 2003/09/04
7// Copyright: (c) 2003 David Elliott
8// Licence: wxWindows licence
9///////////////////////////////////////////////////////////////////////////////
10
11#ifndef __WX_COCOA_MBARMAN_H__
12#define __WX_COCOA_MBARMAN_H__
13
14#if wxUSE_MENUS
15
16#include "wx/toplevel.h"
17
18DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver);
19
20// ========================================================================
21// wxMenuBarManager
22// ========================================================================
23class WXDLLIMPEXP_CORE wxMenuBarManager : public wxObject
24{
25// ------------------------------------------------------------------------
26// initialization/destruction
27// ------------------------------------------------------------------------
28public:
29 wxMenuBarManager();
30 virtual ~wxMenuBarManager();
31// ------------------------------------------------------------------------
32// Single instance
33// ------------------------------------------------------------------------
34public:
35 static wxMenuBarManager *GetInstance() { return sm_mbarmanInstance; }
36 static void CreateInstance();
37 static void DestroyInstance();
38protected:
39 static wxMenuBarManager *sm_mbarmanInstance;
40// ------------------------------------------------------------------------
41// Implementation
42// ------------------------------------------------------------------------
43public:
44 void SetMainMenuBar(wxMenuBar* menubar);
45 void WindowDidBecomeKey(NSNotification *notification);
46#if 0
47 void WindowDidResignKey(NSNotification *notification);
48 void WindowDidBecomeMain(NSNotification *notification);
49 void WindowDidResignMain(NSNotification *notification);
50 void WindowWillClose(NSNotification *notification);
51#endif // 0
52 void UpdateMenuBar();
53protected:
54 void SetMenuBar(wxMenuBar* menubar);
55 void InstallMenuBarForWindow(wxCocoaNSWindow *win);
56 void InstallMainMenu();
57 WX_NSMenu m_menuApp;
58 WX_NSMenu m_menuServices;
59 WX_NSMenu m_menuWindows;
60 WX_NSMenu m_menuMain;
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;
67};
68
69#endif // wxUSE_MENUS
70#endif // _WX_COCOA_MBARMAN_H_