menu fixes, also fixes #10479
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,6 +189,7 @@ private:
|
|||||||
static wxMenuBar* s_macCommonMenuBar ;
|
static wxMenuBar* s_macCommonMenuBar ;
|
||||||
|
|
||||||
wxMenu* m_rootMenu;
|
wxMenu* m_rootMenu;
|
||||||
|
wxMenu* m_appleMenu;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
||||||
};
|
};
|
||||||
|
@@ -503,18 +503,17 @@ void wxMenuBar::Init()
|
|||||||
m_menuBarFrame = NULL;
|
m_menuBarFrame = NULL;
|
||||||
m_invokingWindow = NULL;
|
m_invokingWindow = NULL;
|
||||||
m_rootMenu = new wxMenu();
|
m_rootMenu = new wxMenu();
|
||||||
wxMenu* applemenu = new wxMenu();
|
m_appleMenu = new wxMenu();
|
||||||
applemenu->SetAllowRearrange(false);
|
m_appleMenu->SetAllowRearrange(false);
|
||||||
applemenu->Append( wxApp::s_macAboutMenuItemId, "About..." );
|
m_appleMenu->Append( wxApp::s_macAboutMenuItemId, "About..." );
|
||||||
applemenu->AppendSeparator();
|
m_appleMenu->AppendSeparator();
|
||||||
applemenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." );
|
|
||||||
applemenu->AppendSeparator();
|
|
||||||
|
|
||||||
#if !wxOSX_USE_CARBON
|
#if !wxOSX_USE_CARBON
|
||||||
applemenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" );
|
m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." );
|
||||||
|
m_appleMenu->AppendSeparator();
|
||||||
|
m_appleMenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_rootMenu->AppendSubMenu(applemenu, "\x14") ;
|
m_rootMenu->AppendSubMenu(m_appleMenu, "\x14") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuBar::wxMenuBar()
|
wxMenuBar::wxMenuBar()
|
||||||
@@ -565,6 +564,7 @@ void wxMenuBar::MacInstallMenuBar()
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
m_rootMenu->GetPeer()->MakeRoot();
|
m_rootMenu->GetPeer()->MakeRoot();
|
||||||
|
// DisableMenuCommand( NULL , kHICommandPreferences ) ;
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
MenuBarHandle menubar = NULL ;
|
MenuBarHandle menubar = NULL ;
|
||||||
@@ -922,6 +922,8 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
|
|||||||
void wxMenuBar::UnsetInvokingWindow()
|
void wxMenuBar::UnsetInvokingWindow()
|
||||||
{
|
{
|
||||||
m_invokingWindow = NULL;
|
m_invokingWindow = NULL;
|
||||||
|
wxMenubarUnsetInvokingWindow(m_appleMenu);
|
||||||
|
|
||||||
wxMenu *menu;
|
wxMenu *menu;
|
||||||
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
|
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
|
||||||
|
|
||||||
@@ -937,6 +939,8 @@ void wxMenuBar::UnsetInvokingWindow()
|
|||||||
void wxMenuBar::SetInvokingWindow(wxFrame *frame)
|
void wxMenuBar::SetInvokingWindow(wxFrame *frame)
|
||||||
{
|
{
|
||||||
m_invokingWindow = frame;
|
m_invokingWindow = frame;
|
||||||
|
wxMenubarSetInvokingWindow(m_appleMenu, frame);
|
||||||
|
|
||||||
wxMenu *menu;
|
wxMenu *menu;
|
||||||
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
|
wxMenuList::compatibility_iterator node = m_menus.GetFirst();
|
||||||
|
|
||||||
|
@@ -55,7 +55,8 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ;
|
wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ;
|
||||||
m_peer = wxMenuItemImpl::Create( this, pParentMenu, id, text, entry, strHelp, kind, pSubMenu );
|
// use accessors for ID and Kind because they might have been changed in the base constructor
|
||||||
|
m_peer = wxMenuItemImpl::Create( this, pParentMenu, GetId(), text, entry, strHelp, GetKind(), pSubMenu );
|
||||||
delete entry;
|
delete entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user