From: Stefan Csomor Date: Mon, 14 Jan 2002 14:13:48 +0000 (+0000) Subject: corrected apple menu and help menu anomalies under carbon X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a3590de1a37120061fff390c92536c4eff0273c4 corrected apple menu and help menu anomalies under carbon git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 548f803aab..d00177fe92 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -626,10 +626,16 @@ void wxMenuBar::MacInstallMenuBar() wxString message ; wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); ::SetMenuBar( menubar ) ; +#if TARGET_API_MAC_CARBON + ::DisposeMenuBar( menubar ) ; +#else ::DisposeHandle( menubar ) ; +#endif MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; +#if TARGET_API_MAC_OS8 ::AppendResMenu(menu, 'DRVR'); +#endif for (int i = 0; i < m_menus.GetCount(); i++) { @@ -646,6 +652,11 @@ void wxMenuBar::MacInstallMenuBar() { continue ; } + + for ( int i = CountMenuItems( mh ) ; i >= firstUserHelpMenuItem ; --i ) + { + DeleteMenuItem( mh , i ) ; + } for (pos = 0 , node = menu->GetMenuItems().First(); node; node = node->Next(), pos++) { diff --git a/src/mac/menu.cpp b/src/mac/menu.cpp index 548f803aab..d00177fe92 100644 --- a/src/mac/menu.cpp +++ b/src/mac/menu.cpp @@ -626,10 +626,16 @@ void wxMenuBar::MacInstallMenuBar() wxString message ; wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); ::SetMenuBar( menubar ) ; +#if TARGET_API_MAC_CARBON + ::DisposeMenuBar( menubar ) ; +#else ::DisposeHandle( menubar ) ; +#endif MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; +#if TARGET_API_MAC_OS8 ::AppendResMenu(menu, 'DRVR'); +#endif for (int i = 0; i < m_menus.GetCount(); i++) { @@ -646,6 +652,11 @@ void wxMenuBar::MacInstallMenuBar() { continue ; } + + for ( int i = CountMenuItems( mh ) ; i >= firstUserHelpMenuItem ; --i ) + { + DeleteMenuItem( mh , i ) ; + } for (pos = 0 , node = menu->GetMenuItems().First(); node; node = node->Next(), pos++) {