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
This commit is contained in:
Stefan Csomor
2002-01-20 16:32:03 +00:00
parent fe3fcb057f
commit d9e054bc61
2 changed files with 18 additions and 8 deletions

View File

@@ -613,13 +613,16 @@ void wxMenuBar::RebuildAccelTable()
} }
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
#ifdef WXMAKINGDLL
extern short gCurrentResource ;
#endif
void wxMenuBar::MacInstallMenuBar() void wxMenuBar::MacInstallMenuBar()
{ {
if ( s_macInstalledMenuBar == this ) if ( s_macInstalledMenuBar == this )
return ; return ;
wxStAppResource resload ;
Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ;
wxString message ; wxString message ;
wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); wxCHECK_RET( menubar != NULL, "can't read MBAR resource" );
@@ -632,7 +635,10 @@ void wxMenuBar::MacInstallMenuBar()
MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ;
#if TARGET_API_MAC_OS8 #if TARGET_API_MAC_OS8
::AppendResMenu(menu, 'DRVR'); if ( CountMenuItems( menu ) == 2 )
{
::AppendResMenu(menu, 'DRVR');
}
#endif #endif
for (int i = 0; i < m_menus.GetCount(); i++) for (int i = 0; i < m_menus.GetCount(); i++)
@@ -733,7 +739,6 @@ void wxMenuBar::MacInstallMenuBar()
} }
} }
::DrawMenuBar() ; ::DrawMenuBar() ;
s_macInstalledMenuBar = this; s_macInstalledMenuBar = this;
} }

View File

@@ -613,13 +613,16 @@ void wxMenuBar::RebuildAccelTable()
} }
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
#ifdef WXMAKINGDLL
extern short gCurrentResource ;
#endif
void wxMenuBar::MacInstallMenuBar() void wxMenuBar::MacInstallMenuBar()
{ {
if ( s_macInstalledMenuBar == this ) if ( s_macInstalledMenuBar == this )
return ; return ;
wxStAppResource resload ;
Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ; Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ;
wxString message ; wxString message ;
wxCHECK_RET( menubar != NULL, "can't read MBAR resource" ); wxCHECK_RET( menubar != NULL, "can't read MBAR resource" );
@@ -632,7 +635,10 @@ void wxMenuBar::MacInstallMenuBar()
MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ; MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ;
#if TARGET_API_MAC_OS8 #if TARGET_API_MAC_OS8
::AppendResMenu(menu, 'DRVR'); if ( CountMenuItems( menu ) == 2 )
{
::AppendResMenu(menu, 'DRVR');
}
#endif #endif
for (int i = 0; i < m_menus.GetCount(); i++) for (int i = 0; i < m_menus.GetCount(); i++)
@@ -733,7 +739,6 @@ void wxMenuBar::MacInstallMenuBar()
} }
} }
::DrawMenuBar() ; ::DrawMenuBar() ;
s_macInstalledMenuBar = this; s_macInstalledMenuBar = this;
} }