]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/mdi.cpp
Refactor: use wxBookCtrlBase::m_selection in all derived classes.
[wxWidgets.git] / src / gtk1 / mdi.cpp
index 250bd2dd1bd4ea76e7340a3d8e4176bf7292afa8..e2cb0b3765802afb09d8746310c6df0b38787a87 100644 (file)
@@ -178,7 +178,7 @@ void wxMDIParentFrame::OnInternalIdle()
                 gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
                                     menu_bar->m_widget,
                                     0, 0, m_width, wxMENU_HEIGHT );
-                menu_bar->SetInvokingWindow(active_child_frame);
+                menu_bar->Attach(active_child_frame);
             }
         }
         m_justInserted = false;
@@ -209,7 +209,14 @@ void wxMDIParentFrame::OnInternalIdle()
                         gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
                                             menu_bar->m_widget,
                                             0, 0, m_width, wxMENU_HEIGHT );
-                        menu_bar->SetInvokingWindow( child_frame );
+
+                        // Attach() asserts if we call it for an already
+                        // attached menu bar so don't do it if we're already
+                        // associated with this frame (it would be nice to get
+                        // rid of this check and ensure that this doesn't
+                        // happen...)
+                        if ( menu_bar->GetFrame() != child_frame )
+                        menu_bar->Attach( child_frame );
                     }
                     visible_child_menu = true;
                 }
@@ -217,7 +224,7 @@ void wxMDIParentFrame::OnInternalIdle()
                 {
                     if (menu_bar->Show(false))
                     {
-                        menu_bar->UnsetInvokingWindow( child_frame );
+                        menu_bar->Detach();
                     }
                 }
             }
@@ -233,12 +240,12 @@ void wxMDIParentFrame::OnInternalIdle()
         if (visible_child_menu)
         {
             m_frameMenuBar->Show( false );
-            m_frameMenuBar->UnsetInvokingWindow( this );
+            m_frameMenuBar->Detach();
         }
         else
         {
             m_frameMenuBar->Show( true );
-            m_frameMenuBar->SetInvokingWindow( this );
+            m_frameMenuBar->Attach( this );
 
             m_frameMenuBar->m_width = m_width;
             m_frameMenuBar->m_height = wxMENU_HEIGHT;
@@ -267,7 +274,7 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
     {
         wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
 
-        wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
+        wxASSERT_MSG( child_frame, wxT("child is not a wxMDIChildFrame") );
 
         if (child_frame->m_page == page)
             return child_frame;