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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user