]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
adding explicit log.h include
[wxWidgets.git] / src / gtk / window.cpp
index 0b4bb5f0e4084b78c0ea664c0dd79b74d142c480..830bfe04318411bc41b4de931919a32dd3bd412b 100644 (file)
@@ -257,11 +257,11 @@ gdk_window_warp_pointer (GdkWindow      *window,
 // "size_request" of m_widget
 //-----------------------------------------------------------------------------
 
-// make it extern because wxStaticText needs to disconnect this one
 extern "C" {
-void wxgtk_window_size_request_callback(GtkWidget * WXUNUSED(widget),
-                                        GtkRequisition *requisition,
-                                        wxWindow * win)
+static void
+wxgtk_window_size_request_callback(GtkWidget * WXUNUSED(widget),
+                                   GtkRequisition *requisition,
+                                   wxWindow * win)
 {
     int w, h;
     win->GetSize( &w, &h );
@@ -2095,6 +2095,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
 {
     // Get default border
     wxBorder border = GetBorder(style);
+
     style &= ~wxBORDER_MASK;
     style |= border;
 
@@ -2105,8 +2106,14 @@ bool wxWindowGTK::Create( wxWindow *parent,
         return false;
     }
 
+        // We should accept the native look
+#if 0
+        GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) );
+        scroll_class->scrollbar_spacing = 0;
+#endif
+
 
-    m_wxwindow = wxPizza::New(m_windowStyle);
+    m_wxwindow = wxPizza::New(m_windowStyle,this);
 #ifndef __WXUNIVERSAL__
     if (HasFlag(wxPizza::BORDER_STYLES))
     {
@@ -2122,12 +2129,6 @@ bool wxWindowGTK::Create( wxWindow *parent,
 
         GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
 
-        // We should accept the native look
-#if 0   
-        GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) );
-        scroll_class->scrollbar_spacing = 0;
-#endif
-
         // There is a conflict with default bindings at GTK+
         // level between scrolled windows and notebooks both of which want to use
         // Ctrl-PageUp/Down: scrolled windows for scrolling in the horizontal
@@ -2539,6 +2540,12 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
             event.SetEventObject( this );
             HandleWindowEvent( event );
         }
+    } else 
+    if (sizeFlags & wxSIZE_FORCE_EVENT)
+    {
+        wxSizeEvent event( wxSize(m_width,m_height), GetId() );
+        event.SetEventObject( this );
+        HandleWindowEvent( event );
     }
 }
 
@@ -2680,12 +2687,15 @@ void wxWindowGTK::DoGetClientSize( int *width, int *height ) const
                             continue;
                 }
 
+                GtkScrolledWindowClass *scroll_class =
+                    GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT_GET_CLASS(m_widget) );
+
                 GtkRequisition req;
                 gtk_widget_size_request(GTK_WIDGET(range), &req);
                 if (i == ScrollDir_Horz)
-                    h -= req.height;
+                    h -= req.height + scroll_class->scrollbar_spacing;
                 else
-                    w -= req.width;
+                    w -= req.width + scroll_class->scrollbar_spacing;
             }
         }