]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/mdi.cpp
Fix assorted typos in comments and other non-code.
[wxWidgets.git] / src / gtk1 / mdi.cpp
index 5e83afe2c28488383ed6efa4c4f7bc926418d2b6..b20e2462050b83e6cdab41e9c391788d22065058 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/gtk1/mdi.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -178,7 +177,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 +208,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 +223,7 @@ void wxMDIParentFrame::OnInternalIdle()
                 {
                     if (menu_bar->Show(false))
                     {
-                        menu_bar->UnsetInvokingWindow( child_frame );
+                        menu_bar->Detach();
                     }
                 }
             }
@@ -233,12 +239,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;
@@ -422,7 +428,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
 static void wxInsertChildInMDI( wxMDIClientWindow* parent, wxMDIChildFrame* child )
 {
     wxString s = child->GetTitle();
-    if (s.IsNull()) s = _("MDI child");
+    if ( s.empty() ) s = _("MDI child");
 
     GtkWidget *label_widget = gtk_label_new( s.mbc_str() );
     gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );