From: Stefan Csomor Date: Sun, 20 Jan 2002 16:32:03 +0000 (+0000) Subject: resource loader structure added for loading menu bar, apple menu will not get multipl... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d9e054bc6147fb286b6de2fcfe50e2ecf5649843 resource loader structure added for loading menu bar, apple menu will not get multiple entries under classic anymore git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index e53992df98..1159391d37 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -613,13 +613,16 @@ void wxMenuBar::RebuildAccelTable() } #endif // wxUSE_ACCEL - - +#ifdef WXMAKINGDLL +extern short gCurrentResource ; +#endif void wxMenuBar::MacInstallMenuBar() { if ( s_macInstalledMenuBar == this ) return ; + wxStAppResource resload ; + Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; wxString message ; wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); @@ -632,7 +635,10 @@ void wxMenuBar::MacInstallMenuBar() MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; #if TARGET_API_MAC_OS8 - ::AppendResMenu(menu, 'DRVR'); + if ( CountMenuItems( menu ) == 2 ) + { + ::AppendResMenu(menu, 'DRVR'); + } #endif for (int i = 0; i < m_menus.GetCount(); i++) @@ -733,7 +739,6 @@ void wxMenuBar::MacInstallMenuBar() } } ::DrawMenuBar() ; - s_macInstalledMenuBar = this; } diff --git a/src/mac/menu.cpp b/src/mac/menu.cpp index e53992df98..1159391d37 100644 --- a/src/mac/menu.cpp +++ b/src/mac/menu.cpp @@ -613,13 +613,16 @@ void wxMenuBar::RebuildAccelTable() } #endif // wxUSE_ACCEL - - +#ifdef WXMAKINGDLL +extern short gCurrentResource ; +#endif void wxMenuBar::MacInstallMenuBar() { if ( s_macInstalledMenuBar == this ) return ; + wxStAppResource resload ; + Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; wxString message ; wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); @@ -632,7 +635,10 @@ void wxMenuBar::MacInstallMenuBar() MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; #if TARGET_API_MAC_OS8 - ::AppendResMenu(menu, 'DRVR'); + if ( CountMenuItems( menu ) == 2 ) + { + ::AppendResMenu(menu, 'DRVR'); + } #endif for (int i = 0; i < m_menus.GetCount(); i++) @@ -733,7 +739,6 @@ void wxMenuBar::MacInstallMenuBar() } } ::DrawMenuBar() ; - s_macInstalledMenuBar = this; }