]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/mbarman.h
compilation fix for windows compilers: _wrename is declared in io.h
[wxWidgets.git] / include / wx / cocoa / mbarman.h
CommitLineData
268bec5a
DE
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
65571936 9// Licence: wxWindows licence
268bec5a
DE
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
f1d04a42
DE
19DECLARE_WXCOCOA_OBJC_CLASS(wxMenuBarManagerObserver);
20
268bec5a
DE
21// ========================================================================
22// wxMenuBarManager
23// ========================================================================
24class WXDLLEXPORT wxMenuBarManager : public wxObject
25{
26// ------------------------------------------------------------------------
27// initialization/destruction
28// ------------------------------------------------------------------------
29public:
30 wxMenuBarManager();
31 virtual ~wxMenuBarManager();
32// ------------------------------------------------------------------------
33// Single instance
34// ------------------------------------------------------------------------
35public:
36 static wxMenuBarManager *GetInstance() { return sm_mbarmanInstance; }
37 static void CreateInstance();
38 static void DestroyInstance();
39protected:
40 static wxMenuBarManager *sm_mbarmanInstance;
41// ------------------------------------------------------------------------
42// Implementation
43// ------------------------------------------------------------------------
44public:
45 void SetMainMenuBar(wxMenuBar* menubar);
f1d04a42
DE
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
243f5c2d 53 void UpdateMenuBar();
268bec5a
DE
54protected:
55 void SetMenuBar(wxMenuBar* menubar);
f1d04a42 56 void InstallMenuBarForWindow(wxCocoaNSWindow *win);
268bec5a
DE
57 void InstallMainMenu();
58 WX_NSMenu m_menuApp;
59 WX_NSMenu m_menuServices;
60 WX_NSMenu m_menuWindows;
61 WX_NSMenu m_menuMain;
268bec5a
DE
62 // Is main menu bar the current one
63 bool m_mainMenuBarInstalled;
64 // Main menu (if app provides one)
65 wxMenuBar *m_mainMenuBar;
f1d04a42 66 wxMenuBarManagerObserver *m_observer;
af849107 67 WX_NSWindow m_currentNSWindow;
268bec5a
DE
68};
69
70#endif // wxUSE_MENUS
71#endif // _WX_COCOA_MBARMAN_H_