]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
Return wxFONTFAMILY_DEFAULT, not UNKNOWN, from wxFont::GetFamily().
[wxWidgets.git] / src / gtk / dcclient.cpp
index 0f3cd68a25ad3eb64a629f33ef99a27c97e6d1dc..f8cd7b6eaae7f4a122069813797b6c0e1f95e793 100644 (file)
@@ -269,6 +269,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
     m_font = window->GetFont();
 
     GtkWidget *widget = window->m_wxwindow;
+    m_gdkwindow = window->GTKGetDrawingWindow();
 
     // Some controls don't have m_wxwindow - like wxStaticBox, but the user
     // code should still be able to create wxClientDCs for them
@@ -278,6 +279,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
 
         wxCHECK_RET(widget, "DC needs a widget");
 
+        m_gdkwindow = widget->window;
         if (GTK_WIDGET_NO_WINDOW(widget))
             SetDeviceLocalOrigin(widget->allocation.x, widget->allocation.y);
     }
@@ -286,8 +288,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
     m_layout = pango_layout_new( m_context );
     m_fontdesc = pango_font_description_copy( widget->style->font_desc );
 
-    m_gdkwindow = widget->window;
-
     // Window not realized ?
     if (!m_gdkwindow)
     {
@@ -793,9 +793,8 @@ void wxWindowDCImpl::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoo
                 gdk_gc_set_ts_origin(gc, 0, 0);
         }
 
-        if (m_pen.GetStyle() != wxPENSTYLE_TRANSPARENT)
+        if ( m_pen.IsOk() && m_pen.GetStyle() != wxPENSTYLE_TRANSPARENT )
         {
-#if 1
             if ((m_pen.GetWidth() == 2) && (m_pen.GetCap() == wxCAP_ROUND) &&
                 (m_pen.GetJoin() == wxJOIN_ROUND) && (m_pen.GetStyle() == wxPENSTYLE_SOLID))
             {
@@ -818,7 +817,6 @@ void wxWindowDCImpl::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoo
                 gdk_gc_set_line_attributes( m_penGC, 2, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND );
             }
             else
-#endif
             {
                 // Just use X11 for other cases
                 gdk_draw_rectangle( m_gdkwindow, m_penGC, FALSE, xx, yy, ww-1, hh-1 );