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
This commit is contained in:
David Elliott 2003-06-19 18:17:33 +00:00
parent 523c2b8d45
commit 1b1d2207ea
3 changed files with 9 additions and 0 deletions

View 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)
};

View 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();

View 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();