X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b781a6729859abc77e6ca5b1f81cbaad974a78f..b97e22c0ca7469762e422960245009648b0e0edf:/src/mac/carbon/menu.cpp diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 099f196f34..621494b83d 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -22,8 +22,10 @@ #pragma implementation "menuitem.h" #endif +#include "wx/app.h" #include "wx/menu.h" #include "wx/menuitem.h" +#include "wx/window.h" #include "wx/log.h" #include "wx/utils.h" @@ -362,7 +364,7 @@ wxWindow *wxMenu::GetWindow() const if ( m_invokingWindow != NULL ) return m_invokingWindow; else if ( m_menuBar != NULL) - return m_menuBar->GetFrame(); + return (wxWindow *) m_menuBar->GetFrame(); return NULL; } @@ -460,6 +462,7 @@ bool wxMenu::MacMenuSelect( wxEvtHandler* handler, long when , int macMenuId, in return true ; } } +#ifndef __WXMAC_X__ else if ( macMenuId == kHMHelpMenuID ) { int menuItem = formerHelpMenuItems ; @@ -508,6 +511,7 @@ bool wxMenu::MacMenuSelect( wxEvtHandler* handler, long when , int macMenuId, in } } } +#endif // __WXMAC_X__ for (pos = 0, node = GetMenuItems().First(); node; node = node->Next(), pos++) { @@ -627,6 +631,9 @@ void wxMenuBar::RebuildAccelTable() void wxMenuBar::MacInstallMenuBar() { + if ( s_macInstalledMenuBar == this ) + return ; + Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; wxString message ; wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); @@ -902,8 +909,11 @@ void wxMenuBar::MacMenuSelect(wxEvtHandler* handler, long when , int macMenuId, { for (int i = 0; i < m_menus.GetCount() ; i++) { - if ( m_menus[i]->MacGetMenuId() == macMenuId || + if ( m_menus[i]->MacGetMenuId() == macMenuId +#ifndef __WXMAC_X__ + || ( macMenuId == kHMHelpMenuID && ( m_titles[i] == "?" || m_titles[i] == "&?" || m_titles[i] == wxApp::s_macHelpMenuTitleName ) ) +#endif ) { if ( m_menus[i]->MacMenuSelect( handler , when , macMenuId , macMenuItemNum ) )