]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/mdi.cpp
wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not
[wxWidgets.git] / src / gtk1 / mdi.cpp
index 99c278b2d53534c3830f47d8d1cb49b8ae095156..80686b497a5af1559ea7c7390e90f74400d9ef66 100644 (file)
@@ -7,10 +7,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "mdi.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -52,6 +48,7 @@ extern wxList wxPendingDelete;
 // "switch_page"
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void
 gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
                               GtkNotebookPage *page,
@@ -104,6 +101,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
     event2.SetEventObject( child);
     child->GetEventHandler()->ProcessEvent( event2 );
 }
+}
 
 //-----------------------------------------------------------------------------
 // wxMDIParentFrame
@@ -170,17 +168,19 @@ void wxMDIParentFrame::OnInternalIdle()
 
         /* need to set the menubar of the child */
         wxMDIChildFrame *active_child_frame = GetActiveChild();
-        wxMenuBar *menu_bar = active_child_frame->m_menuBar;
-        if (menu_bar)
+        if (active_child_frame != NULL)
         {
-            menu_bar->m_width = m_width;
-            menu_bar->m_height = wxMENU_HEIGHT;
-            gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
-                                menu_bar->m_widget,
-                                0, 0, m_width, wxMENU_HEIGHT );
-            menu_bar->SetInvokingWindow(active_child_frame);
+            wxMenuBar *menu_bar = active_child_frame->m_menuBar;
+            if (menu_bar)
+            {
+                menu_bar->m_width = m_width;
+                menu_bar->m_height = wxMENU_HEIGHT;
+                gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
+                                    menu_bar->m_widget,
+                                    0, 0, m_width, wxMENU_HEIGHT );
+                menu_bar->SetInvokingWindow(active_child_frame);
+            }
         }
-
         m_justInserted = false;
         return;
     }
@@ -433,6 +433,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title )
 // "size_allocate"
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -448,6 +449,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
 
     win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
 }
+}
 
 //-----------------------------------------------------------------------------
 // InsertChild callback for wxMDIClientWindow