to traverse up the menu hierarchy to return the menu bar.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26476
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
- if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
+ if (wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
{
pSubMenu->MacBeforeDisplay( true ) ;
}
{
pSubMenu->MacBeforeDisplay( true ) ;
}
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
+ GetMenuBar()->Refresh();
if ( IsAttached() )
{
// otherwise, the change won't be visible
if ( IsAttached() )
{
// otherwise, the change won't be visible
+ GetMenuBar()->Refresh();
}
// and from internal data structures
}
// and from internal data structures
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return (wxWindow *) m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return (wxWindow *) GetMenuBar()->GetFrame();
wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
wxASSERT_MSG( pSubMenu->m_hMenu != NULL , wxT("invalid submenu added"));
pSubMenu->m_menuParent = this ;
- if (wxMenuBar::MacGetInstalledMenuBar() == m_menuBar)
+ if (wxMenuBar::MacGetInstalledMenuBar() == GetMenuBar())
{
pSubMenu->MacBeforeDisplay( true ) ;
}
{
pSubMenu->MacBeforeDisplay( true ) ;
}
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
+ GetMenuBar()->Refresh();
if ( IsAttached() )
{
// otherwise, the change won't be visible
if ( IsAttached() )
{
// otherwise, the change won't be visible
+ GetMenuBar()->Refresh();
}
// and from internal data structures
}
// and from internal data structures
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return (wxWindow *) m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return (wxWindow *) GetMenuBar()->GetFrame();
if (m_menuWidget)
{
// this is a dynamic Append
if (m_menuWidget)
{
// this is a dynamic Append
- pItem->CreateItem(m_menuWidget, m_menuBar, m_topLevelMenu);
+ pItem->CreateItem(m_menuWidget, GetMenuBar(), m_topLevelMenu);
}
if ( pItem->IsSubMenu() )
}
if ( pItem->IsSubMenu() )
- m_menuBar->RebuildAccelTable();
+ GetMenuBar()->RebuildAccelTable();
}
}
//else: it is a separator, they can't have accels, nothing to do
}
}
//else: it is a separator, they can't have accels, nothing to do
#endif // __WIN32__
// if we're already attached to the menubar, we must update it
#endif // __WIN32__
// if we're already attached to the menubar, we must update it
- if ( IsAttached() && m_menuBar->IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
+ GetMenuBar()->Refresh();
wxLogLastError(wxT("RemoveMenu"));
}
wxLogLastError(wxT("RemoveMenu"));
}
- if ( IsAttached() && m_menuBar->IsAttached() )
+ if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the chane won't be visible
{
// otherwise, the chane won't be visible
+ GetMenuBar()->Refresh();
}
// and from internal data structures
}
// and from internal data structures
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
{
if ( m_invokingWindow != NULL )
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return GetMenuBar()->GetFrame();
- m_menuBar->RebuildAccelTable();
+ GetMenuBar()->RebuildAccelTable();
}
}
} // wxMenu::UpdateAccel
}
}
} // wxMenu::UpdateAccel
//
// If we're already attached to the menubar, we must update it
//
//
// If we're already attached to the menubar, we must update it
//
- if (IsAttached() && m_menuBar->IsAttached())
+ if (IsAttached() && GetMenuBar()->IsAttached())
+ GetMenuBar()->Refresh();
,MPFROM2SHORT(pItem->GetId(), TRUE)
,(MPARAM)0
);
,MPFROM2SHORT(pItem->GetId(), TRUE)
,(MPARAM)0
);
- if (IsAttached() && m_menuBar->IsAttached())
+ if (IsAttached() && GetMenuBar()->IsAttached())
{
//
// Otherwise, the chane won't be visible
//
{
//
// Otherwise, the chane won't be visible
//
+ GetMenuBar()->Refresh();
{
if (m_invokingWindow != NULL)
return m_invokingWindow;
{
if (m_invokingWindow != NULL)
return m_invokingWindow;
- else if ( m_menuBar != NULL)
- return m_menuBar->GetFrame();
+ else if ( GetMenuBar() != NULL)
+ return GetMenuBar()->GetFrame();
return NULL;
} // end of wxMenu::GetWindow
return NULL;
} // end of wxMenu::GetWindow
wxWindow *wxMenu::GetRootWindow() const
{
wxWindow *wxMenu::GetRootWindow() const
{
{
// simple case - a normal menu attached to the menubar
{
// simple case - a normal menu attached to the menubar
}
// we're a popup menu but the trouble is that only the top level popup menu
}
// we're a popup menu but the trouble is that only the top level popup menu