]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Fixed [ 1556843 ] wxGTK FindFocus returns NULL when a wxListBox is focused
[wxWidgets.git] / src / generic / grid.cpp
index 5fcffb809e5681f3bd71cf5019027e27fec2ced7..68c6411e8f8413e3a36b09afe121b22bf17166aa 100644 (file)
@@ -3736,7 +3736,8 @@ void wxGridRowLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
 
     int x, y;
     m_owner->CalcUnscrolledPosition( 0, 0, &x, &y );
-    dc.SetDeviceOrigin( 0, -y );
+    wxPoint pt = dc.GetDeviceOrigin();
+    dc.SetDeviceOrigin( pt.x, pt.y-y );
 
     wxArrayInt rows = m_owner->CalcRowLabelsExposed( GetUpdateRegion() );
     m_owner->DrawRowLabels( dc, rows );
@@ -3806,7 +3807,11 @@ void wxGridColLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
 
     int x, y;
     m_owner->CalcUnscrolledPosition( 0, 0, &x, &y );
-    dc.SetDeviceOrigin( -x, 0 );
+    wxPoint pt = dc.GetDeviceOrigin();
+    if (GetLayoutDirection() == wxLayout_RightToLeft)
+        dc.SetDeviceOrigin( pt.x+x, pt.y );
+    else
+        dc.SetDeviceOrigin( pt.x-x, pt.y );
 
     wxArrayInt cols = m_owner->CalcColLabelsExposed( GetUpdateRegion() );
     m_owner->DrawColLabels( dc, cols );
@@ -6826,6 +6831,14 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
 
     if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) )
     {
+        if (GetLayoutDirection() == wxLayout_RightToLeft)
+        {
+            if (event.GetKeyCode() == WXK_RIGHT)
+                event.m_keyCode = WXK_LEFT;
+            else if (event.GetKeyCode() == WXK_LEFT)
+                event.m_keyCode = WXK_RIGHT;
+        }
+    
         // try local handlers
         switch ( event.GetKeyCode() )
         {
@@ -7739,7 +7752,12 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) )
     {
         i = GetColAt( colPos );
 
-        int colRight = GetColRight(i) - 1;
+        int colRight = GetColRight(i);
+#ifdef __WXGTK__
+        if (GetLayoutDirection() != wxLayout_RightToLeft)
+#endif
+            colRight--;
+
         if ( colRight > right )
         {
             break;