From 1b1d2207ea3fe0b04d021bc9e7fa31a5d9464727 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Thu, 19 Jun 2003 18:17:33 +0000 Subject: [PATCH] Add ability to have a wxMenuBar as a common menu - static wxMenuBar::MacSetCommonMenuBar() - static wxMenuBar::MacGetCommonMenuBar() - static wxMenuBar::s_macCommonMenuBar; git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/menu.h | 3 +++ src/mac/carbon/menu.cpp | 3 +++ src/mac/menu.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/include/wx/mac/menu.h b/include/wx/mac/menu.h index e71cf26809..cc149e26ac 100644 --- a/include/wx/mac/menu.h +++ b/include/wx/mac/menu.h @@ -164,6 +164,8 @@ public: void MacInstallMenuBar() ; static wxMenuBar* MacGetInstalledMenuBar() { return s_macInstalledMenuBar ; } + static void MacSetCommonMenuBar(wxMenuBar* menubar) { s_macCommonMenuBar=menubar; } + static wxMenuBar* MacGetCommonMenuBar() { return s_macCommonMenuBar; } protected: // common part of all ctors @@ -178,6 +180,7 @@ protected: private: static wxMenuBar* s_macInstalledMenuBar ; + static wxMenuBar* s_macCommonMenuBar ; DECLARE_DYNAMIC_CLASS(wxMenuBar) }; diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 52aa871f16..70ea0b4fba 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -449,6 +449,7 @@ auto-merge for MDI in case this will be necessary */ wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ; +wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ; void wxMenuBar::Init() { @@ -485,6 +486,8 @@ wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[]) wxMenuBar::~wxMenuBar() { + if (s_macCommonMenuBar == this) + s_macCommonMenuBar = NULL; if (s_macInstalledMenuBar == this) { ::ClearMenuBar(); diff --git a/src/mac/menu.cpp b/src/mac/menu.cpp index 52aa871f16..70ea0b4fba 100644 --- a/src/mac/menu.cpp +++ b/src/mac/menu.cpp @@ -449,6 +449,7 @@ auto-merge for MDI in case this will be necessary */ wxMenuBar* wxMenuBar::s_macInstalledMenuBar = NULL ; +wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ; void wxMenuBar::Init() { @@ -485,6 +486,8 @@ wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[]) wxMenuBar::~wxMenuBar() { + if (s_macCommonMenuBar == this) + s_macCommonMenuBar = NULL; if (s_macInstalledMenuBar == this) { ::ClearMenuBar(); -- 2.45.2