]> git.saurik.com Git - wxWidgets.git/commitdiff
Instead of m_menuBar use GetMenuBar() which will be modified (with next patch)
authorDavid Elliott <dfe@tgwbd.org>
Tue, 30 Mar 2004 00:43:16 +0000 (00:43 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 30 Mar 2004 00:43:16 +0000 (00:43 +0000)
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
src/mac/classic/menu.cpp
src/motif/menu.cpp
src/msw/menu.cpp
src/os2/menu.cpp
src/univ/menu.cpp

index 9a04c36935ab6fddef1d2a1d6924ef36bb698944..c7a1407ab4816e9a65842f77973694e722b10c2f 100644 (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;
 }
index 9a04c36935ab6fddef1d2a1d6924ef36bb698944..c7a1407ab4816e9a65842f77973694e722b10c2f 100644 (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;
 }
index 6ec02dd1b5895e5dc4c3202215643c373867e11a..2b2113f171b3153b3c9aa4f7f2a0aeca7539b44e 100644 (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() )
index 25ea2adc19173472c8f2543ccc05b423000df512..151427eca6fc2e434c3e028529ad993ed81e35ec 100644 (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;
 }
index 89d968065d240da1ab429dcf14df738238c2e585..a834dd5e855bbd9d46248f215f862e53b9dc3beb 100644 (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
index 0ebba81d1978767532dfe5bab40cfd88f726da66..a4cf5e1f7570d64e8ffa5383e23047050f58ad29 100644 (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