X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8ca3d720efa16fe5aba8872a39c042c9775b8f5..09b895cb4a954494063eb17d3dc302a654fd99e5:/include/wx/mac/carbon/menu.h diff --git a/include/wx/mac/carbon/menu.h b/include/wx/mac/carbon/menu.h index 5718b3950b..4d5fa44c5a 100644 --- a/include/wx/mac/carbon/menu.h +++ b/include/wx/mac/carbon/menu.h @@ -12,11 +12,7 @@ #ifndef _WX_MENU_H_ #define _WX_MENU_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "menu.h" -#endif - -class WXDLLEXPORT wxFrame; +class WXDLLIMPEXP_FWD_CORE wxFrame; #include "wx/arrstr.h" @@ -24,7 +20,7 @@ class WXDLLEXPORT wxFrame; // Menu // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenu : public wxMenuBase +class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase { public: // ctors & dtor @@ -35,10 +31,6 @@ public: virtual ~wxMenu(); - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); virtual void Attach(wxMenuBarBase *menubar) ; virtual void Break(); @@ -51,7 +43,7 @@ public: // implementation only from now on // ------------------------------- - int MacGetIndexFromId( int id ) ; + int MacGetIndexFromId( int id ) ; int MacGetIndexFromItem( wxMenuItem *pItem ) ; void MacEnableMenu( bool bDoEnable ) ; // MacOS needs to know about submenus somewhere within this menu @@ -69,6 +61,14 @@ public: short MacGetMenuId() { return m_macMenuId ; } + wxInt32 MacHandleCommandProcess( wxMenuItem* item, int id, wxWindow* targetWindow = NULL ); + wxInt32 MacHandleCommandUpdateStatus( wxMenuItem* item, int id, wxWindow* targetWindow = NULL); + +protected: + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); + private: // common part of all ctors void Init(); @@ -99,7 +99,7 @@ private: // Menu Bar (a la Windows) // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase +class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase { public: // ctors & dtor @@ -108,7 +108,7 @@ public: // unused under MSW wxMenuBar(long style); // menubar takes ownership of the menus arrays but copies the titles - wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); + wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); virtual ~wxMenuBar(); // menubar construction @@ -122,8 +122,8 @@ public: virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const; virtual void EnableTop( size_t pos, bool flag ); - virtual void SetLabelTop( size_t pos, const wxString& label ); - virtual wxString GetLabelTop( size_t pos ) const; + virtual void SetMenuLabel( size_t pos, const wxString& label ); + virtual wxString GetMenuLabel( size_t pos ) const; virtual bool Enable( bool enable = TRUE ); // for virtual function hiding virtual void Enable( int itemid, bool enable ) @@ -153,17 +153,24 @@ public: // call this function to update it (m_menuBarFrame should be !NULL) void Refresh(bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL); - void MacInstallMenuBar() ; - static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; } - static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; } - static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; } + static void SetAutoWindowMenu( bool enable ) { s_macAutoWindowMenu = enable ; } + static bool GetAutoWindowMenu() { return s_macAutoWindowMenu ; } + + void MacInstallMenuBar() ; + static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; } + static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; } + static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; } + + static WXHMENU MacGetWindowMenuHMenu() { return s_macWindowMenuHandle ; } protected: // common part of all ctors void Init(); wxWindow *m_invokingWindow; - wxArrayString m_titles; + wxArrayString m_titles; + static bool s_macAutoWindowMenu ; + static WXHMENU s_macWindowMenuHandle ; private: static wxMenuBar* s_macInstalledMenuBar ;