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

@@ -124,7 +124,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
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 ) ;
}
@@ -166,7 +166,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
return TRUE ;
}
@@ -263,7 +263,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
if ( IsAttached() )
{
// otherwise, the change won't be visible
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
// and from internal data structures
@@ -303,8 +303,8 @@ wxWindow *wxMenu::GetWindow() const
{
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();
return NULL;
}

View File

@@ -124,7 +124,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
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 ) ;
}
@@ -166,7 +166,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
// if we're already attached to the menubar, we must update it
if ( IsAttached() )
{
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
return TRUE ;
}
@@ -263,7 +263,7 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
if ( IsAttached() )
{
// otherwise, the change won't be visible
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
// and from internal data structures
@@ -303,8 +303,8 @@ wxWindow *wxMenu::GetWindow() const
{
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();
return NULL;
}

View File

@@ -119,7 +119,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *pItem)
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() )

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;
}

View File

@@ -226,7 +226,7 @@ void wxMenu::UpdateAccel(
if (IsAttached())
{
m_menuBar->RebuildAccelTable();
GetMenuBar()->RebuildAccelTable();
}
}
} // wxMenu::UpdateAccel
@@ -354,9 +354,9 @@ bool wxMenu::DoInsertOrAppend(
//
// 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;
}
@@ -497,12 +497,12 @@ wxMenuItem* wxMenu::DoRemove(
,MPFROM2SHORT(pItem->GetId(), TRUE)
,(MPARAM)0
);
if (IsAttached() && m_menuBar->IsAttached())
if (IsAttached() && GetMenuBar()->IsAttached())
{
//
// Otherwise, the chane won't be visible
//
m_menuBar->Refresh();
GetMenuBar()->Refresh();
}
//
@@ -615,8 +615,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;
} // end of wxMenu::GetWindow

View File

@@ -1235,10 +1235,10 @@ void wxMenu::Detach()
wxWindow *wxMenu::GetRootWindow() const
{
if ( m_menuBar )
if ( GetMenuBar() )
{
// simple case - a normal menu attached to the menubar
return m_menuBar;
return GetMenuBar();
}
// we're a popup menu but the trouble is that only the top level popup menu