]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/mdi.cpp
Fix scrolling bug where client size was reported wrong
[wxWidgets.git] / src / gtk / mdi.cpp
index 92604075e1362da4a51ad73e1567949e96478da3..031eae9e191359f4cb62081105d1b509fd987525 100644 (file)
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_MDI
+
 #include "wx/mdi.h"
-#include "wx/notebook.h"
 
-#if wxUSE_MDI
+#ifndef WX_PRECOMP
+    #include "wx/intl.h"
+    #include "wx/menu.h"
+    #include "wx/dialog.h"
+#endif
 
-#include "wx/dialog.h"
-#include "wx/menu.h"
-#include "wx/intl.h"
+#include "wx/notebook.h"
 #include "wx/gtk/private.h"
 
 #include <glib.h>
 
 const int wxMENU_HEIGHT = 27;
 
-//-----------------------------------------------------------------------------
-// idle system
-//-----------------------------------------------------------------------------
-
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
-
 //-----------------------------------------------------------------------------
 // globals
 //-----------------------------------------------------------------------------
 
-extern wxList wxPendingDelete;
-
 //-----------------------------------------------------------------------------
 // "switch_page"
 //-----------------------------------------------------------------------------
@@ -77,16 +71,14 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
     child = (wxMDIChildFrame*) NULL;
 
     wxWindowList::compatibility_iterator node = client_window->GetChildren().GetFirst();
-    while (node)
+    while ( node )
     {
         wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
-        // CE: we come here in the destructor with a null child_frame - I think because
-        // g_signal_connect (m_widget, "switch_page", (see below)
-        // isn't deleted early enough
-        if (!child_frame)
-          return ;
 
-        if (child_frame->m_page == page)
+        // child_frame can be NULL when this is called from dtor, probably
+        // because g_signal_connect (m_widget, "switch_page", (see below)
+        // isn't deleted early enough
+        if ( child_frame && child_frame->m_page == page )
         {
             child = child_frame;
             break;
@@ -134,9 +126,9 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
     return true;
 }
 
-void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
+void wxMDIParentFrame::GtkOnSize()
 {
-    wxFrame::GtkOnSize( x, y, width, height );
+    wxFrame::GtkOnSize();
 
     wxMDIChildFrame *child_frame = GetActiveChild();
     if (!child_frame) return;
@@ -249,11 +241,6 @@ void wxMDIParentFrame::OnInternalIdle()
     }
 }
 
-void wxMDIParentFrame::DoGetClientSize(int *width, int *height ) const
-{
-    wxFrame::DoGetClientSize( width, height );
-}
-
 wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
 {
     if (!m_clientWindow) return (wxMDIChildFrame*) NULL;