Instead of m_menuBar use GetMenuBar() which will be modified (with next patch)

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
This commit is contained in:
David Elliott
2004-03-30 00:43:16 +00:00
parent 7fa23c09cd
commit 4224f05975
6 changed files with 27 additions and 27 deletions

View File

@@ -321,7 +321,7 @@ void wxMenu::UpdateAccel(wxMenuItem *item)
if ( IsAttached() )
{
m_menuBar->RebuildAccelTable();
GetMenuBar()->RebuildAccelTable();
}
}
//else: it is a separator, they can't have accels, nothing to do
@@ -419,9 +419,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
#endif // __WIN32__
// if we're already attached to the menubar, we must update it
if ( IsAttached() && m_menuBar->IsAttached() )
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
return TRUE;
@@ -532,10 +532,10 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
wxLogLastError(wxT("RemoveMenu"));
}
if ( IsAttached() && m_menuBar->IsAttached() )
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the chane won't be visible
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
// and from internal data structures
@@ -662,8 +662,8 @@ wxWindow *wxMenu::GetWindow() const
{
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;
}