From 6aa48db478fb668f45f4cc38532c603679a7cf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 17 Nov 2013 18:03:02 +0000 Subject: [PATCH] Add wxMenuBar::OSXGetAppleMenu(). Native OS X apps sometimes have certain app-wide comments in the Apple/app menu ("Check for Updates" is a typical example). Make it possible to write well-behaved OS X apps by exposing this menu to user code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/menu.h | 4 ++++ interface/wx/menu.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/wx/osx/menu.h b/include/wx/osx/menu.h index 3ef7699599..9eded8593b 100644 --- a/include/wx/osx/menu.h +++ b/include/wx/osx/menu.h @@ -146,6 +146,10 @@ public: // call this function to update it (m_menuBarFrame should be !NULL) void Refresh(bool eraseBackground = true, const wxRect *rect = NULL); +#if wxABI_VERSION >= 30001 + wxMenu *OSXGetAppleMenu() const { return m_appleMenu; } +#endif + static void SetAutoWindowMenu( bool enable ) { s_macAutoWindowMenu = enable ; } static bool GetAutoWindowMenu() { return s_macAutoWindowMenu ; } diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 636771f2e1..42d5f74648 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -408,6 +408,18 @@ public: */ static wxMenuBar* MacGetCommonMenuBar(); + /** + Returns the Apple menu. + + This is the leftmost menu with application's name as its title. You + shouldn't remove any items from it, but it is safe to insert extra menu + items or submenus into it. + + @onlyfor{wxosx} + @since 3.0.1 + */ + wxMenu *OSXGetAppleMenu() const; + wxFrame *GetFrame() const; bool IsAttached() const; virtual void Attach(wxFrame *frame);