]> git.saurik.com Git - wxWidgets.git/commitdiff
Add ability to have a wxMenuBar as a common menu
authorDavid Elliott <dfe@tgwbd.org>
Thu, 19 Jun 2003 18:17:33 +0000 (18:17 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Thu, 19 Jun 2003 18:17:33 +0000 (18:17 +0000)
- 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
src/mac/carbon/menu.cpp
src/mac/menu.cpp

index e71cf268098e79223a47b7f2827359cb030d2190..cc149e26ac9f93fd90e717b88b1677505c823f1b 100644 (file)
@@ -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)
 };
index 52aa871f16dc9a21184c84cf526fb4f067d1055a..70ea0b4fba74f944185fc5b29c7e0db842666542 100644 (file)
@@ -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();
index 52aa871f16dc9a21184c84cf526fb4f067d1055a..70ea0b4fba74f944185fc5b29c7e0db842666542 100644 (file)
@@ -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();