]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
[ 1557284 ] wxGenericComboControl -> wxGenericComboCtrl
[wxWidgets.git] / src / gtk / dcclient.cpp
index 5d6c7a9c444377e7096da5e28807a3851e59d234..4c47974d553c53069df1c4f6b93c4d358eb42cab 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include "wx/fontutil.h"
+#include "wx/scrolwin.h"
 
 #include "wx/gtk/win_gtk.h"
 #include "wx/gtk/private.h"
@@ -326,11 +327,11 @@ wxWindowDC::wxWindowDC( wxWindow *window )
     
     if (m_owner && m_owner->m_wxwindow && (m_owner->GetLayoutDirection() == wxLayout_RightToLeft))
     {
+        // reverse sense
         m_signX = -1;
-        gint width;
-        gdk_window_get_geometry( GTK_PIZZA(m_owner->m_wxwindow)->bin_window,
-                                 NULL, NULL, &width, NULL, NULL );
-        m_deviceOriginX = width;;
+
+        // origin in the upper right corner
+        m_deviceOriginX = m_owner->GetClientSize().x;
     }
 }
 
@@ -837,7 +838,36 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
         }
 
         if (m_pen.GetStyle() != wxTRANSPARENT)
-            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
+        {
+#if 1
+            if ((m_pen.GetWidth() == 2) && (m_pen.GetCap() == wxCAP_ROUND) &&
+                (m_pen.GetJoin() == wxJOIN_ROUND) && (m_pen.GetStyle() == wxSOLID))
+            {
+                // Use 2 1-line rects instead
+                gdk_gc_set_line_attributes( m_penGC, 1, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND );
+
+                if (m_signX == -1)
+                {
+                    // Different for RTL
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx+1, yy, ww-2, hh-2 );
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy-1, ww, hh );
+                }
+                else
+                {
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-2, hh-2 );
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx-1, yy-1, ww, hh );
+                }
+                
+                // reset
+                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_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
+            }
+        }
     }
 
     CalcBoundingBox( x, y );
@@ -2121,6 +2151,11 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo
     rect.width = XLOG2DEVREL(width);
     rect.height = YLOG2DEVREL(height);
 
+    if (m_owner && m_owner->m_wxwindow && (m_owner->GetLayoutDirection() == wxLayout_RightToLeft))
+    {
+        rect.x -= rect.width;
+    }
+
     if (!m_currentClippingRegion.IsNull())
         m_currentClippingRegion.Intersect( rect );
     else
@@ -2297,7 +2332,7 @@ wxPaintDC::wxPaintDC( wxWindow *win )
         return;
 
     wxSize sz = win->GetSize();
-    m_paintClippingRegion = win->GetUpdateRegion();
+    m_paintClippingRegion = win->m_nativeUpdateRegion;
     wxLimitRegionToSize(m_paintClippingRegion, sz);
 
     GdkRegion *region = m_paintClippingRegion.GetRegion();