From 4224f059750329cc68964eeb7b2633206e245e0d Mon Sep 17 00:00:00 2001 From: David Elliott Date: Tue, 30 Mar 2004 00:43:16 +0000 Subject: [PATCH] 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 --- src/mac/carbon/menu.cpp | 10 +++++----- src/mac/classic/menu.cpp | 10 +++++----- src/motif/menu.cpp | 2 +- src/msw/menu.cpp | 14 +++++++------- src/os2/menu.cpp | 14 +++++++------- src/univ/menu.cpp | 4 ++-- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/mac/carbon/menu.cpp b/src/mac/carbon/menu.cpp index 9a04c36935..c7a1407ab4 100644 --- a/src/mac/carbon/menu.cpp +++ b/src/mac/carbon/menu.cpp @@ -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; } diff --git a/src/mac/classic/menu.cpp b/src/mac/classic/menu.cpp index 9a04c36935..c7a1407ab4 100644 --- a/src/mac/classic/menu.cpp +++ b/src/mac/classic/menu.cpp @@ -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; } diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 6ec02dd1b5..2b2113f171 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -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() ) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 25ea2adc19..151427eca6 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -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; } diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 89d968065d..a834dd5e85 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -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 diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 0ebba81d19..a4cf5e1f75 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -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 -- 2.47.2